Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2014-09-04 09:09:31 +0000
committerChristian W. Damus2014-09-04 18:33:27 +0000
commit4a7178c843674dd4e75ed9e65a343fe3fe211212 (patch)
treec557f58a73c625059b347e9b555dab86b2ff6caa /plugins/infra
parent1e7c520110e97c1b0d86b8fb482551342a4599c2 (diff)
downloadorg.eclipse.papyrus-4a7178c843674dd4e75ed9e65a343fe3fe211212.tar.gz
org.eclipse.papyrus-4a7178c843674dd4e75ed9e65a343fe3fe211212.tar.xz
org.eclipse.papyrus-4a7178c843674dd4e75ed9e65a343fe3fe211212.zip
Bug 443102 - [Refactoring] Project Explorer shows two paste actions for
copied Papyrus model - remove the internal.ui.pasteAction from the menu and use the papyrus one if active Change-Id: I24a15964f46453d403ba91c8bc330aaec954c4c5 Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/providers/PapyrusEditActionProvider.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/providers/PapyrusEditActionProvider.java b/plugins/infra/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/providers/PapyrusEditActionProvider.java
index 2c2b79c21aa..1960608988d 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/providers/PapyrusEditActionProvider.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.onefile/src/org/eclipse/papyrus/infra/onefile/providers/PapyrusEditActionProvider.java
@@ -19,7 +19,6 @@ import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
@@ -36,7 +35,6 @@ import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonMenuConstants;
import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
/**
@@ -55,21 +53,18 @@ public class PapyrusEditActionProvider extends CommonActionProvider {
@Override
public void fillActionBars(IActionBars actionBars) {
+ super.fillActionBars(actionBars);
if (fInViewPart) {
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
}
- super.fillActionBars(actionBars);
}
@Override
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
- appendToGroup(menu, pasteAction, ICommonMenuConstants.GROUP_EDIT);
- }
-
- private void appendToGroup(IMenuManager menu, IAction action, String id) {
- if (action != null && action.isEnabled()) {
- menu.appendToGroup(id, action);
+ if (pasteAction != null && pasteAction.isEnabled()) {
+ menu.insertAfter(PapyrusModelPasteAction.ID, pasteAction); // same as the internal org.eclipse.ui.internal.navigator.resources.actions.PasteAction.ID
+ menu.remove(PapyrusModelPasteAction.ID);
}
}

Back to the top