ref #8260 Complete refactoring of expansion state saving
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 12 Jun 2019 10:10:23 +0000 (12:10 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 12 Jun 2019 10:39:54 +0000 (12:39 +0200)
35 files changed:
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/StoreUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/AbstractDetailedDescriptionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/CategoricalDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/QuantitativeDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGelPhotoDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/PrimerGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/IdentifiableSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/FeatureDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmDataViewerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataViewerE4.java

index 1f8c7d385b974693a2107feebb936351e3dfe7ba..439c1b3156f3d54a963679eeeae2966d4dc46e52 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jface.action.IStatusLineManager;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
@@ -25,8 +26,10 @@ import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 
 /**
@@ -139,8 +142,8 @@ public class StoreUtil extends AbstractUtility {
            return title.replace("&", "&&");
        }
 
-    public static String getPrefKey(Class<? extends AbstractFormSection> sectionClass, Object entity) {
-        return sectionClass.getCanonicalName()+";"+entity.getClass().getCanonicalName();
+    public static String getPrefKey(Class<? extends AbstractFormSection> sectionClass, String entity) {
+        return sectionClass.getCanonicalName()+";"+entity;
     }
 
     /**
@@ -209,4 +212,20 @@ public class StoreUtil extends AbstractUtility {
         }
         return string1.compareTo(string2);
     }
+
+    public static int getSectionStyle(Class<? extends AbstractFormSection> clazz, String input){
+        return StoreUtil.getSectionStyle(clazz, input, false);
+    }
+
+    public static int getSectionStyle(Class<? extends AbstractFormSection> clazz, String input, boolean initiallyExpanded){
+        int style = ExpandableComposite.TWISTIE;
+        String prefKey = getPrefKey(clazz, input);
+        if(PreferencesUtil.contains(prefKey)){
+            style = PreferencesUtil.getStringValue(prefKey)==CdmSectionPart.EXPANDED?style |= ExpandableComposite.EXPANDED:style;
+        }
+        else{
+            style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style;
+        }
+        return style;
+    }
 }
index 8764e089247219be2f37bc3718fb69ce9b8c69f9..5046736f90063f12466f5a98f50444e207689128 100644 (file)
@@ -38,6 +38,8 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
@@ -119,6 +121,8 @@ import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.InverseTermWrapper;
 import eu.etaxonomy.taxeditor.ui.combo.MisappliedRelationshipComboElement;
@@ -364,6 +368,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElementWithAbbreviatedTitle;
 import eu.etaxonomy.taxeditor.ui.selection.NomenclaturalAuthorTeamSelectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.TaxonNodeSelectionElement;
+import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
 
 /**
  * <p>
@@ -1170,6 +1175,16 @@ public class CdmFormFactory extends FormToolkit {
         section.addFocusListener(selectionFocusHandler);
         section.setPropertyChangeListeners(propertyChangeListeners);
 
+        section.addExpansionListener(new ExpansionAdapter(){
+            @Override
+            public void expansionStateChanged(ExpansionEvent e) {
+                super.expansionStateChanged(e);
+                if(section.getEntity()!=null){
+                    PreferencesUtil.setStringValue(StoreUtil.getPrefKey(section.getClass(), section.getEntity().getClass().getCanonicalName()), e.getState()?CdmSectionPart.EXPANDED:CdmSectionPart.COLLAPSED);
+                }
+            }
+        });
+
         if (section.getToggle() != null) {
             section.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE_HOVER));
             section.getToggle().setDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE));
index 1e123f582f2594789482c8ca1bd82e7125fa47f5..349b9d00d58e065130acb2a33b38f1087032b2fd 100644 (file)
@@ -11,9 +11,8 @@ package eu.etaxonomy.taxeditor.ui.section.agent;
 
 import java.util.Arrays;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
@@ -62,12 +61,12 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
        /** {@inheritDoc} */
     @Override
     protected void createControls(ICdmFormElement formElement, Team entity, int style) {
-       
+
        setWarnForReferencingObjects(formElement);
         toggleable_cache = formFactory.createToggleableTextField(formElement, "Title Cache", entity.getTitleCache(), entity.isProtectedTitleCache(), style);
         toggleable_nomenclaturalTitleCache = formFactory.createToggleableTextField(formElement, "Abbrev. Title", entity.getNomenclaturalTitle(), entity.isProtectedNomenclaturalTitleCache(), style);
         hasAdditionalMembers = formFactory.createCheckbox(formElement, "Additional Members", entity.isHasMoreMembers(), style);
-        section_teamMembers = formFactory.createTeamMemberSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED, isNomenclaturalTeam);
+        section_teamMembers = formFactory.createTeamMemberSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(TeamMemberSection.class, entity.getClass().getCanonicalName(), true), isNomenclaturalTeam);
         section_teamMembers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
     }
 
index af7e05f289a075baf04bc0feff56c75bb1661570..b8b760ad852647fb1a314e2e877b20a68443c049 100644 (file)
@@ -15,6 +15,7 @@ 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.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -86,7 +87,7 @@ public class ClassificationDetailElement extends
                    entity != null ? entity.getMicroReference() : null, SWT.NULL);
               element_date = formFactory.createTimePeriodElement(formElement, "Date",
                    entity.getTimeperiod(), style);
-              section_collectingAreas = formFactory.createGeoScopeDetailSection(getConversationHolder(), formElement, SWT.NULL);
+              section_collectingAreas = formFactory.createGeoScopeDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(GeoScopeDetailSection.class, entity.getClass().getCanonicalName()));
            section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            section_collectingAreas.setEntity(entity);
 
index 7324c78ffe55b81fe89e66b57d50cb4c4ea07739..ae166e37a48a090e9eae4e87085d2d6c5d86834f 100644 (file)
@@ -29,6 +29,7 @@ import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -238,7 +239,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<TaxonNode>
             multiLanguageTextExcludedNotes.setEnabled(false);
                }
                if (!isCreateNew()){
-                   selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), style);
+                   selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), StoreUtil.getSectionStyle(TaxonNodeAgentRelationCollectionSection.class, entity.getClass().getCanonicalName()));
                    selectionNodeAgentRelation.setEntity(entity);
                    selectionNodeAgentRelation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                }
