summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-09-18 11:12:30 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-09-20 10:32:39 (EDT)
commit5e319c192c350c92199297fabc71d8efe940f1b0 (patch)
treec4cbe84a36485622d72d800f40f23a9e25ced95f
parentd2dcde53acc822bd07066824862836e568378896 (diff)
downloadeclipse.platform.ui-5e319c192c350c92199297fabc71d8efe940f1b0.zip
eclipse.platform.ui-5e319c192c350c92199297fabc71d8efe940f1b0.tar.gz
eclipse.platform.ui-5e319c192c350c92199297fabc71d8efe940f1b0.tar.bz2
Bug 384354 - Compatibility: Editor actions registered via extensionI20130924-0800refs/changes/77/12177/5
point org.eclipse.ui.editorActions are shown twice in the toolbar Change-Id: I9cdba5c4407ae40a9e41c11c15ef3a85ab81e835 Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java
index 9a8f17e..178453a 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/ActionSet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 IBM Corporation and others.
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -307,9 +307,10 @@ public class ActionSet {
ArrayList<MTrimContribution> trimContributions, IConfigurationElement element,
String parentId) {
String tpath = MenuHelper.getToolBarPath(element);
- if (tpath == null) {
+ if (tpath == null || isEditorAction(element)) {
return;
}
+
if (tpath.endsWith("/")) { //$NON-NLS-1$
tpath += IWorkbenchActionConstants.MB_ADDITIONS;
}
@@ -319,6 +320,7 @@ public class ActionSet {
if (action == null) {
return;
}
+
action.getTransientData().put("Name", MenuHelper.getLabel(element)); //$NON-NLS-1$
action.getTransientData().put("ActionSet", id); //$NON-NLS-1$
@@ -368,11 +370,16 @@ public class ActionSet {
toolBarContribution.setPositionInParent(positionInParent);
toolBarContribution.setVisibleWhen(createVisibleWhen());
-
toolBarContribution.getChildren().add(action);
+
contributions.add(toolBarContribution);
}
+ private boolean isEditorAction(IConfigurationElement element) {
+ return IWorkbenchRegistryConstants.EXTENSION_EDITOR_ACTIONS.equals(element
+ .getDeclaringExtension().getExtensionPointUniqueIdentifier());
+ }
+
private void addTrimContribution(String idContrib,
ArrayList<MToolBarContribution> contributions,
ArrayList<MTrimContribution> trimContributions, IConfigurationElement element,