merged/implemented cdm3.3 model adaptations
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / description / DescriptionDetailElement.java
index c1f46e81db39ecfa98e04ee3f42d20c39399cb2b..946aa45701440be2a72441dc54c0cba750913de3 100644 (file)
@@ -14,12 +14,11 @@ import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.forms.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.selection.FeatureTreeSelectionElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
  * <p>DescriptionDetailElement class.</p>
@@ -31,13 +30,13 @@ import eu.etaxonomy.taxeditor.ui.selection.FeatureTreeSelectionElement;
 public class DescriptionDetailElement extends AbstractCdmDetailElement<DescriptionBase> {
 
        private TextWithLabelElement detailDescription;
-       private FeatureTreeSelectionElement selection_featureTree;
+       private EntitySelectionElement<FeatureTree> selection_featureTree;
 
        /**
         * <p>Constructor for DescriptionDetailElement.</p>
         *
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
-        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
+        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
         * @param style a int.
         */
        public DescriptionDetailElement(CdmFormFactory cdmFormFactory,
@@ -51,9 +50,13 @@ public class DescriptionDetailElement extends AbstractCdmDetailElement<Descripti
                detailDescription = formFactory.createMultilineTextWithLabel(this, "Label", 50, SWT.WRAP);
                detailDescription.setText(entity.getTitleCache());
                
-               selection_featureTree = (FeatureTreeSelectionElement) formFactory.createSelectionElement(SelectionType.FEATURE_TREE, getConversationHolder(), formElement, "Feature Tree", null, style, 1);
+               // TODO I initially thought that we can handle the entity's descriptive system with a feature tree 
+               // Since descriptiveSystem is a Set of Features that are present or allowed for the current description, 
+               // it is similar to a FeatureTree (you can get this information from a feature tree) but not the same.
+               // Please correct this once it is clear what descriptive system will be used for in CDM
+//             selection_featureTree = formFactory.createSelectionElement(FeatureTree.class, getConversationHolder(), formElement, "Feature Tree", null, EntitySelectionElement.ALL, style);
        }
-       
+               
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
@@ -62,7 +65,9 @@ public class DescriptionDetailElement extends AbstractCdmDetailElement<Descripti
                }
                else if(eventSource == selection_featureTree){
                        FeatureTree featureTree = selection_featureTree.getSelection();
-                       getEntity().setDescriptiveSystem(featureTree.getDistinctFeatures());
+                       //FIXME:3.3MC---- 
+                       //getEntity().setDescriptiveSystem(featureTree.getDistinctFeatures());
+                       //FIXME:3.3MC----
                }
        }
 }