index 83c7709f0d4b2ab3fe6e1744ab62628b184e2f2d..1809f54d10f00f19677aa1a74b13b1b71484924e 100644 (file)
@@ -11,17 +11,18 @@ package eu.etaxonomy.taxeditor.ui.section.description;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractOriginalSourceElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
@@ -53,7 +54,7 @@ public class DescriptionElementSourceElement extends
                                        formElement, "Name in Source",
                                                null, EntitySelectionElement.ALL, SWT.NULL);
 
-               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
index 3b8e0db382d0a8c0c8b01053c771476130bc2fc1..c06dc77485f9883357fe2eb5a39d03a05974a941 100644 (file)
@@ -14,14 +14,14 @@ import java.util.List;
 import java.util.Set;
 
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.model.description.State;
 import eu.etaxonomy.cdm.model.description.StateData;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -83,7 +83,7 @@ public class StateDataElement extends AbstractEntityCollectionElement<StateData>
        @Override
        public void createControls(ICdmFormElement element, int style) {
                combo_state = formFactory.createDefinedTermComboElement(TermType.State, element, "State", null, style);
-               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
+               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, StoreUtil.getSectionStyle(ModifierSection.class, StateData.class.getCanonicalName(), true));
                section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
        }
index 796436a0e04975a99dd3eee7a0922f019d53a74d..3663ff42fa944cf51397c410d0ef2edd63343f06 100644 (file)
@@ -13,11 +13,11 @@ import java.util.ArrayList;
 import java.util.Set;
 
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -71,7 +71,7 @@ public class StatisticalMeasurementValueElement extends
        public void createControls(ICdmFormElement element, int style) {
                number_value = formFactory.createNumberTextWithLabelElement(element, "Value", 0, style);
                combo_type = formFactory.createDefinedTermComboElement(TermType.StatisticalMeasure, element, "Statistical Measure", null, style);
-               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, ExpandableComposite.TWISTIE);
+               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, StoreUtil.getSectionStyle(ModifierSection.class, StatisticalMeasurementValue.class.getCanonicalName()));
                section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
index 6ecef0d6237f360653b504923bd1685abec25445..eb8b6031418a68f58439f7e6f9a9fb73a5aafd02 100644 (file)
 package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -61,7 +61,7 @@ public abstract class AbstractDetailedDescriptionDetailElement<T extends Descrip
     protected void createModifier(ICdmFormElement formElement, DescriptionElementBase entity,
             int style) {
 
-        section_modifiers = formFactory.createModifierSection(getConversationHolder(), this, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
+        section_modifiers = formFactory.createModifierSection(getConversationHolder(), this, StoreUtil.getSectionStyle(ModifierSection.class, entity.getClass().getCanonicalName(), true));
         section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_modifiers.setEntity(entity);
 
index 94f5043d4e5612e07d52b259ec7c97cb1821c714..c01d79a02991cf9fe8127a124101f05d738e985e 100644 (file)
@@ -3,9 +3,8 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.model.description.CategoricalData;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -42,7 +41,7 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
                        CategoricalData entity, int style) {
 
                checkbox_orderRelevant = formFactory.createCheckbox(formElement, "Order Relevant", entity.getOrderRelevant(), style);
-               section_stateData = formFactory.createStateDataSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+               section_stateData = formFactory.createStateDataSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(StateDataSection.class, entity.getClass().getCanonicalName(), true));
                section_stateData.setEntity(entity);
                section_stateData.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                createTimePeriod(formElement, entity, style);
index 61893b5b40ceb30944f778bd40bd29621e861b91..9e0e5e17aeb31ef1d14465c5a41e0b853d5af5b2 100644 (file)
@@ -5,11 +5,10 @@ package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
 import java.util.ArrayList;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
 import eu.etaxonomy.cdm.model.description.QuantitativeData;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -48,7 +47,7 @@ public class QuantitativeDataDetailElement extends
                comboMeasurementUnit = formFactory.createDefinedTermComboElement(TermType.MeasurementUnit, formElement, "Measurement Unit", null, style);
         comboMeasurementUnit.setTerms(new ArrayList<MeasurementUnit>(entity.getFeature().getRecommendedMeasurementUnits()));
         comboMeasurementUnit.setSelection(entity.getUnit());
-               section_statisticalMeasurementValues = formFactory.createStatisticalMeasurementValueSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+               section_statisticalMeasurementValues = formFactory.createStatisticalMeasurementValueSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(StatisticalMeasurementValueSection.class, entity.getClass().getCanonicalName(), true));
                section_statisticalMeasurementValues.setEntity(entity);
                section_statisticalMeasurementValues.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
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());
        }
index 8ec1b79873410bdbf4f2c7c8cdce8f229588b60f..aea88de0ca1bd0ce5ed20beb245779029d6e0c24 100644 (file)
@@ -8,9 +8,8 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.feature;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.model.term.FeatureNode;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -35,11 +34,11 @@ public class FeatureNodeDetailElement extends AbstractCdmDetailElement<FeatureNo
        @Override
        protected void createControls(ICdmFormElement formElement, FeatureNode entity, int style) {
            sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(getConversationHolder(),
-                    formElement, ExpandableComposite.TWISTIE);
+                    formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
            sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionInapplicableIf.setEntity(getEntity());
            sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(getConversationHolder(),
-                   formElement, ExpandableComposite.TWISTIE);
+                   formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
            sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionOnlyApplicableIf.setEntity(getEntity());
     }
index 011ec43597a67cd51a66f4cd59e1097714352677..6fdcfcbd0b0c1e80f82b4ea4a9ad7160771372b2 100644 (file)
@@ -3,9 +3,8 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -40,15 +39,15 @@ public class PolytomousKeyDetailElement extends
 
            numberStartNumber = formFactory.createNumberTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
 
-           sectionTaxonomicScope = formFactory.createTaxonomicScopeSection(getConversationHolder(), formElement, style);
+           sectionTaxonomicScope = formFactory.createTaxonomicScopeSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(TaxonomicScopeSection.class, entity.getClass().getCanonicalName()));
            sectionTaxonomicScope.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionTaxonomicScope.setEntity(entity);
 
