Project

General

Profile

Revision bc00fbdf

IDbc00fbdf52d78e36f3bc4c4b32714a0d0493ac01
Parent 94681750
Child f12694a7, e75532a6, 34fd7a1c

Added by Patrick Plitzner over 3 years ago

ref #6694 Move menu item to "Term Editor"

View differences:

eu.etaxonomy.taxeditor.store/fragment.e4xmi
28 28
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_W-C-gCaJEeeTEd_pKXBflg" coreExpressionId="isCdmStoreConnected"/>
29 29
      <parameters xmi:id="_BylIUCZzEeeQLpuomSmVoQ" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"/>
30 30
    </elements>
31
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_VINAAEqgEeeN-dEYnw7m3g" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.sessions" label="Feature Tree Editor" command="_bnVKsCZxEeeQLpuomSmVoQ">
32
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_VINAAUqgEeeN-dEYnw7m3g" coreExpressionId="isCdmStoreConnected"/>
33
      <parameters xmi:id="_VINAAkqgEeeN-dEYnw7m3g" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor"/>
34
    </elements>
35 31
  </fragments>
36 32
</fragment:ModelFragments>
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
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) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)