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
- 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