RCP 开发中去掉系统默认的菜单项和工具项?ActionSetRegistry reg WorkbenchPlugin.getDefault().getActi
RCP 开发中去掉系统默认的菜单项和工具项
?
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
// removing annoying gotoLastPosition Message.
String actionSetId = "org.eclipse.ui.edit.text.actionSet.navigation"; //$NON-NLS-1$
for (int i = 0; i <actionSets.length; i++)
{
??? if (!actionSets[i].getId().equals(actionSetId))
??????? continue;
??????? IExtension ext = actionSets[i].getConfigurationElement()
??????????? .getDeclaringExtension();
??????? reg.removeExtension(ext, new Object[] { actionSets[i] });
}
// Removing convert line delimiters menu.
actionSetId = "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"; //$NON-NLS-1$
for (int i = 0; i <actionSets.length; i++)
{
??? if (!actionSets[i].getId().equals(actionSetId))
??????? continue;
??? IExtension ext = actionSets[i].getConfigurationElement()
??????????? .getDeclaringExtension();
?? reg.removeExtension(ext, new Object[] { actionSets[i] });
}
?