- completely removed DetailType enum and all its uses
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / occurrence / DerivedUnitFacadeDetailElement.java
index 3997d2af3390a13e7b3ebd7720d58eedd9386f8e..edd068f7ff91d83f365e3d54c60da50ae5063128 100644 (file)
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeConfigurator;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
@@ -35,7 +34,7 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
 
        private DerivedUnitFacade facade;
 
-       private DerivedUnitFacadeConfigurator configurator;
+       private final DerivedUnitFacadeConfigurator configurator;
 
        private GeneralDetailSection section_general;
        private GatheringEventDetailSection section_gatheringEvent;
@@ -69,7 +68,7 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
                        section_fieldObservation.setEntity(facade);
 
                } catch (DerivedUnitFacadeNotSupportedException e) {
-                       StoreUtil.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
+                       AbstractUtility.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
                }
        }
 
@@ -119,22 +118,22 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitBase entity, int style) {
 
-               section_general = (GeneralDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL, getConversationHolder(), formElement, null, Section.TWISTIE | Section.EXPANDED);
+               section_general = formFactory.createGeneralDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
                section_general.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_general);
                addElement(section_general);
 
-               section_gatheringEvent = (GatheringEventDetailSection) formFactory.createCdmDetailSection(DetailType.GATHERING_EVENT, getConversationHolder(), formElement, null, Section.TWISTIE);
+               section_gatheringEvent = formFactory.createGatheringEventDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_gatheringEvent.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_gatheringEvent);
                addElement(section_gatheringEvent);
 
-               section_fieldObservation = (FieldObservationDetailSection) formFactory.createCdmDetailSection(DetailType.FIELD_OBSERVATION, getConversationHolder(), formElement, null, Section.TWISTIE);
+               section_fieldObservation = formFactory.createFieldObservationDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_fieldObservation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_fieldObservation);
                addElement(section_fieldObservation);
 
-               section_derivedUnitBase = (DerivedUnitBaseDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT, getConversationHolder(), formElement, null, Section.TWISTIE);
+               section_derivedUnitBase = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
                section_derivedUnitBase.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addControl(section_derivedUnitBase);
                addElement(section_derivedUnitBase);