-           sectionGeoScopes = formFactory.createGeoScopePolyKeyDetailSection(getConversationHolder(), formElement, SWT.NULL);
+           sectionGeoScopes = formFactory.createGeoScopePolyKeyDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(GeoScopePolyKeyDetailSection.class, entity.getClass().getCanonicalName()));
            sectionGeoScopes.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionGeoScopes.setEntity(entity);
 
-           sectionScopeRestriction = formFactory.createScopeRestrictionSection(getConversationHolder(), formElement, SWT.NULL);
+           sectionScopeRestriction = formFactory.createScopeRestrictionSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ScopeRestrictionSection.class, entity.getClass().getCanonicalName()));
            sectionScopeRestriction.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionScopeRestriction.setEntity(entity);
        }
index 7799880707b62829f09aef8cb02366153500c29a..a4088c68ca8566ab16947cb02de5be9b98424c97 100644 (file)
@@ -160,7 +160,7 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
                 element_image.dispose();
                 element_image = null;
             }
-            section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), parentFormElement, style);
+            section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(MediaRepresentationSection.class, getEntity().getClass().getCanonicalName()));
             section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_mediaRepresentation.setEntity(getEntity());
             //set buffered uri as text if uri had parsing problems in simple view
index 7e53b1d0b3a497ea6f0bbf117a029d9659dd65b5..5407b34de66270f27210b8e74703b6b3b9b1e716 100644 (file)
@@ -21,6 +21,7 @@ import eu.etaxonomy.cdm.common.media.ImageInfo;
 import eu.etaxonomy.cdm.model.media.ImageFile;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -53,7 +54,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
        public void createControls(ICdmFormElement element, int style) {
                text_mimeType = formFactory.createTextWithLabelElement(element, "Mime Type", null, style);
                text_suffix = formFactory.createTextWithLabelElement(element, "Suffix", null, style);
-               section_mediaRepresentationPart = formFactory.createMediaRepresentationPartSection(getConversationHolder(), element, style);
+               section_mediaRepresentationPart = formFactory.createMediaRepresentationPartSection(getConversationHolder(), element, StoreUtil.getSectionStyle(MediaRepresentationPartSection.class, MediaRepresentation.class.getCanonicalName()));
                section_mediaRepresentationPart.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
index 8717937b7b2e313e73d3ed814ffb98efe0e6e092..7b2a4b670563f550ac7233c078cca2b032abf59f 100644 (file)
@@ -11,8 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import java.util.Arrays;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.model.name.IBacterialName;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -91,19 +89,19 @@ public class NonViralNameDetailElement
         }
 
 
-           section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(NameDetailSection.class, entity.getClass().getCanonicalName(), true));
            section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addControl(section_name);
            addElement(section_name);
 //         if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
-           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(AuthorshipDetailSection.class, entity.getClass().getCanonicalName(), true));
            section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addControl(section_author);
            addElement(section_author);
 //         }
            //TODO RL
            if (config.isHybridActivated()){
-          section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+          section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(HybridDetailSection.class, entity.getClass().getCanonicalName()));
           section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
           addControl(section_hybrid);
           addElement(section_hybrid);
index fd64a16d635d626c43fe580d5f69320184c32358..0003781481d09751aeb8e4ece64c439002a60257 100644 (file)
@@ -9,16 +9,15 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -119,7 +118,7 @@ public class DerivedUnitBaseDetailElement extends
 
                super.createControls(formElement, entity, style);
 
-        section_source = formFactory.createSourceCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_source = formFactory.createSourceCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
                section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_source.setEntity(entity);
 
index 392d4b815d24ebcad3c70a3f2173645b56126872..e97b2692c35ce6864033051b742b05265bcb8827 100644 (file)
@@ -9,8 +9,6 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.LanguageString;
@@ -18,6 +16,7 @@ import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
@@ -88,7 +87,7 @@ public class DerivedUnitGeneralDetailElement extends
                            entity.getCountry(), EntitySelectionElement.DELETABLE, style);
 
                if(PreferencesUtil.isCollectingAreaInGeneralSection()){
-                   section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+                   section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
                    section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                    section_collectingAreas.setEntity(entity);
                }
index d2b01bfe520985a642c1f0c4db2c221d15fb89fb..048d8502d2b08fc13eeb0451a1d5daa3d2e27602 100644 (file)
@@ -9,9 +9,8 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -44,11 +43,11 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Derived
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitFacade entity, int style) {
 
-        section_currentDetermination = formFactory.createCurrentDeterminationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
+        section_currentDetermination = formFactory.createCurrentDeterminationDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CurrentDeterminationDetailSection.class, entity.getClass().getCanonicalName(), true));
         section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_currentDetermination.setEntity(entity);
 
-        section_determinationHistory = formFactory.createDeterminationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_determinationHistory = formFactory.createDeterminationHistoryDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(DeterminationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
         section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_determinationHistory.setEntity(entity);
 
index a69367adac785e70df0a100172206a8113f31ac2..51c9b674f0bdd0ad48bec68599eabc9315352bfb 100644 (file)
@@ -8,14 +8,13 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
@@ -77,7 +76,7 @@ public class FieldUnitGeneralDetailElement extends AbstractCdmDetailElement<Deri
         selection_country = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(),
                 formElement, "Country", entity.getCountry(), EntitySelectionElement.DELETABLE, style);
         if(PreferencesUtil.isCollectingAreaInGeneralSection()){
-            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
             section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_collectingAreas.setEntity(entity);
         }
index ceb90ac2ea3b9fcf64c07fd9731874b1a94b10ac..747577168b671ca2b35c52ba4174951e117fdae2 100644 (file)
@@ -9,10 +9,9 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -79,7 +78,7 @@ public class GatheringEventDetailElement extends
 
 
         if(!PreferencesUtil.isCollectingAreaInGeneralSection()){
-            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
             section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_collectingAreas.setEntity(entity);
         }
index a265a1d86cb6dbc86334b7d8f2fe2c444e4cb62d..822acf6f76df36dcf91f97cfb0907078e4e80513 100644 (file)
@@ -9,15 +9,14 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -92,7 +91,7 @@ public class PreservedSpecimenDetailElement extends
 
         text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", entity.getExsiccatum(), style);
 
