From bc00fbdf52d78e36f3bc4c4b32714a0d0493ac01 Mon Sep 17 00:00:00 2001
From: Patrick Plitzner
Date: Fri, 16 Jun 2017 15:45:04 +0200
Subject: [PATCH] ref #6694 Move menu item to "Term Editor"
---
eu.etaxonomy.taxeditor.store/fragment.e4xmi | 4 --
.../editor/definedterm/DefinedTermMenu.java | 42 ++++++++++++++++---
2 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/eu.etaxonomy.taxeditor.store/fragment.e4xmi b/eu.etaxonomy.taxeditor.store/fragment.e4xmi
index 5fd93b07e..b5ab73a12 100644
--- a/eu.etaxonomy.taxeditor.store/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.store/fragment.e4xmi
@@ -28,9 +28,5 @@
-
-
-
-
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
index 5acacce6c..1a893caf4 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
@@ -63,6 +63,8 @@ public class DefinedTermMenu extends CompoundContributionItem {
new MenuManager("Others","eu.etaxonomy.taxeditor.store.term.other.menu");
otherMenuManager.setVisible(true);
dtMenuManager.add(otherMenuManager);
+ //FIXME E4: This should be removed during e4 migration. dynamic menu should be declared in model fragment
+ dtMenuManager.add(createFeatureTreeMenuItem());
List ttList = new ArrayList(EnumSet.allOf(TermType.class));
Collections.sort(ttList,new SortByTermTypeMessage());
@@ -142,21 +144,21 @@ public class DefinedTermMenu extends CompoundContributionItem {
}
- private CommandContributionItem createDefaultMenuItem(TermType termType) {
+ private CommandContributionItem createFeatureTreeMenuItem() {
Map params = new HashMap();
- params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
- termType.getUuid().toString());
+ params.put("eu.etaxonomy.taxeditor.workbench.commandparameter.partName",
+ "eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor");
CommandContributionItemParameter p = new CommandContributionItemParameter(
PlatformUI.getWorkbench(),
- "",
- "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
+ "eu.etaxonomy.taxeditor.featuretree.commandContributionItemParameter",
+ "eu.etaxonomy.taxeditor.command.openPart",
params,
null,
null,
null,
- "Other " + termType.getMessage() + "s",
+ "Feature Tree",
"",
"",
SWT.PUSH,
@@ -170,6 +172,34 @@ public class DefinedTermMenu extends CompoundContributionItem {
}
+ private CommandContributionItem createDefaultMenuItem(TermType termType) {
+
+ Map params = new HashMap();
+ params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
+ termType.getUuid().toString());
+
+ CommandContributionItemParameter p = new CommandContributionItemParameter(
+ PlatformUI.getWorkbench(),
+ "",
+ "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
+ params,
+ null,
+ null,
+ null,
+ "Other " + termType.getMessage() + "s",
+ "",
+ "",
+ SWT.PUSH,
+ "",
+ true);
+
+
+
+ CommandContributionItem item = new CommandContributionItem(p);
+ return item;
+
+ }
+
private class SortByTermTypeMessage implements Comparator {
@Override
public int compare(TermType t1, TermType t2) {
--
2.34.1