Checklist Editor retreives now all PresenceAbsenceTerms by filtering via TermType...
authorAlexander Oppermann <a.oppermann@bgbm.org>
Wed, 26 Nov 2014 14:24:07 +0000 (14:24 +0000)
committerAlexander Oppermann <a.oppermann@bgbm.org>
Wed, 26 Nov 2014 14:24:07 +0000 (14:24 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/edit/DistributionEditingSupport.java

index c30985b9cb8108dfa083d43f3d47aec742d7aabf..11b8173dbf3d7526c3f71eb6fb4100da0484abf7 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.TableColumn;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
@@ -48,8 +49,9 @@ public final class DistributionEditingSupport extends EditingSupport {
         cellEditor.setLabelProvider(new LabelProvider());
         cellEditor.setContentProvider(new ArrayContentProvider());
         // TODO set input
-        List<PresenceAbsenceTermBase> input = CdmStore.getTermManager()
-                .getPreferredTerms(PresenceAbsenceTermBase.class);
+//        List<PresenceAbsenceTermBase> input = CdmStore.getTermManager()
+//                .getPreferredTerms(PresenceAbsenceTermBase.class);
+        List<DefinedTermBase<?>> input = CdmStore.getTermManager().getPreferredTerms(TermType.PresenceAbsenceTerm);
         cellEditor.setInput(input);
     }
 
@@ -78,7 +80,7 @@ public final class DistributionEditingSupport extends EditingSupport {
 
     @Override
     protected void setValue(Object element, Object value) {
-        if (element instanceof Taxon && value instanceof PresenceAbsenceTermBase) {
+       if (element instanceof Taxon && value instanceof PresenceAbsenceTermBase) {
             Taxon taxon = (Taxon) element;
             PresenceAbsenceTermBase occurenceStatus = (PresenceAbsenceTermBase) value;
             Distribution distribution = getDistributionForColumn(taxon);