-        section_source = formFactory.createPreservedSpecimenSourceCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_source = formFactory.createPreservedSpecimenSourceCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(PreservedSpecimenSourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
                section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_source.setEntity(entity);
        }
index 9bf0fe1f1a6886e9ae08c36dee61c52ba57a0a74..6bb18a6e61222fa5206f170ea49705911ae16608 100644 (file)
@@ -9,6 +9,7 @@
 package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import eu.etaxonomy.cdm.model.molecular.AmplificationResult;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -39,7 +40,7 @@ public class AmplificationGelPhotoDetailElement  extends AbstractCdmDetailElemen
      */
     @Override
     protected void createControls(ICdmFormElement formElement, AmplificationResult entity, int style) {
-        sectionGelPhoto = formFactory.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), formElement, style);
+        sectionGelPhoto = formFactory.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AmplificationGelPhotoCollectionDetailSection.class, entity.getClass().getCanonicalName()));
         sectionGelPhoto.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionGelPhoto.setEntity(entity);
     }
index 65281fb27d3562152e06851b0440ac176d2f382f..9d17b22514f5850a5bcd15e485262a9120a713e5 100644 (file)
@@ -10,10 +10,11 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Institution;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.Primer;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -71,7 +72,7 @@ public class AmplificationGeneralDetailElement extends AbstractCdmDetailElement<
         selectionPrimerRW = formFactory.createSelectionElement(Primer.class, //getConversationHolder(),
                 formElement, "Primer RW", entity.getReversePrimer(), EntitySelectionElement.ALL, style);
 
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, style);
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
         annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         annotationSection.setEntity(entity);
     }
index bd5a047be326bdf862936eda87f3f116195bc828..6ad3dee5d56ce8cea5faa7587075668c28ac4b01 100644 (file)
@@ -8,11 +8,12 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.molecular.Primer;
 import eu.etaxonomy.cdm.model.molecular.SequenceString;
 import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -70,7 +71,7 @@ public class PrimerGeneralDetailElement extends AbstractCdmDetailElement<Primer>
                         entity.getPublishedIn(),
                         EntitySelectionElement.ALL, style);
 
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, style);
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
         annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         annotationSection.setEntity(entity);
     }
index 0db67c16108a1721ced138032533dbf551242f06..b7c7047a005c723ecb8e8be9e65492be219553eb 100644 (file)
@@ -9,9 +9,8 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -45,11 +44,11 @@ public class SampleDesignationDetailElement extends AbstractCdmDetailElement<Ide
        protected void createControls(ICdmFormElement formElement,
                IdentifiableEntity<?> entity, int style) {
 
-        sectionCurrentSampleDesignation = formFactory.createCurrentSampleDesignationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
+        sectionCurrentSampleDesignation = formFactory.createCurrentSampleDesignationDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CurrentSampleDesignationDetailSection.class, entity.getClass().getCanonicalName(), true));
         sectionCurrentSampleDesignation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionCurrentSampleDesignation.setEntity(entity);
 
-        sectionSampleDesignationHistory = formFactory.createSampleDesignationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        sectionSampleDesignationHistory = formFactory.createSampleDesignationHistoryDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SampleDesignationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
         sectionSampleDesignationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionSampleDesignationHistory.setEntity(entity);
 
index 4f817fb94b7aec083f922e449cdedb14a5664fb8..58e0416eac2b68b1deb8af4115c4213ee7ff77d3 100644 (file)
@@ -12,6 +12,7 @@ import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.AmplificationResult;
 import eu.etaxonomy.cdm.model.molecular.Primer;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -56,15 +57,15 @@ public class SingleReadGeneralDetailElement extends AbstractCdmDetailElement<Sin
         selectionAmplification = formFactory.createSelectionElement(Amplification.class, //getConversationHolder(),
                 formElement, "Amplification", amplificationResult.getAmplification(), EntitySelectionElement.ALL, style);
 
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, style);
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
         annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         annotationSection.setEntity(entity);
 
-        AmplificationCloningDetailSection cloningSection = formFactory.createAmplificationCloningDetailSection(getConversationHolder(), formElement, formFactory.getSelectionProvider(), style);
+        AmplificationCloningDetailSection cloningSection = formFactory.createAmplificationCloningDetailSection(getConversationHolder(), formElement, formFactory.getSelectionProvider(), StoreUtil.getSectionStyle(AmplificationCloningDetailSection.class, amplificationResult.getClass().getCanonicalName()));
         cloningSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         cloningSection.setEntity(amplificationResult);
 
-        AmplificationGelPhotoCollectionDetailSection gelPhotoSection = formFactory.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), formElement, style);
+        AmplificationGelPhotoCollectionDetailSection gelPhotoSection = formFactory.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AmplificationGelPhotoCollectionDetailSection.class, amplificationResult.getClass().getCanonicalName()));
         gelPhotoSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         gelPhotoSection.setEntity(amplificationResult);
     }
index b140c9329e2ce95e4b51467ecc4432cd17924b41..fad623c8f7e2f7bf273b37fe8aa6336359282b71 100644 (file)
@@ -4,13 +4,14 @@
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
 
 /**
  * @author n.hoffmann
@@ -28,7 +29,7 @@ public class IdentifiableSourceElement extends AbstractOriginalSourceElement<Ide
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
                super.createControls(formElement, style);
-               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, IdentifiableSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
index 3bd4d7c24da074070c3eb635469a1031cd090e3b..a1782aa8233afd0e18e41bd8b354089f7ae469f5 100644 (file)
@@ -17,6 +17,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.MisappliedRelationshipComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -71,7 +72,7 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
 
                        taxon = entity.getFromTaxon();
 
-            taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, style);
+            taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(TaxonDetailSection.class, Taxon.class.getCanonicalName()));
             taxonElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             addControl(taxonElement);
             addElement(taxonElement);
@@ -128,7 +129,7 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
                }else if (entity.getType().isAnySynonym() ){
                    taxon = entity.getFromTaxon();
 
-            taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, style);
+            taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(TaxonDetailSection.class, Taxon.class.getCanonicalName()));
             taxonElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             addControl(taxonElement);
             addElement(taxonElement);
index 9d45a5fee4c7cc1f7e3d8572dd226ab5cf54bd81..6020ac8089832a952e376441fee6fda838676a00 100644 (file)
@@ -8,8 +8,6 @@
 */\r
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
 \r
