Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Webster2009-04-15 18:32:55 +0000
committerPaul Webster2009-04-15 18:32:55 +0000
commit54d7e2711fc031b9ac93332f5afcb86c468cabb6 (patch)
treedfbf18f5bbbc6c9b198650255ec6888c14ec4aa9
parentc7c73403dc0cda88d35dd717d6e50e5e9bd61736 (diff)
downloadorg.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.java28
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) {

Back to the top