Refactoring of selection elements. Additional minor refactoring. Fixed a bug with...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / classification / ClassificationDetailElement.java
index fd53a655205c429c343a81cbd8c748ac6518e20a..b13cc94fcd5156c752b72a971458c50a7b47482f 100644 (file)
 
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
-import org.apache.log4j.Logger;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.model.common.LanguageString;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.SelectionType;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.selection.ReferenceSelectionElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
  * <p>
@@ -36,12 +34,9 @@ import eu.etaxonomy.taxeditor.ui.selection.ReferenceSelectionElement;
 public class ClassificationDetailElement extends
                AbstractCdmDetailElement<Classification> {
 
-       private static final Logger logger = Logger
-                       .getLogger(ClassificationDetailElement.class);
-
        private TextWithLabelElement text_treeLabel;
 
-       private ReferenceSelectionElement selection_reference;
+       private EntitySelectionElement<Reference> selection_reference;
 
        private TextWithLabelElement text_microReference;
 
@@ -77,11 +72,11 @@ public class ClassificationDetailElement extends
                text_treeLabel = formFactory.createTextWithLabelElement(formElement,
                                "Label", entity != null ? entity.getTitleCache() : null,
                                SWT.NULL);
-               selection_reference = (ReferenceSelectionElement) formFactory
-                               .createSelectionElement(SelectionType.REFERENCE,
+               selection_reference = formFactory
+                               .createSelectionElement(Reference.class,
                                                getConversationHolder(), formElement, "Reference",
                                                entity != null ? entity.getReference() : null,
-                                               ReferenceSelectionElement.DEFAULT, SWT.NULL);
+                                               EntitySelectionElement.ALL, SWT.NULL);
                text_microReference = formFactory.createTextWithLabelElement(
                                formElement, "Reference Detail",
                                entity != null ? entity.getMicroReference() : null, SWT.NULL);