wiki:RemoveUnwantedMenuEntries

Version 1 (modified by jdamerow, 16 years ago) (diff)

--

How to remove unwanted menu entries

[eclipse:eclipse < back]

See here for more information.

Paste the following code snippet at the end of your makeAction method in your actionBarAdvisor:

    ActionSetRegistry reg = WorkbenchPlugin.getDefault()
	.getActionSetRegistry();
    IActionSetDescriptor[] actionSets = reg.getActionSets();

    for (int i = 0; i < actionSets.length; i++) {
	if (actionSets[i].getId().equals(
		"org.eclipse.ui.actionSet.openFiles")) {
	IExtension ext = actionSets[i].getConfigurationElement()
		.getDeclaringExtension();
	reg.removeExtension(ext, new Object[] { actionSets[i] });
	break;
    }