Revision a9450437
Added by Patrick Plitzner almost 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java | ||
---|---|---|
16 | 16 |
import eu.etaxonomy.cdm.model.common.Marker; |
17 | 17 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
18 | 18 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
19 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
20 | 19 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
21 | 20 |
import eu.etaxonomy.cdm.model.description.IDescribable; |
22 | 21 |
import eu.etaxonomy.cdm.model.description.IndividualsAssociation; |
... | ... | |
24 | 23 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer; |
25 | 24 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree; |
26 | 25 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
27 |
import eu.etaxonomy.taxeditor.store.TermStore; |
|
28 | 26 |
import eu.etaxonomy.taxeditor.store.UsageTermCollection; |
29 | 27 |
|
30 | 28 |
/** |
... | ... | |
94 | 92 |
|
95 | 93 |
@Override |
96 | 94 |
public int compare(IndividualsAssociation o1, IndividualsAssociation o2) { |
97 |
if(o1==null || o1.getAssociatedSpecimenOrObservation()==null){ |
|
98 |
return -1; |
|
95 |
if(o1==null){ |
|
96 |
if(o2==null){ |
|
97 |
return 0; |
|
98 |
} |
|
99 |
else{ |
|
100 |
return -1; |
|
101 |
} |
|
99 | 102 |
} |
100 |
if(o2==null || o2.getAssociatedSpecimenOrObservation()==null){
|
|
103 |
else if(o2==null){
|
|
101 | 104 |
return 1; |
102 | 105 |
} |
103 |
return o1.getAssociatedSpecimenOrObservation().compareTo(o2.getAssociatedSpecimenOrObservation()); |
|
106 |
|
|
107 |
if(o1.getAssociatedSpecimenOrObservation()==null){ |
|
108 |
if(o2.getAssociatedSpecimenOrObservation()==null){ |
|
109 |
return 0; |
|
110 |
} |
|
111 |
else{ |
|
112 |
return -1; |
|
113 |
} |
|
114 |
} |
|
115 |
else if(o2.getAssociatedSpecimenOrObservation()==null){ |
|
116 |
return 1; |
|
117 |
} |
|
118 |
|
|
119 |
String titleCache1 = o1.getAssociatedSpecimenOrObservation().getTitleCache(); |
|
120 |
String titleCache2 = o2.getAssociatedSpecimenOrObservation().getTitleCache(); |
|
121 |
|
|
122 |
if(titleCache1==null){ |
|
123 |
if(titleCache2==null){ |
|
124 |
return 0; |
|
125 |
} |
|
126 |
else{ |
|
127 |
return -1; |
|
128 |
} |
|
129 |
} |
|
130 |
if(titleCache2==null){ |
|
131 |
return 1; |
|
132 |
} |
|
133 |
|
|
134 |
return titleCache1.compareTo(titleCache2); |
|
104 | 135 |
} |
105 | 136 |
}); |
106 | 137 |
if(showOnlyIndividualAssociations){ |
Also available in: Unified diff
ref #6401 Refactor comparison of specimens in factual data view