【发布时间】:2014-02-28 12:37:46
【问题描述】:
使用Eclipse Helios
如何从rcp 应用程序中删除图标。代码在这里...
@SuppressWarnings("限制") 受保护的无效填充菜单栏(IMenuManager menuBar){ @SuppressWarnings("限制") 最终 ActionSetRegistry reg = WorkbenchPlugin.getDefault() .getActionSetRegistry(); @SuppressWarnings("限制") 最终 IActionSetDescriptor[] actionSets = reg.getActionSets(); 最终 String[] removeActionSets = new String[] { "org.eclipse.search.searchActionSet", "org.eclipse.ui.cheatsheets.actionSet", "org.eclipse.ui.actionSet.keyBindings", "org.eclipse.ui.edit.text.actionSet.navigation", "org.eclipse.ui.edit.text.actionSet.annotationNavigation", "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo", "org.eclipse.ui.edit.text.actionSet.openExternalFile", "org.eclipse.ui.externaltools.ExternalToolsSet", "org.eclipse.ui.WorkingSetActionSet", "org.eclipse.update.ui.softwareUpdates", "org.eclipse.ui.actionSet.openFiles", “org.eclipse.mylyn.tasks.ui.navigation”};
for (int i = 0; i < actionSets.length; i++) {
boolean found = false;
for (int j = 0; j < removeActionSets.length; j++) {
if (removeActionSets[j].equals(actionSets[i].getId())) {
found = true;
final IExtension ext = actionSets[i]
.getConfigurationElement().getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
}
if (!found) {
continue;
}
}
}
【问题讨论】:
-
这是一个带有您自己的
ActionBarAdvisor的 RCP,还是使用 Eclipse IDE 操作栏顾问? -
它是 Eclipse IDE 操作栏顾问。默认情况下,它在我的应用程序中。
标签: eclipse-rcp rcp