-import org.eclipse.ui.forms.widgets.ExpandableComposite;\r
-\r
 import eu.etaxonomy.cdm.model.description.Feature;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
@@ -74,26 +72,25 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
 \r
         if (supportsCategoricalData.getSelection()) {\r
             sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),\r
-                    parentFormElement, ExpandableComposite.TWISTIE);\r
+                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionStateVocabularies.setEntity(getEntity());\r
 \r
         }\r
         if (supportsQuantitativeData.getSelection()) {\r
             sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),\r
-                    parentFormElement, ExpandableComposite.TWISTIE);\r
+                    parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionMeasurementUnits.setEntity(getEntity());\r
 \r
             sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(),\r
-                    parentFormElement, ExpandableComposite.TWISTIE);\r
+                    parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionStatisticalMeasures.setEntity(getEntity());\r
         }\r
         if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {\r
             sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(\r
-                    getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE\r
-                           );\r
+                    getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionModifierVocabularies.setEntity(getEntity());\r
         }\r
@@ -151,19 +148,19 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
 \r
         //measurement units\r
         sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),\r
-                parentFormElement, ExpandableComposite.TWISTIE);\r
+                parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionMeasurementUnits.setEntity(getEntity());\r
 \r
         //statistical measures\r
         sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(\r
-                getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+                getConversationHolder(), parentFormElement,StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionStatisticalMeasures.setEntity(getEntity());\r
 \r
         //modifiers\r
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(\r
-                getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionModifierVocabularies.setEntity(getEntity());\r
     }\r
@@ -184,13 +181,13 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
 \r
         //states\r
         sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),\r
-                parentFormElement, ExpandableComposite.TWISTIE);\r
+                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionStateVocabularies.setEntity(getEntity());\r
 \r
         //modifiers\r
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(\r
-                getConversationHolder(), parentFormElement, ExpandableComposite.TWISTIE);\r
+                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionModifierVocabularies.setEntity(getEntity());\r
     }\r
index 34aa55a0d2fd9de35c8773c3b4ec0d0147bf8904..950d2d94b8106bd2b4d204698c021f1e7d85dd4a 100644 (file)
@@ -202,7 +202,7 @@ public class CdmSectionPart<T> extends SectionPart implements
        @Override
        protected void expansionStateChanged(boolean expanded) {
            super.expansionStateChanged(expanded);
-           PreferencesUtil.setStringValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput), expanded?EXPANDED:COLLAPSED);
+           PreferencesUtil.setStringValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput.getClass().getCanonicalName()), expanded?EXPANDED:COLLAPSED);
        }
 
 }
index 7cfea33174acbfba766e5aeedcc497af8fc526fa..f6ad7979d6f7f297251467ecf30b122e94c5c040 100644 (file)
@@ -22,7 +22,6 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.forms.IFormPart;
 import org.eclipse.ui.forms.ManagedForm;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -31,7 +30,6 @@ import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.remoting.CdmEagerLoadingException;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
@@ -173,22 +171,6 @@ public abstract class AbstractCdmDataViewerE4 extends Viewer implements IConvers
                body.layout();
        }
 
-       protected int getSectionStyle(Class<? extends AbstractFormSection> clazz){
-           return getSectionStyle(clazz, false);
-       }
-
-    protected int getSectionStyle(Class<? extends AbstractFormSection> clazz, boolean initiallyExpanded){
-        int style = ExpandableComposite.TWISTIE;
-        String prefKey = StoreUtil.getPrefKey(clazz, getInput());
-        if(PreferencesUtil.contains(prefKey)){
-            style = PreferencesUtil.getStringValue(prefKey)==CdmSectionPart.EXPANDED?style |= ExpandableComposite.EXPANDED:style;
-        }
-        else{
-            style = initiallyExpanded?style |= ExpandableComposite.EXPANDED:style;
-        }
-        return style;
-    }
-
        protected abstract void showParts();
 
        public void destroySections() {
index b02ffac24aa71cf5834ddf14174311b53eb3cc05..7be1d784d9a77036e9b33e204aa2973ff78201d7 100755 (executable)
@@ -67,6 +67,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
 import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.UsageTermCollection;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
@@ -398,9 +399,9 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createGroupSection(RootElement parent) {
-        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, getSectionStyle(GroupDetailSection.class));
-        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, getSectionStyle(MemberDetailSection.class));
-        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,getSectionStyle(GrantedAuthorityDetailSection.class));
+        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(GroupDetailSection.class, getInput().getClass().getCanonicalName()));
+        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(MemberDetailSection.class, getInput().getClass().getCanonicalName()));
+        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,StoreUtil.getSectionStyle(GrantedAuthorityDetailSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(groupDetailSection);
         addPart(memberDetailSection);
@@ -429,52 +430,52 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     private void createTaxonSections(RootElement parent) {
         NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration();
         ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
-                getSectionStyle(ParsingMessagesSection.class, true));
+                StoreUtil.getSectionStyle(ParsingMessagesSection.class, getInput().getClass().getCanonicalName(), true));
         if (!config.isSimpleDetailsViewActivated()){
             TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
-                    getSectionStyle(TaxonBaseDetailSection.class, true));
+                    StoreUtil.getSectionStyle(TaxonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(taxonBaseDetailSection);
         }else{
             if (config.isTaxonSectionActivated()){
                 TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
-                        getSectionStyle(TaxonBaseDetailSection.class, true));
+                        StoreUtil.getSectionStyle(TaxonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
                 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
                 addPart(taxonBaseDetailSection);
             }
         }
         NonViralNameDetailSection nonViralNameSection = formFactory
                 .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
