Merge branch 'release/5.8.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / feature / CharacterDetailElement.java
index b5c8cb29fefd66f5c3e9ae2cac1f3f876c28965a..87e0af057f93b3e31b92e005313fcdec616400a0 100644 (file)
@@ -9,7 +9,6 @@
 package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.Character;
@@ -87,24 +86,24 @@ public class CharacterDetailElement extends AbstractCdmDetailElement<Character>
 
         if (supportsCategoricalData.getSelection()) {
             sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-                    parentFormElement, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
+                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, entity.getClass().getCanonicalName(), true));
             sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionStateVocabularies.setEntity(getEntity());
         }
         if (supportsQuantitativeData.getSelection()) {
             sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-                    parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                    parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, entity.getClass().getCanonicalName(), true));
             sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionMeasurementUnits.setEntity(getEntity());
 
             sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(),
-                    parentFormElement, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
+                    parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, entity.getClass().getCanonicalName(), true));
             sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionStatisticalMeasures.setEntity(getEntity());
         }
         if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {
             sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-                    getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                    getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, entity.getClass().getCanonicalName(), true));
             sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionModifierVocabularies.setEntity(getEntity());
         }
@@ -178,19 +177,19 @@ public class CharacterDetailElement extends AbstractCdmDetailElement<Character>
 
            //measurement units
            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-                   parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                   parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
            sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionMeasurementUnits.setEntity(getEntity());
 
            //statistical measures
            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(
-                   getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                   getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
            sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionStatisticalMeasures.setEntity(getEntity());
 
            //modifiers
            sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-                   getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                   getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
            sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionModifierVocabularies.setEntity(getEntity());
        }
@@ -211,13 +210,13 @@ public class CharacterDetailElement extends AbstractCdmDetailElement<Character>
 
            //states
            sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-                parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
         sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionStateVocabularies.setEntity(getEntity());
 
         //modifiers
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-                getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionModifierVocabularies.setEntity(getEntity());
        }