Project

General

Profile

Revision 9814168d

ID9814168df618526a6f23ea9c38a0ad9391ffc245
Parent 3d8426c7
Child da415864

Added by Katja Luther 11 months ago

fix #8258: default feature tree without name features

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java
34 34
import eu.etaxonomy.cdm.model.term.FeatureNode;
35 35
import eu.etaxonomy.cdm.model.term.FeatureTree;
36 36
import eu.etaxonomy.cdm.model.term.VocabularyEnum;
37
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
37 38
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
38 39
import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
39 40
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
......
136 137
		}
137 138

  
138 139
		if (featureTree == null) {
139
		    List<Feature> terms = CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.Feature.getUuid()), null);
140
            terms.remove(Feature.IMAGE());
141

  
142
			featureTree = FeatureTree.NewInstance(terms);
143

  
144
		}
140
		    featureTree = TermEditorInput.getDefaultFeatureTree();
141
		    		}
145 142
		if (description instanceof TaxonNameDescription){
146 143
		    List<Feature> terms = CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()));
147 144
		    terms.remove(Feature.PROTOLOGUE());
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java
15 15
import java.util.Set;
16 16

  
17 17
import eu.etaxonomy.cdm.api.service.IVocabularyService;
18
import eu.etaxonomy.cdm.model.description.Feature;
18 19
import eu.etaxonomy.cdm.model.term.DefinedTerm;
20
import eu.etaxonomy.cdm.model.term.FeatureTree;
19 21
import eu.etaxonomy.cdm.model.term.TermType;
20 22
import eu.etaxonomy.cdm.model.term.TermVocabulary;
21
import eu.etaxonomy.cdm.model.description.Feature;
22
import eu.etaxonomy.cdm.model.term.FeatureTree;
23
import eu.etaxonomy.cdm.model.term.VocabularyEnum;
23 24
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
24 25
import eu.etaxonomy.taxeditor.store.CdmStore;
25 26
import eu.etaxonomy.taxeditor.store.TermStore;
......
98 99

  
99 100
    public static FeatureTree getDefaultFeatureTree() {
100 101
        if(defaultFeatureTree == null) {
101
            defaultFeatureTree = FeatureTree.NewInstance(TermStore.getTerms(Feature.class));
102
            List<Feature> features = TermStore.getTerms(Feature.class);
103
            List<Feature> nameFeatures = CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()), null);
104
            List<Feature> copy = new ArrayList(features);
105
            for (Feature feature: copy){
106
                if (nameFeatures.contains(feature)){
107
                    features.remove(feature);
108
                }
109
            }
110
            defaultFeatureTree = FeatureTree.NewInstance(features);
102 111
        }
103 112
        return defaultFeatureTree;
104 113
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)