-                        getSectionStyle(NonViralNameDetailSection.class, true));
+                        StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isNomenclaturalReferenceSectionActivated())){
             NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
-                    getSectionStyle(NomenclaturalReferenceDetailSection.class, true));
+                    StoreUtil.getSectionStyle(NomenclaturalReferenceDetailSection.class, getInput().getClass().getCanonicalName(), true));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(referenceDetailSection);
 
         }
         if ( !config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isNomenclaturalStatusSectionActivated())){
             NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
-                    getSectionStyle(NomenclaturalStatusSection.class, true));
+                    StoreUtil.getSectionStyle(NomenclaturalStatusSection.class, getInput().getClass().getCanonicalName(), true));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(nomenclaturalStatusSection);
         }
 
         if ( !config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isProtologueActivated())){
-            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, getSectionStyle(ProtologueSection.class));
+            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(protologSection);
         }
 
         if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isTypeDesignationSectionActivated())){
-            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, getSectionStyle(TypeDesignationSection.class));
+            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(typeDesignationSection);
         }
 
         if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() &&config.isNameRelationsSectionActivated())){
-            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, getSectionStyle(NameRelationshipDetailSection.class));
+            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(nameRelationshipSection);
         }
@@ -488,29 +489,29 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
 
     private void createNameSections(RootElement parent) {
         NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
-                getConversationHolder(), parent, this, false, getSectionStyle(NonViralNameDetailSection.class, true));
+                getConversationHolder(), parent, this, false, StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
-                getSectionStyle(NomenclaturalReferenceDetailSection.class, true));
+                StoreUtil.getSectionStyle(NomenclaturalReferenceDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
-                getSectionStyle(NomenclaturalStatusSection.class, true));
+                StoreUtil.getSectionStyle(NomenclaturalStatusSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         addPart(nonViralNameSection);
         addPart(nomenclaturalStatusSection);
         addPart(referenceDetailSection);
 
-        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, getSectionStyle(ProtologueSection.class));
+        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, getSectionStyle(TypeDesignationSection.class));
+        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, getSectionStyle(NameRelationshipDetailSection.class));
+        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(protologSection);
         addPart(typeDesignationSection);
@@ -520,41 +521,41 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
 
     private void createReferenceSections(RootElement parent) {
         ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
-                getSectionStyle(ReferenceDetailSection.class, true));
+                StoreUtil.getSectionStyle(ReferenceDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(referenceDetailSection);
     }
 
     private void createTeamOrPersonBaseDetailSection(RootElement parent) {
-        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, getSectionStyle(TeamOrPersonBaseDetailSection.class, true));
+        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TeamOrPersonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(teamOrPersonBaseDetailSection);
     }
 
     private void createTeamDetailSection(RootElement parent) {
-        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, getSectionStyle(TeamDetailSection.class, true));
+        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TeamDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(teamDetailSection);
     }
 
     private void createPersonDetailSection(RootElement parent) {
-        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, getSectionStyle(PersonDetailSection.class, true));
+        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(PersonDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(personDetailSection);
     }
 
     private void createDescriptionElementSection(RootElement parent) {
-        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, getSectionStyle(DescriptionElementDetailSection.class, true));
+        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionElementDetailSection.class, getInput().getClass().getCanonicalName(), true));
         descriptionElementDetailSection.setEnabled(this.detailsEnabled);
 
-        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  getSectionStyle(.class));
+        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  getSectionStyle(.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, getSectionStyle(DescriptionElementSourceSection.class));
+        DescriptionElementSourceSection descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionElementSourceSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, getSectionStyle(DescriptionElementMediaSection.class));
+        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionElementMediaSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -564,25 +565,25 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createDescriptionSection(RootElement parent, boolean isTaxonDescription) {
-        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, getSectionStyle(DescriptionDetailSection.class, true));
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(descriptionDetailSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         if(isTaxonDescription) {
             NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(
-                    getConversationHolder(), parent, this, getSectionStyle(NaturalLanguageSection.class, true));
+                    getConversationHolder(), parent, this, StoreUtil.getSectionStyle(NaturalLanguageSection.class, getInput().getClass().getCanonicalName(), true));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(naturalLanguageSection);
         }
         DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(
-                getConversationHolder(), parent, getSectionStyle(DescriptionSourceSection.class, true));
+                getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionSourceSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(descriptionSourceSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         if(isTaxonDescription) {
-            ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, getSectionStyle(ScopeSection.class));
+            ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ScopeSection.class, getInput().getClass().getCanonicalName()));
             addPart(scopeSection);
         }
     }
@@ -596,11 +597,11 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createUseDescriptionSection(RootElement parent) {
-        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, getSectionStyle(DescriptionDetailSection.class));
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, getSectionStyle(DescriptionSourceSection.class));
+        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionSourceSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -610,19 +611,19 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createImageGallerySection(RootElement parent) {
-        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, getSectionStyle(DescriptionDetailSection.class));
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(descriptionDetailSection);
     }
 
     private void createMediaElementSection(RootElement parent) {
-        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, getSectionStyle(MediaDetailsSection.class));
+        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(MediaDetailsSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(mediaDetailSection);
     }
 
     private void createDerivedUnitBaseElementSection(RootElement parent) {
-        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(DerivedUnitGeneralDetailSection.class, true));
+        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DerivedUnitGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
         //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
         if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
             derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
@@ -631,52 +632,52 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, getSectionStyle(DerivedUnitBaseDetailSection.class, true));
+        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DerivedUnitBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(derivedUnitBaseDetailSection);
 
         //for editors working with facades
         if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, getSectionStyle(GatheringEventDetailSection.class));
+            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(GatheringEventDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(gatheringEventDetailSection);
 
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, getSectionStyle(FieldUnitDetailSection.class));
+            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FieldUnitDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(fieldUnitDetailSection);
         }
         else{
 
             if(PreferencesUtil.isShowTaxonAssociations()){
                 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, getSectionStyle(TaxonAssociationDetailSection.class, true));
+                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TaxonAssociationDetailSection.class, getInput().getClass().getCanonicalName(), true));
                 addPart(taxonAssociationDetailSection);
             }
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, getSectionStyle(DerivedUnitFacadeIdentifierSection.class));
+            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DerivedUnitFacadeIdentifierSection.class, getInput().getClass().getCanonicalName()));
             addPart(identifierDetailSection);
         }
         if(!PreferencesUtil.isDeterminationOnlyForFieldUnits()){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, getSectionStyle(DeterminationDetailSection.class));
