63 |
63 |
new MenuManager("Others","eu.etaxonomy.taxeditor.store.term.other.menu");
|
64 |
64 |
otherMenuManager.setVisible(true);
|
65 |
65 |
dtMenuManager.add(otherMenuManager);
|
|
66 |
//FIXME E4: This should be removed during e4 migration. dynamic menu should be declared in model fragment
|
|
67 |
dtMenuManager.add(createFeatureTreeMenuItem());
|
66 |
68 |
|
67 |
69 |
List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
|
68 |
70 |
Collections.sort(ttList,new SortByTermTypeMessage());
|
... | ... | |
142 |
144 |
|
143 |
145 |
}
|
144 |
146 |
|
145 |
|
private CommandContributionItem createDefaultMenuItem(TermType termType) {
|
|
147 |
private CommandContributionItem createFeatureTreeMenuItem() {
|
146 |
148 |
|
147 |
149 |
Map<String, String> params = new HashMap<String, String>();
|
148 |
|
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
|
149 |
|
termType.getUuid().toString());
|
|
150 |
params.put("eu.etaxonomy.taxeditor.workbench.commandparameter.partName",
|
|
151 |
"eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor");
|
150 |
152 |
|
151 |
153 |
CommandContributionItemParameter p = new CommandContributionItemParameter(
|
152 |
154 |
PlatformUI.getWorkbench(),
|
153 |
|
"",
|
154 |
|
"eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
|
|
155 |
"eu.etaxonomy.taxeditor.featuretree.commandContributionItemParameter",
|
|
156 |
"eu.etaxonomy.taxeditor.command.openPart",
|
155 |
157 |
params,
|
156 |
158 |
null,
|
157 |
159 |
null,
|
158 |
160 |
null,
|
159 |
|
"Other " + termType.getMessage() + "s",
|
|
161 |
"Feature Tree",
|
160 |
162 |
"",
|
161 |
163 |
"",
|
162 |
164 |
SWT.PUSH,
|
... | ... | |
170 |
172 |
|
171 |
173 |
}
|
172 |
174 |
|
|
175 |
private CommandContributionItem createDefaultMenuItem(TermType termType) {
|
|
176 |
|
|
177 |
Map<String, String> params = new HashMap<String, String>();
|
|
178 |
params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
|
|
179 |
termType.getUuid().toString());
|
|
180 |
|
|
181 |
CommandContributionItemParameter p = new CommandContributionItemParameter(
|
|
182 |
PlatformUI.getWorkbench(),
|
|
183 |
"",
|
|
184 |
"eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
|
|
185 |
params,
|
|
186 |
null,
|
|
187 |
null,
|
|
188 |
null,
|
|
189 |
"Other " + termType.getMessage() + "s",
|
|
190 |
"",
|
|
191 |
"",
|
|
192 |
SWT.PUSH,
|
|
193 |
"",
|
|
194 |
true);
|
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
CommandContributionItem item = new CommandContributionItem(p);
|
|
199 |
return item;
|
|
200 |
|
|
201 |
}
|
|
202 |
|
173 |
203 |
private class SortByTermTypeMessage implements Comparator<TermType> {
|
174 |
204 |
@Override
|
175 |
205 |
public int compare(TermType t1, TermType t2) {
|
ref #6694 Move menu item to "Term Editor"