- filtered combo dropdown for modifiers in details view (#4448)
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / vocabulary / FeatureDetailElement.java
index 5bbd72f7fd7b390df49d7462bc480946bbbe2c6a..9bd5d82829f65a3566c10655ab6a39589f067f22 100644 (file)
@@ -65,7 +65,7 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
            super.createControls(formElement, entity, style);\r
            this.parentFormElement = formElement;\r
            supportsTextData = formFactory.createCheckbox(formElement, "Supports Text Data", entity.isSupportsTextData(), style);\r
-           supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitive Data", entity.isSupportsQuantitativeData(), style);\r
+           supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", entity.isSupportsQuantitativeData(), style);\r
            supportsDistribution = formFactory.createCheckbox(formElement, "Supports Distribution", entity.isSupportsDistribution(), style);\r
            supportsIndividualAssociation = formFactory.createCheckbox(formElement, "Supports Individual Association", entity.isSupportsIndividualAssociation(), style);\r
            supportsTaxonInteraction = formFactory.createCheckbox(formElement, "Supports Taxon Interaction", entity.isSupportsTaxonInteraction(), style);\r
@@ -77,9 +77,6 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
             sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionStateVocabularies.setEntity(getEntity());\r
 \r
-            sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
-            sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
-            sectionStateModifiers.setEntity(getEntity());\r
         }\r
         if(supportsQuantitativeData.getSelection()){\r
             sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
@@ -90,6 +87,11 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
             sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionStatisticalMeasures.setEntity(getEntity());\r
         }\r
+        if(supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()){\r
+            sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+            sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+            sectionStateModifiers.setEntity(getEntity());\r
+        }\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -111,11 +113,20 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
                    sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
                    sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
                    sectionStatisticalMeasures.setEntity(getEntity());\r
+\r
+                   if(!supportsCategoricalData.getSelection()){\r
+                       sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+                       sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+                       sectionStateModifiers.setEntity(getEntity());\r
+                   }\r
                }\r
                else{\r
                    if(sectionMeasurementUnits!=null){\r
                        removeElementsAndControls(sectionMeasurementUnits);\r
                        removeElementsAndControls(sectionStatisticalMeasures);\r
+                       if(!supportsCategoricalData.getSelection()){\r
+                           removeElementsAndControls(sectionStateModifiers);\r
+                       }\r
                    }\r
                }\r
            }\r
@@ -135,14 +146,18 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
                    sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
                    sectionStateVocabularies.setEntity(getEntity());\r
 \r
-                   sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
-                   sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
-                   sectionStateModifiers.setEntity(getEntity());\r
+                   if(!supportsQuantitativeData.getSelection()){\r
+                       sectionStateModifiers = formFactory.createStateModifierCollectionSection(getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+                       sectionStateModifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
+                       sectionStateModifiers.setEntity(getEntity());\r
+                   }\r
                }\r
                else{\r
                    if(sectionStateVocabularies!=null){\r
                        removeElementsAndControls(sectionStateVocabularies);\r
-                       removeElementsAndControls(sectionStateModifiers);\r
+                       if(!supportsQuantitativeData.getSelection()){\r
+                           removeElementsAndControls(sectionStateModifiers);\r
+                       }\r
                    }\r
                }\r
            }\r