Org.eclipse.ui.menus Extension Point Learning

Source: Internet
Author: User

Eclipse Menu:

Menu:help?after=addtions

Menu:navigate?after=open.ext2

Menu:window?after=neweditor

Menu:file?after=open.ext

Org.eclipse.ui.menus Property

    1. Locationuri----------identifies where the command associated with the menu item in the user interface will appear.

Locationuri= "[Scheme]:[id]? [Argument-list] "

The Locationuri attribute is decomposed into three distinct parts: pattern (scheme), identifier (identifier), and argument list (argument list)

Scheme identifies the type of UI object that the Add item will be added to. It can be one of the following values:

    • Menu ——— Program main Menu or view drop-down
    • Popup ——— the context menu for the view or editor
    • Toolbar ——— a toolbar in the main toolbar or view of a program

Identifier defines a unique identifier for the menu, popup, or toolbar that will be added to. Some commonly used identifiers include the following:

    • Org.eclipse.ui.main.menu ——— The Eclipse main Menu identifier
    • Org.eclipse.ui.main.toolbar ——— The ID of the Eclipse main toolbar
    • Org.eclipse.ui.popup.any ——— An identifier for any context menu.

Agrument list. The argument list consists of a layout that can be "before" or "after", an equal sign ("="), and an identifier for some items of a menu, popup, or toolbar. The identifier can also be "additions", indicating that the element should be placed in the default location for a given menu, popup, or toolbar.

Instance

<extension Point= "Org.eclipse.ui.menus" > <menucontribution allpopups= "false"Locationuri= "Toolbar:org.eclipse.ui.main.toolbar?after=additions" > <Toolbar ID= "Cn.com.agree.ide.afa.navigation.saveToolbar" > <Command CommandId= "Org.eclipse.ui.file.save"icon= "Icons/save_edit.gif"label= "Save"style= "Push"tooltip= "Save" > </command> <Command CommandId= "Org.eclipse.ui.file.saveAll"icon= "Icons/saveall_edit.gif"label= "Save All"style= "Push"tooltip= "Save All" > </command> </toolbar> </menuContribution>
< menucontribution allpopups= "false"  locationuri= "toolbar:or               G.eclipse.ui.main.toolbar?after=cn.com.agree.ide.afa.navigation.savetoolbar  > <  toolbar Id= "Cn.com.agree.ide.afa.workbench.searchToolbar" > <  command commandid= "ORG.E Clipse.search.ui.openSearchDialog " icon=" icons/search.gif " label=" search " style=" pulldown   tooltip= "Search" > </command> </toolbar> </menuContribution> <menucontribution allpopups= "true" locationuri= "Menu:org.eclipse.search.ui.openSearchDialog" > <command Commandid= "Org.eclipse.search.ui.openFileSearchPage" icon= "Icons/search.gif" label= "File Search" style= "push" tooltip= "File Search" > </command> </menucontribution>       

Red code is a good example of Org.eclipse.ui.menus application, as follows

Org.eclipse.ui.menus Extension Point Learning

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.