[英]Order of toolbar buttons in Eclipse Kepler
我试图通过两个不同的plugin.xml文件为同一自定义工具栏做出贡献。 不幸的是,我找不到指定按钮显示顺序的方法。 应该是最后一个的按钮将显示为第一个按钮。
我已经尝试通过使用指定插入位置
...
MenuManager manager = new MenuManager(null, "my.toolbar.id");
IMenuService menuService = (IMenuService) getEditorSite().getService( IMenuService.class);
manager.add(new GroupMarker("testing"));
menuService.populateContributionManager(manager, "toolbar:my.toolbar.id?after=testing");
...
并在plugin.xml中
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:my.toolbar.id?after=testing">
<toolbar id="my.toolbar.id">
<command ...
有人知道什么地方可能出问题吗?
我终于弄明白了。
在主要的plugin.xml文件中,必须在工具栏上定义分隔符,并应在其中插入其他按钮。
在第二个plugin.xml文件中,工具栏的显示应类似于以下内容:
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:my.toolbar.id?after=mainAdditions">
<!-- no toolbar element with id here-->
<command ...
</menuContribution>
其中mainAdditions是分隔符的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.