Project

General

Profile

Revision 2c450f49

ID2c450f49a0944b8a8a14fca7c0b631cece093854
Parent bf3acb28
Child 5d945a6e

Added by Patrick Plitzner 11 months ago

Remove "experimental" status from

  • polytomous key generation
  • move term menu in term editor
  • export ontology in term tree editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixBottomToolbar.java
49 49
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
50 50
import eu.etaxonomy.taxeditor.model.ImageResources;
51 51
import eu.etaxonomy.taxeditor.model.MessagingUtils;
52
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
53
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
54 52
import eu.etaxonomy.taxeditor.store.CdmStore;
55 53
import eu.etaxonomy.taxeditor.store.StoreUtil;
56 54
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonSelectionDialog;
......
144 142
                aggregatDescriptiveDataSet(matrix.getDescriptiveDataSet().getUuid());
145 143
            }
146 144
        });
147
        if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES)){
148
            /**
149
             * Key generation button
150
             */
151
            Button btnGenerateKey = new Button(this, SWT.PUSH);
152
            btnGenerateKey.setText("Generate Polytomous Key");
153
            btnGenerateKey.addSelectionListener(new SelectionAdapter() {
154
                @Override
155
                public void widgetSelected(SelectionEvent e) {
156
                    if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
157
                        return;
158
                    }
159
                    Set<TaxonNodeDto> nodeDtos = matrix.getDescriptiveDataSet().getTaxonSubtreeFilter().stream()
160
                            .map(node->new TaxonNodeDto(node))
161
                            .collect(Collectors.toSet());
162
                    TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
163
                    UUID taxonUuid = parentDto.getTaxonUuid();
164
                    int response = MessagingUtils.confirmDialog(
165
                            "Choose taxonomic scope",
166
                            String.format("The common parent taxon of this data set is :\n%s\n\n"
167
                                    + "Do you want to use this as the taxonomic scope for the polytomous key?"
168
                                    , parentDto.getTaxonTitleCache()), "Yes", "Choose different taxon", "Cancel");
169
                    if(response==2){
145
        /**
146
         * Key generation button
147
         */
148
        Button btnGenerateKey = new Button(this, SWT.PUSH);
149
        btnGenerateKey.setText("Generate Polytomous Key");
150
        btnGenerateKey.addSelectionListener(new SelectionAdapter() {
151
            @Override
152
            public void widgetSelected(SelectionEvent e) {
153
                if(StoreUtil.promptCheckIsDirty(matrix.getPart())){
154
                    return;
155
                }
156
                Set<TaxonNodeDto> nodeDtos = matrix.getDescriptiveDataSet().getTaxonSubtreeFilter().stream()
157
                        .map(node->new TaxonNodeDto(node))
158
                        .collect(Collectors.toSet());
159
                TaxonNodeDto parentDto = CdmStore.getService(ITaxonNodeService.class).findCommonParentDto(nodeDtos);
160
                UUID taxonUuid = parentDto.getTaxonUuid();
161
                int response = MessagingUtils.confirmDialog(
162
                        "Choose taxonomic scope",
163
                        String.format("The common parent taxon of this data set is :\n%s\n\n"
164
                                + "Do you want to use this as the taxonomic scope for the polytomous key?"
165
                                , parentDto.getTaxonTitleCache()), "Yes", "Choose different taxon", "Cancel");
166
                if(response==2){
167
                    return;
168
                }
169
                else if(response==1){
170
                    Taxon taxon = TaxonSelectionDialog.selectTaxon(getShell(), null);
171
                    if(taxon==null){
170 172
                        return;
171 173
                    }
172
                    else if(response==1){
173
                        Taxon taxon = TaxonSelectionDialog.selectTaxon(getShell(), null);
174
                        if(taxon==null){
175
                            return;
176
                        }
177
                        taxonUuid = taxon.getUuid();
178
                    }
179
                    generateKey(matrix.getDescriptiveDataSet().getUuid(), taxonUuid);
174
                    taxonUuid = taxon.getUuid();
180 175
                }
176
                generateKey(matrix.getDescriptiveDataSet().getUuid(), taxonUuid);
177
            }
181 178

  
182
            });
183
        }
179
        });
184 180
    }