+            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(determinationDetailSection);
         }
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, getSectionStyle(DerivedUnitTypeDesignationSection.class));
+        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DerivedUnitTypeDesignationSection.class, getInput().getClass().getCanonicalName()));
         addPart(derivedUnitTypeDesignationSection);
 
     }
 
     private void createFieldUnitSection(RootElement parent) {
-        FieldUnitGeneralDetailSection fielUnitGeneralDetailSection = formFactory.createFieldUnitGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(FieldUnitGeneralDetailSection.class, true));
+        FieldUnitGeneralDetailSection fielUnitGeneralDetailSection = formFactory.createFieldUnitGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FieldUnitGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, getSectionStyle(GatheringEventDetailSection.class));
+        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(GatheringEventDetailSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, getSectionStyle(FieldUnitDetailSection.class));
+        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FieldUnitDetailSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(fielUnitGeneralDetailSection);
         addPart(gatheringEventDetailSection);
@@ -684,36 +685,36 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
 
         if(PreferencesUtil.isDeterminationOnlyForFieldUnits()){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, getSectionStyle(DeterminationDetailSection.class));
+            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(determinationDetailSection);
         }
     }
 
     private void createTissueSampleSection(RootElement parent) {
-        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(TissueSampleGeneralDetailSection.class, true));
+        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TissueSampleGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, getSectionStyle(SampleDesignationDetailSection.class, true));
+        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(section);
         addPart(sampleDesignationDetailSection);
     }
 
     private void createDnaSampleSection(RootElement parent) {
-        DnaSampleGeneralDetailSection section = formFactory.createDnaSampleGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(DnaSampleGeneralDetailSection.class, true));
+        DnaSampleGeneralDetailSection section = formFactory.createDnaSampleGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DnaSampleGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DnaSamplePreparationPreservationSection preparationPreservationSection = formFactory.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent, this, getSectionStyle(DnaSamplePreparationPreservationSection.class, true));
+        DnaSamplePreparationPreservationSection preparationPreservationSection = formFactory.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DnaSamplePreparationPreservationSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, getSectionStyle(DnaQualityDetailSection.class, true));
+        DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DnaQualityDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, getSectionStyle(SampleDesignationDetailSection.class, true));
+        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(section);
         addPart(preparationPreservationSection);
@@ -722,15 +723,15 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createSequenceSection(RootElement parent) {
-        SequenceGeneralDetailSection section = formFactory.createSequenceGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(SequenceGeneralDetailSection.class, true));
+        SequenceGeneralDetailSection section = formFactory.createSequenceGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SequenceGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SequenceReferenceCollectionDetailSection referenceSection = formFactory.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent, getSectionStyle(SequenceReferenceCollectionDetailSection.class, true));
+        SequenceReferenceCollectionDetailSection referenceSection = formFactory.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(SequenceReferenceCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SequenceContigFileCollectionDetailSection contigFileSection = formFactory.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent, getSectionStyle(SequenceContigFileCollectionDetailSection.class, true));
+        SequenceContigFileCollectionDetailSection contigFileSection = formFactory.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(SequenceContigFileCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
 
         addPart(section);
@@ -739,57 +740,57 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createSingleReadSection(RootElement parent) {
-        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(SingleReadGeneralDetailSection.class, true));
+        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SingleReadGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(section);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, getSectionStyle(SingleReadPherogramCollectionDetailSection.class, true));
+        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(SingleReadPherogramCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(pherogramSection);
 
     }
 
     private void createMediaSpecimenSection(RootElement parent) {
-        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, getSectionStyle(MediaSpecimenGeneralDetailSection.class, true));
+        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(MediaSpecimenGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(generalSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, getSectionStyle(RightsSection.class));
+        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(RightsSection.class, getInput().getClass().getCanonicalName()));
         addPart(rightsSection);
 
     }
 
     private void createFeatureTreeSection(RootElement parent) {
-        FeatureTreeDetailSection section = formFactory.createFeatureTreeDetailSection(getConversationHolder(), parent, this, getSectionStyle(FeatureTreeDetailSection.class, true));
+        FeatureTreeDetailSection section = formFactory.createFeatureTreeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FeatureTreeDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(section);
     }
 
     private void createFeatureNodeSection(RootElement parent) {
-        FeatureNodeDetailSection featureDistributionSection = formFactory.createFeatureNodeDetailSection(getConversationHolder(), parent, this, getSectionStyle(FeatureNodeDetailSection.class, true));
+        FeatureNodeDetailSection featureDistributionSection = formFactory.createFeatureNodeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FeatureNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(featureDistributionSection);
     }
 
     private void createFeatureDistributionSection(RootElement parent) {
-        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, getSectionStyle(FeatureDistributionDetailSection.class, true));
+        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FeatureDistributionDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(featureDistributionSection);
     }
 
     private void createCharacterSection(RootElement parent) {
-        CharacterDetailSection featureDistributionSection = formFactory.createCharacterDetailSection(getConversationHolder(), parent, this, getSectionStyle(CharacterDetailSection.class, true));
+        CharacterDetailSection featureDistributionSection = formFactory.createCharacterDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(featureDistributionSection);
     }
 
     private void createPolytomousKeyNodeSection(RootElement parent) {
-        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, getSectionStyle(PolytomousKeyDetailSection.class));
+        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(PolytomousKeyDetailSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, getSectionStyle(PolytomousKeyNodeDetailSection.class, true));
+        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(PolytomousKeyNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(polytomousKeyDetailSection);
         addPart(polytomousKeyNodeDetailSection);
@@ -797,7 +798,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createUseRecordSection(RootElement parent) {
-        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,getSectionStyle(UseRecordDetailSection.class, true));
+        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,StoreUtil.getSectionStyle(UseRecordDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -807,9 +808,9 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createUserSection(RootElement parent) {
-        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, getSectionStyle(UserDetailSection.class, true));
+        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(UserDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
-        GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, getSectionStyle(GroupsByUserDetailSection.class, true));
+        GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(GroupsByUserDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(userDetailSection);
         addPart(groupByUserDetailSection);
@@ -817,7 +818,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
 
     private void createMisappliedNameSection(RootElement parent) {
         TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this,
-                getSectionStyle(TaxonRelationshipDetailSection.class, true));
+                StoreUtil.getSectionStyle(TaxonRelationshipDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(taxonRelationshipDetailSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
@@ -825,52 +826,52 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
 
         NonViralNameDetailSection nonViralNameSection = formFactory
                 .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
-                        getSectionStyle(NonViralNameDetailSection.class, true));
+                        StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(nonViralNameSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
-                getSectionStyle(NomenclaturalReferenceDetailSection.class, true));
+                StoreUtil.getSectionStyle(NomenclaturalReferenceDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(referenceDetailSection);
 
 
         NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
-                       getSectionStyle(NomenclaturalStatusSection.class, true));
+                       StoreUtil.getSectionStyle(NomenclaturalStatusSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(nomenclaturalStatusSection);
 
-               ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, getSectionStyle(ProtologueSection.class));
+               ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
                addPart(protologSection);
 
-               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, getSectionStyle(TypeDesignationSection.class));
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
                addPart(typeDesignationSection);
 
-               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, getSectionStyle(NameRelationshipDetailSection.class));
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
                addPart(nameRelationshipSection);
 
     }
 
     private void createTaxonRelationshipSection(RootElement parent) {
-        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, getSectionStyle(TaxonRelationshipDetailSection.class, true));
+        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TaxonRelationshipDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
-        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, getSectionStyle(ReferencedEntityDetailSection.class, true));
+        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(ReferencedEntityDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(taxonRelationshipDetailSection);
         addPart(referencedEntityBaseDetailSection);
     }
     private void createTermVocabularySection(RootElement parent) {
-        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, getSectionStyle(TermVocabularyDetailSection.class, true));
+        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TermVocabularyDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(termVocabularyDetailSection);
     }
 
     private void createDefinedTermSection(RootElement parent) {
-        DefinedTermDetailSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, getSectionStyle(DefinedTermDetailSection.class, true));
+        DefinedTermDetailSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DefinedTermDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(definedTermDetailSection);
-        TermMediaSection termMediaSection = formFactory.createTermMediaSection(getConversationHolder(), parent, getSectionStyle(DefinedTermDetailSection.class, true));
+        TermMediaSection termMediaSection = formFactory.createTermMediaSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DefinedTermDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(termMediaSection);
     }
 
