Project

General

Profile

« Previous | Next » 

Revision 5167fe82

Added by Katja Luther almost 5 years ago

fix default feature tree for facts and name facts

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermManager.java
11 11

  
12 12
import java.util.ArrayList;
13 13
import java.util.Collection;
14
import java.util.Comparator;
14 15
import java.util.HashMap;
15 16
import java.util.List;
16 17
import java.util.Map;
......
20 21
import eu.etaxonomy.cdm.model.term.TermBase;
21 22
import eu.etaxonomy.cdm.model.term.TermType;
22 23
import eu.etaxonomy.cdm.model.term.TermVocabulary;
24
import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
23 25
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
24 26
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
25 27

  
......
65 67
	public <T extends DefinedTermBase> List<T> getPreferredTerms(TermVocabulary<T> termVocabulary){
66 68
	    List terms = cachedTermMap.get(termVocabulary);
67 69
	    if(terms==null){
68
	        terms = getFilteredTerms(new ArrayList<T>(TermStore.getTerms(termVocabulary, null)));
70
	        terms = getFilteredTerms(new ArrayList<T>(TermStore.getTerms(termVocabulary,null)));
69 71
	        cachedTermMap.put(termVocabulary, terms);
70 72
	    }
71 73
	    return terms;
72 74
	}
73 75

  
76

  
77
	/**
78
    *
79
    * @param clazz
80
    * @return
81
    */
82
   public <T extends DefinedTermBase> List<T> getPreferredTerms(TermVocabulary<T> termVocabulary, Comparator comp){
83
       if (comp == null){
84
           comp = new DefaultTermComparator<T>();
85
       }
86
       List terms = cachedTermMap.get(termVocabulary);
87
       if(terms==null){
88
           terms = getFilteredTerms(new ArrayList<T>(TermStore.getTerms(termVocabulary,comp)));
89
           cachedTermMap.put(termVocabulary, terms);
90
       }
91
       terms.sort(comp);
92
       return terms;
93
   }
74 94
	/**
75 95
	 *
76 96
	 * @param clazz

Also available in: Unified diff