aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rolka2013-09-18 11:12:30 (EDT)
committerPaul Webster2014-04-29 13:18:55 (EDT)
commit83314600616bd0d21cfa1306a6707c30286c8af5 (patch)
treef92bb444467f9c2f30d9e74ab850d64001e99a39
parentf8eccb7daa19cf68f7ea6e988ace46943ae0223f (diff)
downloadeclipse.platform.ui-83314600616bd0d21cfa1306a6707c30286c8af5.zip
eclipse.platform.ui-83314600616bd0d21cfa1306a6707c30286c8af5.tar.gz
eclipse.platform.ui-83314600616bd0d21cfa1306a6707c30286c8af5.tar.bz2
Bug 384354 - Compatibility: Editor actions registered via extensionrefs/changes/02/25802/1
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 0efa3b1..77d4050 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 IBM Corporation and others.
+ * Copyright (c) 2010, 2014 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,