index 269738237a8f5683ab1e19dc6e552134eaa7dc1c..c0d3f7b62b959c06a891459c9aee2420d192841b 100644 (file)
@@ -28,6 +28,7 @@ import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.section.media.MediaSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationSection;
@@ -114,18 +115,18 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewerE4 {
        }
 
        private void createSourceSection(RootElement parent){
-           int expandStyle = getSectionStyle(SourceSection.class, false);
+           int expandStyle = StoreUtil.getSectionStyle(SourceSection.class, getInput().getClass().getCanonicalName(), false);
         SourceSection sourceSection =  formFactory.createSourceSection(getConversationHolder(), parent, expandStyle);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(sourceSection);
     }
 
     private void createAnnotationSections(RootElement parent) {
-        int expandStyle = getSectionStyle(AnnotationSection.class, false);
+        int expandStyle = StoreUtil.getSectionStyle(AnnotationSection.class, getInput().getClass().getCanonicalName(), false);
         AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        expandStyle = getSectionStyle(MarkerSection.class, false);
+        expandStyle = StoreUtil.getSectionStyle(MarkerSection.class, getInput().getClass().getCanonicalName(), false);
         MarkerSection markerSection = formFactory.createMarkerSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
@@ -135,23 +136,23 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createIdentifiableSections(RootElement parent) {
-        int expandStyle = getSectionStyle(SourceSection.class, false);
+        int expandStyle = StoreUtil.getSectionStyle(SourceSection.class, getInput().getClass().getCanonicalName(), false);
         SourceSection sourceSection = formFactory.createSourceSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        expandStyle =  getSectionStyle(IdentifierSection.class, false);
+        expandStyle =  StoreUtil.getSectionStyle(IdentifierSection.class, getInput().getClass().getCanonicalName(), false);
         IdentifierSection identifierSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        expandStyle =  getSectionStyle(ExtensionSection.class, false);
+        expandStyle =  StoreUtil.getSectionStyle(ExtensionSection.class, getInput().getClass().getCanonicalName(), false);
         ExtensionSection extensionSection = formFactory.createExtensionSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        expandStyle =  getSectionStyle(CreditSection.class, false);
+        expandStyle =  StoreUtil.getSectionStyle(CreditSection.class, getInput().getClass().getCanonicalName(), false);
         CreditSection creditSection = formFactory.createCreditSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        expandStyle =  getSectionStyle(RightsSection.class, false);
+        expandStyle =  StoreUtil.getSectionStyle(RightsSection.class, getInput().getClass().getCanonicalName(), false);
         RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
@@ -165,7 +166,7 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewerE4 {
        }
 
     private void createIdentifiableMediaSections(RootElement parent) {
-        int expandStyle = getSectionStyle(MediaSection.class, false);
+        int expandStyle = StoreUtil.getSectionStyle(MediaSection.class, getInput().getClass().getCanonicalName(), false);
         MediaSection mediaSection = formFactory.createMediaSection(getConversationHolder(), parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
@@ -174,13 +175,13 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
        private void createVersionSection(RootElement parent){
-               VersionSection versionSection = formFactory.createVersionSection(parent, ExpandableComposite.NO_TITLE | ExpandableComposite.EXPANDED);
+               VersionSection versionSection = formFactory.createVersionSection(parent, ExpandableComposite.NO_TITLE | StoreUtil.getSectionStyle(VersionSection.class, getInput().getClass().getCanonicalName(), true));
                addPart(versionSection);
        }
 
        private void createCdmBaseSection(RootElement parent) {
 
-               CdmBaseSection cdmBaseSection = formFactory.createCdmBaseSection(parent, ExpandableComposite.NO_TITLE | ExpandableComposite.EXPANDED);
+               CdmBaseSection cdmBaseSection = formFactory.createCdmBaseSection(parent, ExpandableComposite.NO_TITLE | StoreUtil.getSectionStyle(CdmBaseSection.class, getInput().getClass().getCanonicalName(), true));
                addPart(cdmBaseSection);
        }