Eclipse菜单:eclipse
menu:help?after=addtions编辑器
menu:navigate?after=open.ext2ide
menu:window?after=newEditor工具
menu:file?after=open.ext布局
org.eclipse.ui.menus属性ui
locationURI="[scheme]:[identifier]?[argument-list]"spa
locationURI属性被分解为三个清晰的部分:模式(scheme)、标识符(identifier)和参数列表(argument list)code
scheme标识添加项将要添加至的UI对象的类型。它能够是如下值的其中这一:orm
identifier定义了将要添加至的菜单、弹出项或工具栏的惟一标识符。一些经常使用的标识符包括:对象
agrument list。参数列表由能够是"before"或"after"的布局,一个等号(“=”),以及菜单 、弹出项或工具栏的一些项的标识符组成。标识符也能够是“additions”,表示元素应当被放置于给定菜单、弹出项或工具栏的默认位置 ("="等号后面能够接着一个acitonID,这样子就布局到这个action的后面,实现分组布局)。
实例
<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:org.eclipse.ui.main.toolbar?after=cn.com.agree.ide.afa.navigation.saveToolbar"> <toolbar id="cn.com.agree.ide.afa.workbench.searchToolbar"> <command commandId="org.eclipse.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>
红色代码是较好的org.eclipse.ui.menus应用实例,效果图以下
快捷键
M1--------Ctrl
M2--------Shift
M3--------Alt
org.eclipse.ui.actionSets扩展点
toolbarPath指定工具栏中此操做的位置,以'/'定界路径,第一个标记表示工具栏标识(Normal表示是缺省的工具栏),第二个标记为工具栏内的命名组(也能够是工具栏上的separator,这样就能实现和org.eclipse.ui.menus整合布局),若不存在改组,则会建立。省略该选项,action将不会出如今工具栏。