185 181

  
186 182
    private void aggregatDescriptiveDataSet(UUID descriptiveDataSetUuid){
eu.etaxonomy.taxeditor.store/fragment.e4xmi
187 187
        <children xsi:type="menu:Menu" xmi:id="_whoc7_ynEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.menu.presenceAbsence.export" label="%menu.label.4" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif">
188 188
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_whoc8PynEemPDYtIH5gauA" coreExpressionId="isFeatureTree"/>
189 189
          <children xsi:type="menu:HandledMenuItem" xmi:id="_whoc8fynEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.presenceAbsence.exportFeatureTreeOwl" label="%handledmenuitem.label.14" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_xyZ4oPhmEei8uPv-H2wqnw">
190
            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_whoc8vynEemPDYtIH5gauA" coreExpressionId="isShowExperimentalFeatures"/>
191 190
          </children>
192 191
          <children xsi:type="menu:HandledMenuItem" xmi:id="_whoc8_ynEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.presenceAbsence.exportFeatureTree" label="%handledmenuitem.label.4" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_I_yx4GcqEee0qLTtA2ZpVQ">
193 192
            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_whoc9PynEemPDYtIH5gauA" coreExpressionId="isShowExperimentalFeatures"/>
......
217 216
        <children xsi:type="menu:Menu" xmi:id="_jGX_b_ysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.menu.namedArea.export" label="%menu.label.4" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif">
218 217
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_jGX_cPysEemPDYtIH5gauA" coreExpressionId="isFeatureTree"/>
219 218
          <children xsi:type="menu:HandledMenuItem" xmi:id="_jGX_cfysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.namedArea.exportFeatureTreeOwl" label="%handledmenuitem.label.14" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_xyZ4oPhmEei8uPv-H2wqnw">
220
            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_jGX_cvysEemPDYtIH5gauA" coreExpressionId="isShowExperimentalFeatures"/>
221 219
          </children>
222 220
          <children xsi:type="menu:HandledMenuItem" xmi:id="_jGX_c_ysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.namedArea.exportFeatureTree" label="%handledmenuitem.label.4" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_I_yx4GcqEee0qLTtA2ZpVQ">
223 221
            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_jGX_dPysEemPDYtIH5gauA" coreExpressionId="isShowExperimentalFeatures"/>
......
247 245
        <children xsi:type="menu:Menu" xmi:id="_jK89b_ysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.menu.rank.export" label="%menu.label.4" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif">
248 246
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_jK89cPysEemPDYtIH5gauA" coreExpressionId="isFeatureTree"/>
249 247
          <children xsi:type="menu:HandledMenuItem" xmi:id="_jK89cfysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.rank.exportFeatureTreeOwl" label="%handledmenuitem.label.14" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_xyZ4oPhmEei8uPv-H2wqnw">
250
            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_jK89cvysEemPDYtIH5gauA" coreExpressionId="isShowExperimentalFeatures"/>
251 248
          </children>
252 249
          <children xsi:type="menu:HandledMenuItem" xmi:id="_jK89c_ysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.rank.exportFeatureTree" label="%handledmenuitem.label.4" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/export.gif" command="_I_yx4GcqEee0qLTtA2ZpVQ">
253 250
            <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_jK89dPysEemPDYtIH5gauA" coreExpressionId="isShowExperimentalFeatures"/>
......
410 407
      </children>
411 408
      <children xsi:type="menu:MenuSeparator" xmi:id="_XKnM8E3IEeiplYSgvvNXRQ" elementId="eu.etaxonomy.taxeditor.store.menuseparator.6"/>
412 409
      <children xsi:type="menu:HandledMenuItem" xmi:id="_eU0zcEbOEeiER_VRS0L7wA" elementId="eu.etaxonomy.taxeditor.store.termEditorMenu.gfbioTermImport" label="%handledmenuitem.label.9" tooltip="%handledmenuitem.tooltip.2" command="_bnVKsCZxEeeQLpuomSmVoQ">
413
        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_h15bwEb1EeiER_VRS0L7wA" coreExpressionId="isCdmStoreConnectedAndShowExperimental"/>
414 410
        <parameters xmi:id="_eU0zcUbOEeiER_VRS0L7wA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.gfbioTermImport" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.webimport.termimport.GfBioTerminologyImportPart"/>
415 411
      </children>
416 412
      <children xsi:type="menu:HandledMenuItem" xmi:id="_fbZtkB7xEemDKJyLc5CJfQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.termsearch" label="%handledmenuitem.label.16" tooltip="%handledmenuitem.label.16" command="_bnVKsCZxEeeQLpuomSmVoQ">
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/handler/MoveDefinedTermHandler.java
35 35
import eu.etaxonomy.taxeditor.model.AbstractUtility;
36 36
import eu.etaxonomy.taxeditor.model.MessagingUtils;
37 37
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
38
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
39
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
40 38
import eu.etaxonomy.taxeditor.store.StoreUtil;
41 39

  
42 40
/**
......
92 90
            MHandledMenuItem menuItem){
93 91
        boolean canExecute = false;
94 92
        Object firstElement = selection.getFirstElement();
95
        canExecute = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES)
96
                && selection.size()==1
93
        canExecute = selection.size()==1
97 94
                && firstElement instanceof TermDto
98 95
                // TODO temporary fix for #7933
99 96
                && !((TermDto) firstElement).getVocabularyUuid().equals(Country.uuidCountryVocabulary);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/handler/FeatureTreeExportOntologyHandler.java
30 30
import eu.etaxonomy.cdm.io.descriptive.owl.out.StructureTreeOwlExportConfigurator;
31 31
import eu.etaxonomy.cdm.model.term.TermTree;
32 32
import eu.etaxonomy.taxeditor.featuretree.e4.IFeatureTreeEditor;
33
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
34
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
35 33
import eu.etaxonomy.taxeditor.store.CdmStore;
36 34
import eu.etaxonomy.taxeditor.store.StoreUtil;
37 35

  
......
87 85
            @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
88 86
            MHandledMenuItem menuItem) {
89 87
        boolean canExecute = false;
90
        canExecute = PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES)
91
                && selection!=null
88
        canExecute = selection!=null
92 89
                && selection.size()==1
93 90
                && selection.getFirstElement() instanceof TermTree;
94 91
        menuItem.setVisible(canExecute);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)