import eu.etaxonomy.cdm.model.common.Marker;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
import eu.etaxonomy.cdm.model.description.IDescribable;
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
private FeatureNodeContainerTree getContainerTreeForDesription(DescriptionBase<?> description){
if(! featureNodeContainerCache.containsKey(description)){
- FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, getFeatureTree(description));
+ FeatureNodeContainerTree containerTree = new FeatureNodeContainerTree(description, TermEditorInput.getCompleteFeatureTree());
featureNodeContainerCache.put(description, containerTree);
}
return featureNodeContainerCache.get(description);
// FIXME: the default feature should be move to CdmApplicationState
// where it is a singleton instance variable
private static TermTree defaultFeatureTree = null;
+ private static TermTree completeFeatureTree = null;
private static TermTree defaultNameFeatureTree = null;
private List<String> termClasses = Arrays.asList(new String[]{
public static TermTree getDefaultFeatureTree() {
if(defaultFeatureTree == null) {
List<Feature> features = TermStore.getTerms(Feature.class);
-// TermVocabulary voc = CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid());
-// List<Feature> nameFeatures = new ArrayList(voc.getTerms());
+
List<Feature> taxonFeatures = features.stream().filter(f -> f.isAvailableForTaxon())
.collect(Collectors.toList());
-// for (Feature feature: copy){
-// if (nameFeatures.contains(feature)){
-// features.remove(feature);
-// }
-// }
+
defaultFeatureTree = TermTree.NewInstance(taxonFeatures);
}
return defaultFeatureTree;
}
+
+ public static TermTree getCompleteFeatureTree() {
+ if(completeFeatureTree == null) {
+ List<Feature> features = TermStore.getTerms(Feature.class);
+ completeFeatureTree = TermTree.NewInstance(features);
+ }
+ return completeFeatureTree;
+ }
public static void resetDefaultFeatureTree(){
defaultFeatureTree = null;