use of org.eclipse.ui.application.IActionBarConfigurer in project translationstudio8 by heartsome.
the class ApplicationWorkbenchWindowAdvisor method postWindowCreate.
/**
* 删除 RCP 自带的工具栏按钮
*/
public void postWindowCreate() {
IActionBarConfigurer actionBarConfigurer = getWindowConfigurer().getActionBarConfigurer();
IContributionItem[] coolItems = actionBarConfigurer.getCoolBarManager().getItems();
for (int i = 0; i < coolItems.length; i++) {
if (coolItems[i] instanceof ToolBarContributionItem) {
ToolBarContributionItem toolbarItem = (ToolBarContributionItem) coolItems[i];
if (toolbarItem.getId().equals("org.eclipse.ui.WorkingSetActionSet") || toolbarItem.getId().equals("org.eclipse.ui.edit.text.actionSet.annotationNavigation") || toolbarItem.getId().equals("org.eclipse.ui.edit.text.actionSet.navigation")) {
toolbarItem.getToolBarManager().removeAll();
}
}
}
actionBarConfigurer.getCoolBarManager().update(true);
addAutoPluginMenu();
}
Aggregations