diff options
author | Paul Webster | 2009-04-15 18:32:55 +0000 |
---|---|---|
committer | Paul Webster | 2009-04-15 18:32:55 +0000 |
commit | 54d7e2711fc031b9ac93332f5afcb86c468cabb6 (patch) | |
tree | dfbf18f5bbbc6c9b198650255ec6888c14ec4aa9 | |
parent | c7c73403dc0cda88d35dd717d6e50e5e9bd61736 (diff) | |
download | org.eclipse.e4.ui-54d7e2711fc031b9ac93332f5afcb86c468cabb6.tar.gz org.eclipse.e4.ui-54d7e2711fc031b9ac93332f5afcb86c468cabb6.tar.xz org.eclipse.e4.ui-54d7e2711fc031b9ac93332f5afcb86c468cabb6.zip |
Bug 271331 [Compatibility] Fill in the main menu with menu contributions
read in o.e.ui.handlers as well
-rw-r--r-- | bundles/org.eclipse.e4.ui.workbench.fragment/src/org/eclipse/ui/LegacyHandlerService.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.fragment/src/org/eclipse/ui/LegacyHandlerService.java b/bundles/org.eclipse.e4.ui.workbench.fragment/src/org/eclipse/ui/LegacyHandlerService.java index edd8e1b0..bbe3db1a 100644 --- a/bundles/org.eclipse.e4.ui.workbench.fragment/src/org/eclipse/ui/LegacyHandlerService.java +++ b/bundles/org.eclipse.e4.ui.workbench.fragment/src/org/eclipse/ui/LegacyHandlerService.java @@ -456,6 +456,34 @@ public class LegacyHandlerService implements IHandlerService { * @see org.eclipse.ui.handlers.IHandlerService#readRegistry() */ public void readRegistry() { + readDefaultHandlers(); + readHandlers(); + } + + private void readHandlers() { + IConfigurationElement[] elements = ExtensionUtils + .getExtensions(IWorkbenchRegistryConstants.PL_HANDLERS); + for (IConfigurationElement configElement : elements) { + String commandId = configElement + .getAttribute(IWorkbenchRegistryConstants.ATT_COMMAND_ID); + if (commandId == null || commandId.length() == 0) { + continue; + } + String defaultHandler = configElement + .getAttribute(IWorkbenchRegistryConstants.ATT_CLASS); + if ((defaultHandler == null) + && (configElement + .getChildren(IWorkbenchRegistryConstants.TAG_CLASS).length == 0)) { + continue; + } + registerLegacyHandler(eclipseContext, commandId, commandId, + new org.eclipse.ui.internal.handlers.HandlerProxy( + commandId, configElement, + IWorkbenchRegistryConstants.ATT_CLASS)); + } + } + + private void readDefaultHandlers() { IConfigurationElement[] elements = ExtensionUtils .getExtensions(IWorkbenchRegistryConstants.PL_COMMANDS); for (IConfigurationElement configElement : elements) { |