reintegrated campanula branch: removed enum DetailType and all its uses
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 22 Jul 2013 16:41:52 +0000 (16:41 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 22 Jul 2013 16:41:52 +0000 (16:41 +0000)
99 files changed:
.gitattributes
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-commons-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-tests.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT-sources.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT.jar [deleted file]
eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar [new file with mode: 0755]
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesViewPart.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchResultView.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/PolytomousKeyWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmFormElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractFormSection.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/element/TextWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement2.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamOrPersonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferenceEntityDetailElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/RefereneEntityDetailElement.java with 91% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferencedEntityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/NaturalLanguageSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailSection.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/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectionWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationWizardPage.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/GatheringEventDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalReferenceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/ParsingMessagesSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaLevelDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmDataViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/supplementaldata/SupplementalDataViewPart.java

index b8384ce66d4b1816084939a5994c23eb08c52189..0689b0531a2409510d6bcd97b1d2cb387e189d6e 100644 (file)
@@ -148,22 +148,6 @@ eu.etaxonomy.taxeditor.cdmlib/lib/batik-transcoder-1.7.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/batik-util-1.7.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/batik-xml-1.7.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/c3p0-0.9.2.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-commons-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-tests.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT-sources.jar -text
-eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-2.2.2.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/com.springsource.org.aopalliance-1.0.0.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/com.springsource.org.apache.commons.logging-1.1.1.jar -text
@@ -211,6 +195,7 @@ eu.etaxonomy.taxeditor.cdmlib/lib/hsqldb-1.8.0.10.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/httpclient-4.2.3.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/httpcore-4.2.4.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/icu4j-2.6.1.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/itextpdf-5.4.0.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/jackson-core-asl-1.8.8.jar -text
@@ -256,6 +241,8 @@ eu.etaxonomy.taxeditor.cdmlib/lib/odfdom-0.8.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/odfdom-java-0.8.7.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/ognl-2.6.9.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/opencsv-2.3.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar -text
+eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/org.osgi.core-1.0.0.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aop-3.2.2.RELEASE.jar -text
 eu.etaxonomy.taxeditor.cdmlib/lib/org.springframework.aspects-3.2.2.RELEASE.jar -text
@@ -1300,6 +1287,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/Roo
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/SelectionArbitrator.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextActionElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement2.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ToggleableTextElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java -text
@@ -1343,8 +1331,8 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/cla
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailSection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferenceEntityDetailElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferencedEntityDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/RefereneEntityDetailElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DerivedUnitElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescribedSpecimenSection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailElement.java -text
index 0cb8793aa71f6b52258f83b1da9e6972924b5499..9d8630de02850d3b5c639955532155d4a62b292c 100644 (file)
        <classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.2-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.2-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.2-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.3-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.3-SNAPSHOT.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.2.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-commons-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-commons-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index 99c6fb1..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-commons-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index 2e8747c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index c635851..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-ext-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index 0f04548..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index 0dd1865..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-io-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index c3171e8..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index a55b4fc..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index a1bd690..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-tests.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-tests.jar
deleted file mode 100644 (file)
index b621f4d..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT-tests.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index 9922c6c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-persistence-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index 49a4974..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index a8a30c3..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-print-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index 768828c..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index 7d804d9..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-remote-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT-sources.jar
deleted file mode 100644 (file)
index cad99d7..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT-sources.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT.jar
deleted file mode 100644 (file)
index 28bfcae..0000000
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-services-3.2.0-SNAPSHOT.jar and /dev/null differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar
new file mode 100755 (executable)
index 0000000..2ec64a8
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
new file mode 100644 (file)
index 0000000..4cf488e
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
diff --git a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
new file mode 100644 (file)
index 0000000..f131a43
Binary files /dev/null and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index 669c354dc6d268f6a44b04402f8d47f805c64af5..207b5d2f031da8a784189d35170f4b1e942ba22c 100644 (file)
@@ -1,8 +1,8 @@
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -32,6 +32,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
@@ -39,10 +40,10 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 /**
- * 
+ *
  * Generates the tabbed editor with <code>TaxonNameEditor</code> on top and tabs
  * for "Descriptions", "Concepts", "Geography", etc.
- * 
+ *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 15.05.2008
@@ -83,7 +84,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
         */
        /** {@inheritDoc} */
@@ -107,7 +108,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
                        // EditorUtil.showPropertySheet();
 
                } catch (PartInitException e) {
-                       EditorUtil.error(getClass(), e);
+                       AbstractUtility.error(getClass(), e);
                }
        }
 
@@ -121,41 +122,34 @@ public class MultiPageTaxonEditor extends FormEditor implements
                        }
                        monitor.worked(1);
 
-                       for (IEditorPart editorPage : getPages()) {
-                               if (editorPage instanceof TaxonNameEditor) {
-                                       if (((TaxonNameEditor) editorPage).checkForEmptyNames()) {
-                                               MessageDialog
-                                                               .openWarning(
-                                                                               EditorUtil.getShell(),
-                                                                               "No Name Specified",
-                                                                               "An attempt was made to save a taxon or synonym with "
-                                                                                               + "an empty name. Operation was cancelled.");
-                                               return;
-                                       }
-                               }
-
-                               editorPage.doSave(monitor);
-                               monitor.worked(1);
-                       }
+            for (IEditorPart editorPage : getPages()) {
+                if (editorPage instanceof TaxonNameEditor) {
+                    if (((TaxonNameEditor) editorPage).checkForEmptyNames()) {
+                        MessageDialog.openWarning(AbstractUtility.getShell(), "No Name Specified",
+                                "An attempt was made to save a taxon or synonym with "
+                                        + "an empty name. Operation was cancelled.");
+                        return;
+                    }
+                }
+
+                editorPage.doSave(monitor);
+                monitor.worked(1);
+            }
 
                        // commit the conversation and start a new transaction immediately
                        conversation.commit(true);
                        monitor.worked(1);
 
-                       this.setDirty(false);
-                       monitor.worked(1);
-               } catch (Exception e) {
-                       setFocus();
-                       EditorUtil
-                                       .errorDialog(
-                                                       "An error occurred while saving",
-                                                       getClass(),
-                                                       "An error occurred while saving the editor. Please close and reopen the taxon again.",
-                                                       e);
-                       disableEditor(true);
-               } finally {
-                       monitor.done();
-               }
+            this.setDirty(false);
+            monitor.worked(1);
+        } catch (Exception e) {
+            setFocus();
+            AbstractUtility.errorDialog("An error occurred while saving", getClass(),
+                    "An error occurred while saving the editor. Please close and reopen the taxon again.", e);
+            disableEditor(true);
+        } finally {
+            monitor.done();
+        }
        }
 
        private void disableEditor(boolean isOnError) {
@@ -163,7 +157,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
                        if(isOnError){
                                editorPage.setOnError();
                        }else {
-                               editorPage.setDisabled();                               
+                               editorPage.setDisabled();
                        }
                }
                conversation.unregisterForDataStoreChanges(this);
@@ -178,23 +172,24 @@ public class MultiPageTaxonEditor extends FormEditor implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.MultiPageEditorPart#isDirty()
         */
        /**
         * <p>
         * isDirty
         * </p>
-        * 
+        *
         * @return a boolean.
         */
-       public boolean isDirty() {
+       @Override
+    public boolean isDirty() {
                return dirty;
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.forms.editor.FormEditor#editorDirtyStateChanged()
         */
        /** {@inheritDoc} */
@@ -206,7 +201,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
 
        /**
         * {@inheritDoc}
-        * 
+        *
         * Checks whether nested editors are calling
         * <code>firePropertyChange(PROP_DIRTY)</code> to signal an edit has taken
         * place before passing property change along to
@@ -214,10 +209,11 @@ public class MultiPageTaxonEditor extends FormEditor implements
         */
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.MultiPageEditorPart#handlePropertyChange(int)
         */
-       protected void handlePropertyChange(int propertyId) {
+       @Override
+    protected void handlePropertyChange(int propertyId) {
                if (propertyId == PROP_DIRTY) {
                        setDirty(true);
                }
@@ -240,9 +236,10 @@ public class MultiPageTaxonEditor extends FormEditor implements
        public void init(IEditorSite site, IEditorInput input)
                        throws PartInitException {
 
-               if (!(input instanceof TaxonEditorInput))
-                       throw new PartInitException(
+               if (!(input instanceof TaxonEditorInput)) {
+            throw new PartInitException(
                                        "Invalid Input: Must be TaxonEditorInput");
+        }
 
                this.input = (TaxonEditorInput) input;
 
@@ -289,29 +286,29 @@ public class MultiPageTaxonEditor extends FormEditor implements
                setPartName(partName);
        }
 
-       /**
-        * {@inheritDoc}
-        * 
-        * Editor pages call this in their postOperation to notify the
-        * MultiPageTaxonEditor of unsaved changes
-        */
-       public void changed(Object element) {
-               // setDirty(true);
-               dirty = true;
-               super.editorDirtyStateChanged();
-               if (element instanceof TaxonBase) {
-                       TaxonNameEditor page = (TaxonNameEditor) getPage(Page.NAME);
-                       AbstractGroupedContainer container = page
-                                       .getContainer((TaxonBase) element);
-                       if (container != null) {
-                               container.refresh();
-                       }
-               }
-       }
+    /**
+     * {@inheritDoc}
+     *
+     * Editor pages call this in their postOperation to notify the
+     * MultiPageTaxonEditor of unsaved changes
+     */
+    @Override
+    public void changed(Object element) {
+        // setDirty(true);
+        dirty = true;
+        super.editorDirtyStateChanged();
+        if (element instanceof TaxonBase) {
+            TaxonNameEditor page = (TaxonNameEditor) getPage(Page.NAME);
+            AbstractGroupedContainer container = page.getContainer((TaxonBase) element);
+            if (container != null) {
+                container.refresh();
+            }
+        }
+    }
 
        /**
         * The accepted taxon that is the input for this editor
-        * 
+        *
         * @return the accepted taxon
         */
        public Taxon getTaxon() {
@@ -320,7 +317,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
         * ()
@@ -329,11 +326,12 @@ public class MultiPageTaxonEditor extends FormEditor implements
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                return conversation;
        }
 
@@ -341,7 +339,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
         * <p>
         * setConversationHolder
         * </p>
-        * 
+        *
         * @param conversation
         *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *            object.
@@ -354,7 +352,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
         * <p>
         * Getter for the field <code>undoContext</code>.
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.core.commands.operations.IUndoContext}
         *         object.
         */
@@ -366,7 +364,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
         * <p>
         * Setter for the field <code>undoContext</code>.
         * </p>
-        * 
+        *
         * @param undoContext
         *            a {@link org.eclipse.core.commands.operations.IUndoContext}
         *            object.
@@ -385,53 +383,50 @@ public class MultiPageTaxonEditor extends FormEditor implements
                getActiveEditor().setFocus();
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu
-        * .etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
-        */
-       /** {@inheritDoc} */
-       public void update(CdmDataChangeMap events) {
-               if (dataChangeBehavior == null) {
-                       dataChangeBehavior = new MultiPageTaxonEditorDataChangeBehaviour(
-                                       this);
-               }
-
-               DataChangeBridge.handleDataChange(events, dataChangeBehavior);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation
-        * ()
-        */
-       /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
-               setDirty(true);
-
-               for (IEditorPart editor : this.getPages()) {
-                       if (editor instanceof IPostOperationEnabled) {
-                               ((IPostOperationEnabled) editor)
-                                               .postOperation(objectAffectedByOperation);
-                       } else {
-                               EditorUtil.warn(getClass(),
-                                               "postOperation not enabled for editor " + editor);
-                       }
-               }
-               EditorUtil
-                               .warn(getClass(),
-                                               "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
-
-               return false;
-       }
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu
+     * .etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void update(CdmDataChangeMap events) {
+        if (dataChangeBehavior == null) {
+            dataChangeBehavior = new MultiPageTaxonEditorDataChangeBehaviour(this);
+        }
+
+        DataChangeBridge.handleDataChange(events, dataChangeBehavior);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation
+     * ()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
+        setDirty(true);
+
+        for (IEditorPart editor : this.getPages()) {
+            if (editor instanceof IPostOperationEnabled) {
+                ((IPostOperationEnabled) editor).postOperation(objectAffectedByOperation);
+            } else {
+                AbstractUtility.warn(getClass(), "postOperation not enabled for editor " + editor);
+            }
+        }
+        AbstractUtility.warn(getClass(), "postOperation called on MultiPageTaxonEditor. Can you make it more specific?");
+
+        return false;
+    }
 
        /**
         * Returns an <code>IEditorPart</code> implementation by type
-        * 
+        *
         * @param page
         *            the page type
         * @return a {@link eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage}
@@ -449,7 +444,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
        /**
         * Return a list of <code>AbstractTaxonEditor</code>s registered with this
         * <code>MultiPageTaxonEditor</code>.
-        * 
+        *
         * @return a {@link java.util.List} object.
         */
        public List<IMultiPageTaxonEditorPage> getPages() {
@@ -463,7 +458,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
 
        /**
         * Refreshes a certain page of the MultipageTaxonEditor
-        * 
+        *
         * @param page
         *            a {@link eu.etaxonomy.taxeditor.editor.Page} object.
         * @return a boolean.
@@ -475,7 +470,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
        /**
         * Refreshes a certain page of the MultipageTaxonEditor and sets focus to
         * that page
-        * 
+        *
         * @param page
         *            a {@link eu.etaxonomy.taxeditor.editor.Page} object.
         * @param focus
@@ -491,46 +486,42 @@ public class MultiPageTaxonEditor extends FormEditor implements
         * <p>
         * onComplete
         * </p>
-        * 
+        *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                return false;
        }
 
-       /**
-        * Reloads the data for this
-        */
-       public void reload() {
-               if (isDirty()) {
-                       EditorUtil
-                                       .warningDialog(
-                                                       "Editor has unsaved data",
-                                                       getClass(),
-                                                       "This editor can not be "
-                                                                       + "refreshed because it contains unsaved data. Refreshing "
-                                                                       + "this editor would discard the changes. Please save this editor, "
-                                                                       + "close and reopen it manually in order to get the latest content");
-               } else {
-                       TaxonEditorInput input = (TaxonEditorInput) getEditorInput();
-
-                       UUID uuid = input.getTaxonNode().getUuid();
-
-                       conversation.clear();
-
-                       try {
-                               TaxonEditorInput newInput = TaxonEditorInput.NewInstance(uuid);
-                               setInput(newInput);
-                               for (IMultiPageTaxonEditorPage editorPart : getPages()) {
-                                       editorPart.redraw();
-                               }
-                       } catch (Exception e) {
-                               EditorUtil.errorDialog("Error refreshing editor", getClass(),
-                                               "Could not refresh this editor", e);
-                       }
-               }
-       }
-       
+    /**
+     * Reloads the data for this
+     */
+    public void reload() {
+        if (isDirty()) {
+            AbstractUtility.warningDialog("Editor has unsaved data", getClass(), "This editor can not be "
+                    + "refreshed because it contains unsaved data. Refreshing "
+                    + "this editor would discard the changes. Please save this editor, "
+                    + "close and reopen it manually in order to get the latest content");
+        } else {
+            TaxonEditorInput input = (TaxonEditorInput) getEditorInput();
+
+            UUID uuid = input.getTaxonNode().getUuid();
+
+            conversation.clear();
+
+            try {
+                TaxonEditorInput newInput = TaxonEditorInput.NewInstance(uuid);
+                setInput(newInput);
+                for (IMultiPageTaxonEditorPage editorPart : getPages()) {
+                    editorPart.redraw();
+                }
+            } catch (Exception e) {
+                AbstractUtility.errorDialog("Error refreshing editor", getClass(), "Could not refresh this editor", e);
+            }
+        }
+    }
+
        @Override
        public String toString() {
                return String.format("%s[%s]", this.getClass().getSimpleName(), getEditorInput());
index 16fa9b076ea3bc843909a9bc6a3dad2a863bf0e2..403a6b25c51b5d1b156a5d3df6d5570e1d22bf8d 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
  * Copyright (C) 2011 EDIT\r
- * European Distributed Institute of Taxonomy \r
+ * European Distributed Institute of Taxonomy\r
  * http://www.e-taxonomy.eu\r
- * \r
+ *\r
  * The contents of this file are subject to the Mozilla Public License Version 1.1\r
  * See LICENSE.TXT at the top of this package for the full license terms.\r
  */\r
@@ -19,58 +19,56 @@ import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragList
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;\r
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer;\r
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;\r
-import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;\r
-import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;\r
 \r
 \r
 /**\r
- * The Class create a speific Use View to keep the taxonomic view clean\r
- * @author a.theys     \r
+ * The Class create a specific Use View to keep the taxonomic view clean\r
+ * @author a.theys\r
  * @created mar 13, 2012\r
  * @version 1.0\r
  */\r
-public class UsesViewPart extends DescriptiveViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {\r
+public class UsesViewPart extends DescriptiveViewPart {\r
 \r
        /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.uses"</code> */\r
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.uses";\r
        /** {@inheritDoc} */\r
        @Override\r
        public void createViewer(Composite parent) {\r
-               \r
+\r
                viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL\r
                                | SWT.V_SCROLL | SWT.FULL_SELECTION));\r
                viewer.setContentProvider(new UsesContentProvider(featureNodeContainerCache));\r
                viewer.setLabelProvider(new UsesLabelProvider());\r
                viewer.setAutoExpandLevel(2);\r
-               \r
-               \r
-               \r
+\r
+\r
+\r
                Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };\r
                viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(\r
                                this));\r
                viewer.addDropSupport(dndOperations, transfers,\r
                                new DescriptionElementDropAdapter(viewer));\r
-                                               \r
+\r
                // Propagate selection from viewer\r
                getSite().setSelectionProvider(viewer);\r
-               \r
-               showAllElementsAction = new ToggleDescriptionAction(false);             \r
+\r
+               showAllElementsAction = new ToggleDescriptionAction(false);\r
                hideAllElementsAction = new ToggleDescriptionAction(true);\r
-               \r
+\r
                // Add context menu to tree\r
                createMenu();\r
-               \r
+\r
                createToolbar();\r
 \r
        }\r
-       \r
+\r
        /** {@inheritDoc} */\r
        @Override\r
        public boolean postOperation(CdmBase objectAffectedByOperation) {\r
                viewer.refresh();\r
                return super.postOperation(objectAffectedByOperation);\r
        }\r
-       \r
+\r
 \r
 \r
 }\r
index 5925be91e873ab2ed6bc4acddf15898b199cac96..9fdb66b7acb266a0dcae034a2c7766d74e3b7150 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -37,7 +37,6 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.OpenEditorConfiguration;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -53,36 +52,36 @@ import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
  */
 public class NavigationUtil extends AbstractUtility{
        private static IUndoContext defaultUndoContext;
-               
+
        /**
         * <p>executeEditHandler</p>
         */
        public static void executeEditHandler(){
 
                String commandId = "eu.etaxonomy.taxeditor.navigation.command.editSelection";
-               
-               IHandlerService handlerService = (IHandlerService) NavigationUtil.getService(IHandlerService.class); 
+
+               IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
                try {
                        handlerService.executeCommand(commandId, null);
                } catch (ExecutionException e) {
-                       NavigationUtil.error(NavigationUtil.class, e);
+                       AbstractUtility.error(NavigationUtil.class, e);
                } catch (NotDefinedException e) {
-                       NavigationUtil.error(NavigationUtil.class, e);
+                       AbstractUtility.error(NavigationUtil.class, e);
                } catch (NotEnabledException e) {
-                       NavigationUtil.error(NavigationUtil.class, e);
+                       AbstractUtility.error(NavigationUtil.class, e);
                } catch (NotHandledException e) {
-                       NavigationUtil.error(NavigationUtil.class, e);
+                       AbstractUtility.error(NavigationUtil.class, e);
                }
        }
-       
+
        /**
         * <p>openEditor</p>
         *
         * @param selectedObject a {@link eu.etaxonomy.cdm.model.common.CdmBase} object.
         */
        public static void openEditor(ICdmBase selectedObject){
-               UUID entityUuid = selectedObject.getUuid();     
-               try {   
+               UUID entityUuid = selectedObject.getUuid();
+               try {
                        if(selectedObject instanceof TaxonNode){
                                EditorUtil.openTaxonNode(entityUuid);
                        }else if(selectedObject instanceof TaxonBase){
@@ -96,12 +95,12 @@ public class NavigationUtil extends AbstractUtility{
                                warningDialog("Unsupported Type", NavigationUtil.class, "No editor exists for the current selection: " + selectedObject);
                        }
                } catch (PartInitException e) {
-                       NavigationUtil.error(NavigationUtil.class, "Error opening the editor", e);
+                       AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
                } catch (Exception e) {
-                       EditorUtil.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
+                       AbstractUtility.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
                }
        }
-       
+
        public static void openEditor(Object selectedObject){
                if (selectedObject instanceof UuidAndTitleCache){
                        Class type = ((UuidAndTitleCache) selectedObject).getType();
@@ -109,16 +108,16 @@ public class NavigationUtil extends AbstractUtility{
                                try {
                                        EditorUtil.openTaxonBase(((UuidAndTitleCache) selectedObject).getUuid());
                                } catch (PartInitException e) {
-                                       NavigationUtil.error(NavigationUtil.class, "Error opening the editor", e);
+                                       AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
                                }
                        }
                }else if(selectedObject instanceof ICdmBase){
-                       openEditor((ICdmBase) selectedObject); 
+                       openEditor((ICdmBase) selectedObject);
                }else{
-                       NavigationUtil.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
+                       AbstractUtility.error(NavigationUtil.class, new IllegalArgumentException("Selected object is not supported: " + selectedObject));
                }
        }
-       
+
        /**
         * <p>openEmpty</p>
         *
@@ -128,10 +127,10 @@ public class NavigationUtil extends AbstractUtility{
                try {
                        EditorUtil.openEmpty(parentNodeUuid);
                } catch (PartInitException e) {
-                       NavigationUtil.error(NavigationUtil.class, "Error opening the editor", e);
+                       AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
                }
        }
-       
+
        /**
         * <p>getShell</p>
         *
@@ -150,7 +149,7 @@ public class NavigationUtil extends AbstractUtility{
                return TaxeditorNavigationPlugin.getDefault().getWorkbench().
                                getActiveWorkbenchWindow();
        }
-       
+
        /**
         * <p>getWorkbenchUndoContext</p>
         *
@@ -169,10 +168,10 @@ public class NavigationUtil extends AbstractUtility{
        public static IUndoContext getUndoContext() {
                // FIXME this has to be more specific. Every widget has to have its own undo context
 //             return IOperationHistory.GLOBAL_UNDO_CONTEXT;
-               
-               // Plug-ins that wish their operations to be undoable from workbench views 
-               // such as the Navigator or Package Explorer should assign the workbench 
-               // undo context to their operations. 
+
+               // Plug-ins that wish their operations to be undoable from workbench views
+               // such as the Navigator or Package Explorer should assign the workbench
+               // undo context to their operations.
                if (defaultUndoContext == null) {
                        defaultUndoContext = new UndoContext();
                }
@@ -186,9 +185,9 @@ public class NavigationUtil extends AbstractUtility{
         * @return a boolean.
         */
        public static boolean isDirty(TaxonNode taxonNode){
-               
+
                for (IEditorReference reference : getActivePage().getEditorReferences()) {
-                       
+
                        try {
                                if (reference.getEditorInput() instanceof TaxonEditorInput) {
                                        TaxonEditorInput editorInput = (TaxonEditorInput) reference.getEditorInput();
@@ -197,10 +196,10 @@ public class NavigationUtil extends AbstractUtility{
                                        }
                                }
                        } catch (PartInitException e) {
-                               NavigationUtil.error(NavigationUtil.class, e.getMessage(), e);
+                               AbstractUtility.error(NavigationUtil.class, e.getMessage(), e);
                                throw new RuntimeException(e);
                        }
-                       
+
                }
                return false;
        }
@@ -214,7 +213,8 @@ public class NavigationUtil extends AbstractUtility{
        public static void selectInNavigator(final Object element, final Object parentElement) {
                Display.getDefault().asyncExec(new Runnable(){
 
-                       public void run() {
+                       @Override
+            public void run() {
                                TaxonNavigator navigator = showNavigator();
 
                                if (navigator != null) {
@@ -223,11 +223,11 @@ public class NavigationUtil extends AbstractUtility{
                                                if (parentElement != null) {
                                                        viewer.setExpandedState(parentElement, true);
                                                }
-                                               viewer.setSelection(new StructuredSelection((TaxonNode) element));
+                                               viewer.setSelection(new StructuredSelection(element));
                                        }
                                }
                        }
-                       
+
                });
        }
 
@@ -239,18 +239,18 @@ public class NavigationUtil extends AbstractUtility{
        public static void openSearch(Object selection) {
                if(selection instanceof Taxon){
                        Taxon taxon = (Taxon) selection;
-                       
+
                        handleOpeningOfMultipleTaxonNodes(taxon.getTaxonNodes());
-                       
+
                }else if(selection instanceof Synonym){
                        Synonym synonym = (Synonym) selection;
-                       
+
                        handleOpeningOfMultipleTaxa(synonym.getAcceptedTaxa());
-                       
+
                }else{
                        warningDialog("Not implemented yet", NavigationUtil.class, "You chose to open a name that has no connection to a taxon. The Editor does not support editing of such a content type at the moment.");
                }
-               
+
        }
 
        private static void handleOpeningOfMultipleTaxa(Set<Taxon> acceptedTaxa) {
@@ -271,7 +271,7 @@ public class NavigationUtil extends AbstractUtility{
         */
        private static void handleOpeningOfMultipleTaxonNodes(
                        Set<TaxonNode> taxonNodes) {
-               
+
                if(taxonNodes.size() == 1){
                        openEditor(taxonNodes.iterator().next());
                }else if(taxonNodes.size() > 1){
index 7b9adddc422827062b0f7975877e64f1a6911674..94aeb170bc0fcd422e46a774376fd25927bc9c0f 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -18,8 +18,6 @@ import java.util.Observer;
 import java.util.Set;
 import java.util.UUID;
 
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -27,8 +25,6 @@ import org.eclipse.jface.viewers.TreePath;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.navigator.CommonNavigator;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -45,7 +41,7 @@ import eu.etaxonomy.taxeditor.store.LoginManager;
 
 /**
  * Taxonomic tree implementation using Common Navigator Framework.
- * 
+ *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 02.06.2009
@@ -60,12 +56,6 @@ public class TaxonNavigator extends CommonNavigator implements
         */
        public static final String ID = "eu.etaxonomy.taxeditor.navigation.navigator"; //$NON-NLS-1$
 
-       /**
-        * Constant
-        * <code>OPEN_COMMAND_ID="eu.etaxonomy.taxeditor.navigation.comma"{trunked}</code>
-        */
-       public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.navigation.command.editSelection";
-
        private static final String TREE_PATH = "treepath";
 
        private static final String TREE_PATHS = "treepaths";
@@ -78,7 +68,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.navigator.CommonNavigator#getInitialInput()
         */
        /** {@inheritDoc} */
@@ -120,7 +110,7 @@ public class TaxonNavigator extends CommonNavigator implements
         */
        public void refresh() {
                if(getConversationHolder() != null){
-                       getConversationHolder().bind();                 
+                       getConversationHolder().bind();
                }
                getCommonViewer().refresh();
        }
@@ -136,7 +126,7 @@ public class TaxonNavigator extends CommonNavigator implements
         * <p>
         * restore
         * </p>
-        * 
+        *
         * @param memento
         *            a {@link org.eclipse.ui.IMemento} object.
         * @param monitor
@@ -203,8 +193,9 @@ public class TaxonNavigator extends CommonNavigator implements
 
                List<CdmBase> pathList = new ArrayList<CdmBase>();
 
-               if (string.length() == 0)
-                       return null;
+               if (string.length() == 0) {
+            return null;
+        }
 
                for (String uuid : string.split(" ")) {
                        CdmBase cdmBaseObject = CdmStore.getService(
@@ -216,8 +207,9 @@ public class TaxonNavigator extends CommonNavigator implements
                                                IClassificationService.class).load(
                                                UUID.fromString(uuid));
 
-                               if (cdmBaseObject == null)
-                                       return null;
+                               if (cdmBaseObject == null) {
+                    return null;
+                }
                        }
                        pathList.add(cdmBaseObject);
                }
@@ -234,7 +226,7 @@ public class TaxonNavigator extends CommonNavigator implements
         * <p>
         * saveTreeState
         * </p>
-        * 
+        *
         * @param memento
         *            a {@link org.eclipse.ui.IMemento} object.
         * @param progressMonitor
@@ -274,7 +266,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
         * ()
@@ -283,7 +275,7 @@ public class TaxonNavigator extends CommonNavigator implements
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
@@ -294,7 +286,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
         * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
@@ -320,7 +312,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.WorkbenchPart#dispose()
         */
        /** {@inheritDoc} */
@@ -335,7 +327,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.navigator.CommonNavigator#setFocus()
         */
        /** {@inheritDoc} */
@@ -350,7 +342,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation
         * (eu.etaxonomy.cdm.model.common.CdmBase)
@@ -366,7 +358,7 @@ public class TaxonNavigator extends CommonNavigator implements
         * <p>
         * save
         * </p>
-        * 
+        *
         * @param memento
         *            a {@link org.eclipse.ui.IMemento} object.
         * @param monitor
@@ -383,26 +375,7 @@ public class TaxonNavigator extends CommonNavigator implements
        /** {@inheritDoc} */
        @Override
        protected void handleDoubleClick(DoubleClickEvent anEvent) {
-
-               ICommandService commandService = (ICommandService) getSite()
-                               .getService(ICommandService.class);
-
-               Command command = commandService.getCommand(OPEN_COMMAND_ID);
-               if (command.isEnabled()) {
-                       IHandlerService handlerService = (IHandlerService) getSite()
-                                       .getService(IHandlerService.class);
-                       try {
-                               handlerService.executeCommand(OPEN_COMMAND_ID, null);
-                       } catch (NotDefinedException e) {
-                               throw new RuntimeException("Could not find open command: "
-                                               + OPEN_COMMAND_ID);
-                       } catch (Exception e) {
-                               NavigationUtil
-                                               .error(getClass(),
-                                                               "An exception occured while trying to open a selection",
-                                                               e);
-                       }
-               }
+               NavigationUtil.executeEditHandler();
                // If the double click is passed up to the super-class it will
                // expand/collapse trees.
                // We do not want that
@@ -413,7 +386,7 @@ public class TaxonNavigator extends CommonNavigator implements
         * <p>
         * onComplete
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        @Override
@@ -423,7 +396,7 @@ public class TaxonNavigator extends CommonNavigator implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
         */
        /** {@inheritDoc} */
@@ -450,6 +423,6 @@ public class TaxonNavigator extends CommonNavigator implements
                if(o instanceof LoginManager){
                        refresh();
                }
-               
+
        }
 }
index 4415ee1d167c387ab1cfd7ca4ca28a04f5a149f1..917f5f40d7e0f3dcbe9b2a77e193f320be22c93e 100644 (file)
@@ -2,9 +2,9 @@ package eu.etaxonomy.taxeditor.navigation.navigator.handler;
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -41,47 +41,49 @@ public class EditHandler extends AbstractHandler implements IHandler{
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-       
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
                ISelection selection = HandlerUtil.getCurrentSelection(event);
-               
+
                if(selection instanceof StructuredSelection){
                        final StructuredSelection structuredSelection = (StructuredSelection) selection;
-                       
+
                        if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof Classification){
                                Classification classification = (Classification) structuredSelection.getFirstElement();
-                               
+
                                NewClassificationWizard classificationWizard = new NewClassificationWizard();
                                classificationWizard.init(null, null);
                                classificationWizard.setEntity(classification);
                                WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), classificationWizard);
                                dialog.open();
-                               
+
                        }
                        else{
 
                                Job job = new Job("Opening editor") {
-                                       
+
                                        @Override
                                        protected IStatus run(IProgressMonitor monitor) {
                                                for(final Object selectedObject : structuredSelection.toArray()){
-                                                       
+
                                                        Display.getDefault().asyncExec(new Runnable(){
-       
-                                                               public void run() {
+
+                                                               @Override
+                                public void run() {
                                                                        NavigationUtil.openEditor(selectedObject);
                                                                }
-                                                               
+
                                                        });
                                                }
                                                return Status.OK_STATUS;
                                        }
                                };
-                               
+
                                job.schedule();
                        }
                }
-               
+
                return null;
        }
 }
index d5984d1c502772217fe194b37d1946fd86e92bc3..905e4b847568bf7edc58557f9681f3cfd6f07284 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -41,6 +41,7 @@ import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
@@ -56,9 +57,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public class SearchResultView extends ViewPart implements IConversationEnabled{
-       
+
        private static Object[] EMPTY = new Object[0];
-       
+
        private class ContextListener extends ContextListenerAdapter{
                /* (non-Javadoc)
                 * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
@@ -66,12 +67,12 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Getting rid of search results");
-                       NavigationUtil.hideView(SearchResultView.this);
+                       AbstractUtility.hideView(SearchResultView.this);
                }
        }
-       
+
        /** Constant <code>ID="eu.etaxonomy.taxeditor.navigation.searc"{trunked}</code> */
-       public static final String ID = 
+       public static final String ID =
                        "eu.etaxonomy.taxeditor.navigation.search.searchResultView"; //$NON-NLS-1$
 
        private TableViewer resultViewer;
@@ -85,42 +86,43 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
        private Text status;
 
        private SearchJob searchJob;
-       
+
        private IContextListener contextListener;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
         */
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
-               
+
                conversation = CdmStore.createConversation();
                contextListener = new ContextListener();
                CdmStore.getContextManager().addContextListener(contextListener);
-               
+
                GridLayout layout = new GridLayout();
                layout.marginWidth = 0;
                layout.marginHeight = 0;
-               
+
                parent.setLayout(layout);
-               
+
                Composite infoComposite = createInfoComposite(parent);
                infoComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               
+
                resultViewer = new TableViewer(parent, SWT.NONE);
                resultViewer.setContentProvider(new ArrayContentProvider());
                resultViewer.setLabelProvider(new SearchResultLabelProvider());
                resultViewer.addDoubleClickListener(new IDoubleClickListener() {
-                       public void doubleClick(DoubleClickEvent event) {
+                       @Override
+            public void doubleClick(DoubleClickEvent event) {
                                NavigationUtil.executeEditHandler();
                        }
                });
-               
+
                resultViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               
+
                getSite().setSelectionProvider(resultViewer);
-               
+
                // register context menu
                MenuManager menuMgr = new MenuManager();
                menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
@@ -128,39 +130,39 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
 
                Control control = resultViewer.getControl();
                Menu menu = menuMgr.createContextMenu(control);
-               control.setMenu(menu);  
+               control.setMenu(menu);
        }
-       
+
        private Composite createInfoComposite(Composite parent){
                Composite composite = new Composite(parent, SWT.NULL);
-               
+
                composite.setLayout(new GridLayout(2, false));
-               
+
                Label searchStringLabel = new Label(composite, SWT.NULL);
                searchStringLabel.setText("Search String:");
-               
+
                searchString = new Text(composite, SWT.NULL);
                searchString.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                searchString.setEditable(false);
 //             searchString.setText("                                               ");
-               
+
                Label configurationDescriptionLabel = new Label(composite, SWT.NULL);
                configurationDescriptionLabel.setText("Search for:");
-               
+
                configurationLabel = new Text(composite, SWT.WRAP);
                configurationLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                configurationLabel.setEditable(false);
-               
+
                Label statusLabel = new Label(composite, SWT.NULL);
                statusLabel.setText("Status:");
-               
+
                status = new Text(composite, SWT.NULL);
                status.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                status.setEditable(false);
-               
+
                return composite;
        }
-       
+
        /**
         * <p>performSearch</p>
         *
@@ -168,20 +170,23 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
         */
        public void performSearch(IFindTaxaAndNamesConfigurator configurator){
                setPartName("Search: '" + configurator.getTitleSearchString() + "'");
-               
+
                searchString.setText(configurator.getTitleSearchString());
-               
+
                List<String> includedEntities = new ArrayList<String>();
-               if(configurator.isDoTaxa())
-                       includedEntities.add(SearchOption.TAXON.getLabel());
-               if(configurator.isDoSynonyms())
-                       includedEntities.add(SearchOption.SYNONYM.getLabel());
-               if(configurator.isDoNamesWithoutTaxa())
-                       includedEntities.add(SearchOption.NAME.getLabel());
+               if(configurator.isDoTaxa()) {
+            includedEntities.add(SearchOption.TAXON.getLabel());
+        }
+               if(configurator.isDoSynonyms()) {
+            includedEntities.add(SearchOption.SYNONYM.getLabel());
+        }
+               if(configurator.isDoNamesWithoutTaxa()) {
+            includedEntities.add(SearchOption.NAME.getLabel());
+        }
                if(configurator.isDoTaxaByCommonNames()){
                        includedEntities.add(SearchOption.COMMON_NAME.getLabel());
                }
-               
+
                String includedEntitiesString = "";
                for (int i = 0; i < includedEntities.size(); i++){
                        includedEntitiesString += includedEntities.get(i);
@@ -189,16 +194,16 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                                includedEntitiesString += ", ";
                        }
                }
-               
+
                configurationLabel.setText(includedEntitiesString);
-               
+
                status.setText("Searching...");
-               
+
                searchJob = new SearchJob(Display.getCurrent(), configurator);
                searchJob.schedule();
-               
+
        }
-       
+
        /**
         * <p>displaySearchResult</p>
         *
@@ -206,10 +211,10 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
         */
        protected void displaySearchResult(List<UuidAndTitleCache<TaxonBase>> result) {
                if(result.size() > 0){
-                       resultViewer.setInput(result); 
+                       resultViewer.setInput(result);
                        status.setText(result.size() + " entities found");
                }else{
-                       resultViewer.setInput(EMPTY); 
+                       resultViewer.setInput(EMPTY);
                        status.setText("Search returned no results");
                }
        }
@@ -234,7 +239,8 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
         *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                return this.conversation;
        }
 
@@ -242,11 +248,12 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
         * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
         */
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {
                // TODO Auto-generated method stub
-               
+
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.WorkbenchPart#dispose()
         */
@@ -255,23 +262,24 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
        public void dispose() {
                super.dispose();
                conversation.close();
-               if(searchJob != null)
-                       searchJob.cancel();
+               if(searchJob != null) {
+            searchJob.cancel();
+        }
                CdmStore.getContextManager().removeContextListener(contextListener);
        }
-       
+
        /**
-        * 
+        *
         * @author n.hoffmann
         * @created Feb 2, 2010
         * @version 1.0
         */
        class SearchJob extends Job{
 
-               private IFindTaxaAndNamesConfigurator configurator;
-               
-               private Display display;
-               
+               private final IFindTaxaAndNamesConfigurator configurator;
+
+               private final Display display;
+
                /**
                 * @param name
                 */
@@ -288,19 +296,21 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                protected IStatus run(IProgressMonitor monitor) {
                        monitor.beginTask("", 100);
                        monitor.worked(20);
-                       
+
                        final List<UuidAndTitleCache<TaxonBase>> searchResult = CdmStore.getSearchManager().findTaxaAndNames(configurator);
                        monitor.worked(40);
-                       
+
                        if(! monitor.isCanceled()){
                                display.asyncExec(new Runnable() {
-                                       public void run() {
+                                       @Override
+                    public void run() {
                                                displaySearchResult(searchResult);
                                        }
                                });
                        }else{
                                display.asyncExec(new Runnable() {
-                                       public void run() {
+                                       @Override
+                    public void run() {
                                                status.setText("Cancelled");
                                        }
                                });
@@ -308,6 +318,6 @@ public class SearchResultView extends ViewPart implements IConversationEnabled{
                        monitor.done();
                        return Status.OK_STATUS;
                }
-               
-       }       
+
+       }
 }
index 7738eed49fceb57a5cbb0d1b7558de2995341e13..c4248413cede4919ff5940f006c0588161632b9d 100644 (file)
@@ -1,16 +1,13 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailElement;
 
@@ -27,12 +24,12 @@ public class PolytomousKeyWizardPage extends AbstractCdmEntityWizardPage<Polytom
 
        @Override
        public AbstractCdmDetailElement createElement(ICdmFormElement rootElement) {
-               PolytomousKeyDetailElement element = (PolytomousKeyDetailElement) formFactory.createCdmDetailElement(DetailType.POLYTOMOUS_KEY, rootElement, SWT.NULL);
+               PolytomousKeyDetailElement element = formFactory.createPolytomousKeyDetailElement(rootElement);
                element.setEntity(entity);
                setPageComplete(true);
                return element;
        }
-       
+
        public String getPolytomousKeyName() {
            return ((PolytomousKeyDetailElement) getDetailElement()).getText();
        }
index c0d3ca65a0ea018e0763d8d7d9556e4325662261..6d71b98a8ec2ebf6df372fe70029f773b650470f 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.element;
 
@@ -16,7 +16,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.widgets.Section;
 
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 /**
  * <p>Abstract AbstractCdmFormElement class.</p>
@@ -24,22 +24,22 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @author n.hoffmann
  * @version $Id: $
  */
-public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter, ICdmFormElement {
+public abstract class AbstractCdmFormElement implements ICdmFormElement {
 
        protected CdmFormFactory formFactory;
 
        private List<IPropertyChangeListener> propertyChangeListeners;
 
        private Composite layoutComposite;
-       
-       private Set<Control> controls = new HashSet<Control>();
-       
-       private Set<ICdmFormElement> elements = new HashSet<ICdmFormElement>();
+
+       private final Set<Control> controls = new HashSet<Control>();
+
+       private final Set<ICdmFormElement> elements = new HashSet<ICdmFormElement>();
        private ICdmFormElement parentElement;
 
        private Color persistentBackgroundColor;
-       
-       
+
+
        /**
         * <p>Constructor for AbstractCdmFormElement.</p>
         *
@@ -50,7 +50,7 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                this.layoutComposite = layoutComposite;
                this.formFactory = formFactory;
        }
-       
+
        /**
         * <p>Constructor for AbstractCdmFormElement.</p>
         *
@@ -62,7 +62,7 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                this.parentElement = formElement;
 //             addControl(layoutComposite);
        }
-       
+
        /**
         * <p>Getter for the field <code>formFactory</code>.</p>
         *
@@ -71,23 +71,24 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
        public CdmFormFactory getFormFactory() {
                return formFactory;
        }
-       
+
        /**
         * Delegates the focus to <code>this</code> elements main input control
         */
        public void setFocus(){
-               // Override in subclasses where needed 
+               // Override in subclasses where needed
        }
-       
+
        /**
         * Returns all Controls that are managed by this element
         *
         * @return a {@link java.util.Set} object.
         */
-       public Set<Control> getControls(){
+       @Override
+    public Set<Control> getControls(){
                return controls;
        }
-       
+
        /**
         * adds the control to the set of controls that are managed by this element
         *
@@ -96,7 +97,7 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
        protected void addControl(Control child){
                controls.add(child);
        }
-       
+
        /**
         * <p>removeControl</p>
         *
@@ -105,30 +106,33 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
        protected void removeControl(Control child){
                controls.remove(child);
        }
-       
+
        /**
         * <p>Getter for the field <code>elements</code>.</p>
         *
         * @return a {@link java.util.Set} object.
         */
-       public Set<ICdmFormElement> getElements(){
+       @Override
+    public Set<ICdmFormElement> getElements(){
                return elements;
        }
-       
+
        /**
         * <p>Getter for the field <code>parentElement</code>.</p>
         *
         * @return a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
         */
-       public ICdmFormElement getParentElement(){
+       @Override
+    public ICdmFormElement getParentElement(){
                return parentElement;
        }
-       
+
        /** {@inheritDoc} */
-       public void addElement(ICdmFormElement element){
+       @Override
+    public void addElement(ICdmFormElement element){
                elements.add(element);
        }
-       
+
        /**
         * <p>removeElement</p>
         *
@@ -137,15 +141,16 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
        protected void removeElement(ICdmFormElement element){
                elements.remove(element);
        }
-       
+
        /**
         * <p>removeElements</p>
         */
-       public void removeElements(){
+       @Override
+    public void removeElements(){
                for(ICdmFormElement childElement : getElements()){
                        // recursion
                        childElement.removeElements();
-                       
+
                        // unregister selection arbitrator
                        if(childElement instanceof ISelectableElement){
                                SelectionArbitrator selectionArbitrator = ((ISelectableElement) childElement).getSelectionArbitrator();
@@ -153,19 +158,17 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                                        formFactory.destroySelectionArbitrator(selectionArbitrator);
                                }
                        }
-                       
+
                        // unregister from property changes
-                       if(childElement instanceof IPropertyChangeListener){
-                               formFactory.removePropertyChangeListener((IPropertyChangeListener) childElement); 
-                       }
-                       
+                       formFactory.removePropertyChangeListener(childElement);
+
                        // dispose of the controls
                        removeControls(childElement);
                }
                removeControls(this);
                elements.clear();
        }
-       
+
        private void removeControls(ICdmFormElement element){
                if(element instanceof Section){
                        ((Section) element).dispose();
@@ -183,16 +186,17 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                        }
                }
        }
-       
+
        /**
         * <p>Getter for the field <code>layoutComposite</code>.</p>
         *
         * @return a {@link org.eclipse.swt.widgets.Composite} object.
         */
-       public Composite getLayoutComposite() {
+       @Override
+    public Composite getLayoutComposite() {
                return layoutComposite;
        }
-       
+
        /**
         * <p>Setter for the field <code>layoutComposite</code>.</p>
         *
@@ -201,7 +205,7 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
        public void setLayoutComposite(Composite layoutComposite){
                this.layoutComposite = layoutComposite;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.ICdmFormComposite#getPropertyChangeListeners()
         */
@@ -210,18 +214,20 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
         *
         * @return a {@link java.util.Set} object.
         */
-       public List<IPropertyChangeListener> getPropertyChangeListeners() {
+       @Override
+    public List<IPropertyChangeListener> getPropertyChangeListeners() {
                return propertyChangeListeners;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.ICdmFormComposite#setPropertyChangeListeners(org.eclipse.core.runtime.ListenerList)
         */
        /** {@inheritDoc} */
-       public void setPropertyChangeListeners(List<IPropertyChangeListener> propertyChangeListeners){
+       @Override
+    public void setPropertyChangeListeners(List<IPropertyChangeListener> propertyChangeListeners){
                this.propertyChangeListeners = propertyChangeListeners;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.IPropertyChangeEmitter#firePropertyChangeEvent()
         */
@@ -229,7 +235,8 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
         * @see eu.etaxonomy.taxeditor.forms.ICdmFormComposite#firePropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent)
         */
        /** {@inheritDoc} */
-       public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
+       @Override
+    public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
                Assert.isNotNull(propertyChangeListeners, "Property change listeners are not present");
 
                try{
@@ -237,34 +244,34 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                                ((IPropertyChangeListener)listener).propertyChange(event);
                        }
                }catch(ConcurrentModificationException e){
-                       // There are two cases that produce a CME. 
+                       // There are two cases that produce a CME.
                        // Described here: http://dev.e-taxonomy.eu/trac/ticket/2363#comment:2
                        // and here: http://dev.e-taxonomy.eu/trac/ticket/2438
                        // Ignoring the CME because nothing bad is happening
-                       StoreUtil.warn(getClass(), "ConcurrentModificationException. Can be ignored.");
+                       AbstractUtility.warn(getClass(), "ConcurrentModificationException. Can be ignored.");
                }
        }
-       
+
        /**
         * Fires a {@link CdmPropertyChangeEvent} with the given object as source.
-        *  
+        *
         * @param object the object on which the property changed
         */
        public void firePropertyChangeEvent(Object object){
                firePropertyChangeEvent(object, null);
        }
-       
+
        /**
         * Fires a {@link CdmPropertyChangeEvent} with the given object as source also containing the
         * originating event
-        * 
+        *
         * @param object the object on which the property changed
         * @param originatingEvent the originating event
         */
        public void firePropertyChangeEvent(Object object, PropertyChangeEvent originatingEvent){
                firePropertyChangeEvent(new CdmPropertyChangeEvent(object, originatingEvent));
        }
-       
+
 
        /**
         * {@inheritDoc}
@@ -275,12 +282,14 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
         * Implementations should also check for null PropertyChangeEvents and return immediately in that case.
         * @see eu.etaxonomy.taxeditor.ui.element.ICdmFormElement#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
         */
-       public void propertyChange(PropertyChangeEvent event) {
+       @Override
+    public void propertyChange(PropertyChangeEvent event) {
                // implement in subclasses
        }
-       
+
        /** {@inheritDoc} */
-       public boolean containsFormElement(ICdmFormElement formElement){
+       @Override
+    public boolean containsFormElement(ICdmFormElement formElement){
                if(formElement == this){
                        return true;
                }else{
@@ -293,7 +302,7 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                        return false;
                }
        }
-       
+
        /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.ICdmFormElement#refresh()
@@ -301,10 +310,11 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
        /**
         * <p>refresh</p>
         */
-       public void refresh() {
-               // empty default implementation 
+       @Override
+    public void refresh() {
+               // empty default implementation
        }
-       
+
 
        /** {@inheritDoc} */
        @Override
@@ -313,19 +323,19 @@ public abstract class AbstractCdmFormElement implements IPropertyChangeEmitter,
                        element.setBackground(color);
                }
        }
-       
+
        @Override
        public void setPersistentBackground(Color color) {
                persistentBackgroundColor = color;
                setBackground(color);
        }
-       
+
        @Override
        public Color getPersistentBackground() {
                return persistentBackgroundColor;
        }
-       
+
        public Color getColor(String colorId){
-               return StoreUtil.getColor(colorId);
+               return AbstractUtility.getColor(colorId);
        }
 }
index b245498e9ee82efbc0cfc3d715f0b7903c953434..cece9928bba24c05f590518a3603b11d2651c766 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.element;
 
@@ -33,27 +33,31 @@ import org.eclipse.ui.forms.widgets.ToggleHyperlink;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 /**
  * <p>
- * Abstract AbstractFormSection class.
+ * Abstract super class for a {@link Section} GUI element that visualizes a CDM
+ * entity, manages a conversation and listens to selections
  * </p>
- * 
+ *
+ * @param <ENTITY> A CDM entity which should be visualized by this section.
+ *
  * @author n.hoffmann
  * @created Feb 22, 2010
  * @version 1.0
  * @param <T>
  */
+//TODO shouldn't ENTITY be bound with super class ICdmBase for example (AbstractFormSection<ENTITY extends ICdmBase>)?
 public abstract class AbstractFormSection<ENTITY> extends Section implements
-               ISelectionChangedListener, ICdmFormElement, IEntityElement<ENTITY>,
+               ISelectionChangedListener, IEntityElement<ENTITY>,
                IConversationEnabled {
 
        private ISelectionProvider selectionProvider;
 
        private ENTITY entity;
 
-       private Set<ICdmFormElement> elements = new HashSet<ICdmFormElement>();
+       private final Set<ICdmFormElement> elements = new HashSet<ICdmFormElement>();
 
        protected CdmFormFactory formFactory;
 
@@ -67,7 +71,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * Constructor for AbstractFormSection.
         * </p>
-        * 
+        *
         * @param conversation
         *            TODO
         * @param style
@@ -81,8 +85,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * @param <ENTITY>
         *            a ENTITY object.
         */
-       protected AbstractFormSection(CdmFormFactory formFactory, ICdmFormElement parentElement,
-                       int style) {
+    protected AbstractFormSection(CdmFormFactory formFactory, ICdmFormElement parentElement, int style) {
                super(parentElement.getLayoutComposite(), style);
 
                this.parentElement = parentElement;
@@ -103,45 +106,45 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
                this.setClient(client);
        }
 
-       /**
-        * <p>
-        * Constructor for AbstractFormSection.
-        * </p>
-        * 
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param selectionProvider
-        *            a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-        * @param style
-        *            a int.
-        */
-       protected AbstractFormSection(CdmFormFactory formFactory,
-                       ICdmFormElement parentElement,
-                       ISelectionProvider selectionProvider, int style) {
-               this(formFactory, parentElement, style);
-               this.selectionProvider = selectionProvider;
-       }
+           /**
+     * <p>
+     * Constructor for AbstractFormSection.
+     * </p>
+     *
+     * @param formFactory
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+     *            object.
+     * @param conversation
+     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+     *            object.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param selectionProvider
+     *            a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+     * @param style
+     *            a int.
+     */
+    protected AbstractFormSection(CdmFormFactory formFactory, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+        this(formFactory, parentElement, style);
+        this.selectionProvider = selectionProvider;
+    }
 
        /**
         * <p>
         * Getter for the field <code>propertyChangeListeners</code>.
         * </p>
-        * 
+        *
         * @return a {@link java.util.Set} object.
         */
-       public List<IPropertyChangeListener> getPropertyChangeListeners() {
+       @Override
+    public List<IPropertyChangeListener> getPropertyChangeListeners() {
                return propertyChangeListeners;
        }
 
        /** {@inheritDoc} */
-       public void setPropertyChangeListeners(
+       @Override
+    public void setPropertyChangeListeners(
                        List<IPropertyChangeListener> propertyChangeListeners) {
                this.propertyChangeListeners = propertyChangeListeners;
        }
@@ -150,7 +153,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * Setter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @param entity
         *            a ENTITY object.
         */
@@ -160,17 +163,18 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
         */
        /**
         * <p>
         * Getter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @return a ENTITY object.
         */
-       public ENTITY getEntity() {
+       @Override
+    public ENTITY getEntity() {
                return entity;
        }
 
@@ -178,7 +182,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * getToggle
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.ui.forms.widgets.ToggleHyperlink} object.
         */
        public ToggleHyperlink getToggle() {
@@ -189,7 +193,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * getSection
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
         *         object.
         */
@@ -199,29 +203,28 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.IPropertyChangeEmitter#firePropertyChangeEvent
         * ()
         */
        /** {@inheritDoc} */
-       public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
-               Assert.isNotNull(propertyChangeListeners,
-                               "No property change listeners.");
-               try {
-                       for (Object listener : propertyChangeListeners) {
-                               ((IPropertyChangeListener) listener).propertyChange(event);
-                       }
-               } catch (ConcurrentModificationException e) {
-                       StoreUtil.warn(getClass(),
-                                       "ConcurrentModificationException while handling PropertyChangeEvents."
-                                                       + " It seems like this is not critical");
-               }
+       @Override
+    public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
+        Assert.isNotNull(propertyChangeListeners, "No property change listeners.");
+        try {
+            for (Object listener : propertyChangeListeners) {
+                ((IPropertyChangeListener) listener).propertyChange(event);
+            }
+        } catch (ConcurrentModificationException e) {
+            AbstractUtility.warn(getClass(), "ConcurrentModificationException while handling PropertyChangeEvents."
+                    + " It seems like this is not critical");
+        }
        }
 
        /**
         * Fires a {@link CdmPropertyChangeEvent} with the given object as source.
-        * 
+        *
         * @param object
         *            the object on which the property changed
         */
@@ -232,7 +235,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
        /**
         * Fires a {@link CdmPropertyChangeEvent} with the given object as source
         * also containing the originating event
-        * 
+        *
         * @param object
         *            the object on which the property changed
         * @param originatingEvent
@@ -246,7 +249,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see org.eclipse.swt.widgets.Composite#setFocus()
         */
        /** {@inheritDoc} */
@@ -257,19 +260,20 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
         * .jface.util.PropertyChangeEvent)
         */
        /** {@inheritDoc} */
-       public void propertyChange(PropertyChangeEvent event) {
+       @Override
+    public void propertyChange(PropertyChangeEvent event) {
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.swt.widgets.Control#setBackground(org.eclipse.swt.graphics
         * .Color)
@@ -283,42 +287,41 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
                getLayoutComposite().setBackground(color);
                super.setBackground(color);
        }
-       
+
        @Override
        public void setPersistentBackground(Color color) {
                persistentBackgroundColor = color;
                setBackground(color);
        }
-       
+
        @Override
        public Color getPersistentBackground() {
                return persistentBackgroundColor;
        }
-       
+
 
        /**
         * <p>
         * widgetSelected
         * </p>
-        * 
+        *
         * @param e
         *            a {@link org.eclipse.swt.events.SelectionEvent} object.
         */
        public void widgetSelected(SelectionEvent e) {
-               Widget widget = e.widget;
-
-               if (widget instanceof Control) {
-                       Control control = (Control) widget;
-                       if (checkControlAncestryForWidget(control)) {
-                               if (getEntity() != null) {
-                                       IStructuredSelection selection = new StructuredSelection(
-                                                       getEntity());
-                                       if (selectionProvider != null) {
-                                               selectionProvider.setSelection(selection);
-                                       }
-                               }
-                       }
-               }
+        Widget widget = e.widget;
+
+        if (widget instanceof Control) {
+            Control control = (Control) widget;
+            if (checkControlAncestryForWidget(control)) {
+                if (getEntity() != null) {
+                    IStructuredSelection selection = new StructuredSelection(getEntity());
+                    if (selectionProvider != null) {
+                        selectionProvider.setSelection(selection);
+                    }
+                }
+            }
+        }
        }
 
        private boolean checkControlAncestryForWidget(Control control) {
@@ -335,7 +338,8 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
        }
 
        /** {@inheritDoc} */
-       public void setSelected(boolean selected) {
+       @Override
+    public void setSelected(boolean selected) {
                if (selected) {
                        setBackground(Display.getCurrent().getSystemColor(
                                        SWT.COLOR_LIST_SELECTION));
@@ -345,7 +349,8 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
        }
 
        /** {@inheritDoc} */
-       public void selectionChanged(SelectionChangedEvent event) {
+       @Override
+    public void selectionChanged(SelectionChangedEvent event) {
                if (event.getSelection() == CdmFormFactory.EMPTY_SELECTION) {
                        return;
                }
@@ -365,7 +370,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * addSelectionListener
         * </p>
-        * 
+        *
         * @param listener
         *            a {@link org.eclipse.swt.events.SelectionListener} object.
         */
@@ -377,7 +382,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * removeSelectionListener
         * </p>
-        * 
+        *
         * @param listener
         *            a {@link org.eclipse.swt.events.SelectionListener} object.
         */
@@ -386,7 +391,8 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
        }
 
        /** {@inheritDoc} */
-       public void addElement(ICdmFormElement element) {
+       @Override
+    public void addElement(ICdmFormElement element) {
                elements.add(element);
        }
 
@@ -394,7 +400,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * removeElement
         * </p>
-        * 
+        *
         * @param element
         *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
         *            object.
@@ -408,7 +414,8 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * removeElements
         * </p>
         */
-       public void removeElements() {
+       @Override
+    public void removeElements() {
                for (ICdmFormElement childElement : getElements()) {
                        // recursion
                        childElement.removeElements();
@@ -416,8 +423,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
                        // unregister selection arbitrator
                        if (childElement instanceof ISelectableElement) {
                                ISelectableElement selectableElement = (ISelectableElement) childElement;
-                               if (selectableElement != null
-                                               && selectableElement.getSelectionArbitrator() != null) {
+                               if (selectableElement.getSelectionArbitrator() != null) {
                                        formFactory.destroySelectionArbitrator(selectableElement
                                                        .getSelectionArbitrator());
                                }
@@ -447,10 +453,11 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * Getter for the field <code>parentElement</code>.
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
         */
-       public ICdmFormElement getParentElement() {
+       @Override
+    public ICdmFormElement getParentElement() {
                return parentElement;
        }
 
@@ -458,10 +465,11 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * Getter for the field <code>elements</code>.
         * </p>
-        * 
+        *
         * @return a {@link java.util.Set} object.
         */
-       public Set<ICdmFormElement> getElements() {
+       @Override
+    public Set<ICdmFormElement> getElements() {
                return elements;
        }
 
@@ -469,10 +477,11 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * getControls
         * </p>
-        * 
+        *
         * @return a {@link java.util.Set} object.
         */
-       public Set<Control> getControls() {
+       @Override
+    public Set<Control> getControls() {
                Set<Control> controls = new HashSet<Control>();
 
                for (Control control : getChildren()) {
@@ -493,15 +502,17 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * getLayoutComposite
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.swt.widgets.Composite} object.
         */
-       public Composite getLayoutComposite() {
+       @Override
+    public Composite getLayoutComposite() {
                return (Composite) getClient();
        }
 
        /** {@inheritDoc} */
-       public boolean containsFormElement(ICdmFormElement formElement) {
+       @Override
+    public boolean containsFormElement(ICdmFormElement formElement) {
                if (formElement == this) {
                        return true;
                } else {
@@ -519,7 +530,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * Getter for the field <code>formFactory</code>.
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
         */
        public CdmFormFactory getFormFactory() {
@@ -528,7 +539,7 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.ICdmFormElement#refresh()
         */
        /**
@@ -536,7 +547,8 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * refresh
         * </p>
         */
-       public void refresh() {
+       @Override
+    public void refresh() {
                // empty default implementation
 
        }
@@ -545,30 +557,32 @@ public abstract class AbstractFormSection<ENTITY> extends Section implements
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                if(getParentElement() instanceof RootElement || getParentElement() == null){
-               
-                       IEditorPart activeEditor = StoreUtil.getActiveEditor();
+
+                       IEditorPart activeEditor = AbstractUtility.getActiveEditor();
                        if(activeEditor instanceof IConversationEnabled){
-                               ConversationHolder conversation = ((IConversationEnabled) StoreUtil.getActiveEditor()).getConversationHolder();
+                               ConversationHolder conversation = ((IConversationEnabled) AbstractUtility.getActiveEditor()).getConversationHolder();
                                return conversation;
                        }
                }else if(getParentElement() instanceof IConversationEnabled){
                        return ((IConversationEnabled) getParentElement()).getConversationHolder();
                }
-               StoreUtil.errorDialog("Could not get conversation for AbstractFormSection", 
-                               getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't", 
+               AbstractUtility.errorDialog("Could not get conversation for AbstractFormSection",
+                               getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't",
                                new IllegalArgumentException());
                return null;
-       
+
        }
 
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {
        }
 
 
index 068c03b9e3a5150e0e11f6c5fb448b66944a9605..822f70e6349aee41a6cf8693172c340cce3cb6a5 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.element;
 
@@ -33,6 +33,7 @@ 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.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
 import org.eclipse.ui.internal.forms.widgets.FormFonts;
@@ -93,7 +94,7 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
@@ -102,6 +103,7 @@ import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.EmptyElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionDetailSection;
@@ -116,8 +118,8 @@ import eu.etaxonomy.taxeditor.ui.section.classification.ClassificationDetailElem
 import eu.etaxonomy.taxeditor.ui.section.classification.ClassificationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.common.ReferenceEntityDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.common.RefereneEntityDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DerivedUnitElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailElement;
@@ -129,6 +131,7 @@ import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceEle
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementSourceSection;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.description.DescriptionSourceSection;
+import eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection;
 import eu.etaxonomy.taxeditor.ui.section.description.ModifierElement;
 import eu.etaxonomy.taxeditor.ui.section.description.ModifierSection;
 import eu.etaxonomy.taxeditor.ui.section.description.NaturalLanguageDetailElement;
@@ -255,2037 +258,1991 @@ import eu.etaxonomy.taxeditor.ui.selection.TaxonNodeSelectionElement;
  * <p>
  * CdmFormFactory class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Feb 24, 2010
  * @version 1.0
  */
 public class CdmFormFactory extends FormToolkit {
 
-       private BoldFontHolder2 boldFontHolder2;
-       private MouseListener selectionMouseHandler;
-       private FocusListener selectionFocusHandler;
-
-       private final Set selectionListenerList = new HashSet();
-
-       private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
-
-       private final int orientation = Window.getDefaultOrientation();
-       private ISelectionProvider selectionProvider;
-
-       /** Constant <code>EMPTY_SELECTION</code> */
-       public static ISelection EMPTY_SELECTION = new ISelection() {
-               @Override
-               public boolean isEmpty() {
-                       return true;
-               }
-       };
-       
-       /**
-        * 
-        * @author n.hoffmann
-        * @date Jan 25, 2010
+    private BoldFontHolder2 boldFontHolder2;
+    private MouseListener selectionMouseHandler;
+    private FocusListener selectionFocusHandler;
+
+    private final Set<SelectionListener> selectionListenerList = new HashSet<SelectionListener>();
+
+    private final List<IPropertyChangeListener> propertyChangeListeners = new ArrayList<IPropertyChangeListener>();
+
+    private final int orientation = Window.getDefaultOrientation();
+    private ISelectionProvider selectionProvider;
+
+    /** Constant <code>EMPTY_SELECTION</code> */
+    public static ISelection EMPTY_SELECTION = new ISelection() {
+        @Override
+        public boolean isEmpty() {
+            return true;
+        }
+    };
+
+    /**
+     *
+     * @author n.hoffmann
+     * @date Jan 25, 2010
+     *
+     */
+    private class SelectionMouseHandler extends MouseAdapter {
+        @Override
+        public void mouseDown(MouseEvent e) {
+            notifySelectionListeners(e);
+        }
+    }
+
+    /**
+     *
+     * @author n.hoffmann
+     * @date Jan 25, 2010
+     *
+     */
+    private class SelectionFocusHandler extends FocusAdapter {
+        @Override
+        public void focusGained(FocusEvent e) {
+            notifySelectionListeners(e);
+        }
+    }
+
+    private void notifySelectionListeners(TypedEvent e) {
+        Event event = new Event();
+        event.widget = e.widget;
+        SelectionEvent selectionEvent = new SelectionEvent(event);
+
+        for (SelectionListener listener : selectionListenerList) {
+            listener.widgetSelected(selectionEvent);
+        }
+    }
+
+    /**
+     * <p>
+     * Constructor for CdmFormFactory.
+     * </p>
+     *
+     * @param display
+     *            a {@link org.eclipse.swt.widgets.Display} object.
+     * @param selectionProvider
+     *            a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+     */
+    public CdmFormFactory(Display display, ISelectionProvider selectionProvider) {
+        super(display);
+        this.selectionProvider = selectionProvider;
+        init();
+    }
+
+    /**
+     * <p>
+     * Constructor for CdmFormFactory.
+     * </p>
+     *
+     * @param display
+     *            a {@link org.eclipse.swt.widgets.Display} object.
+     */
+    public CdmFormFactory(Display display) {
+        super(display);
+        init();
+    }
+
+    /**
         *
         */
-       private class SelectionMouseHandler extends MouseAdapter {
-               @Override
-               public void mouseDown(MouseEvent e) {
-                       notifySelectionListeners(e);
-               }
-       }
-
-       /**
-        * 
-        * @author n.hoffmann
-        * @date Jan 25, 2010
-        *
-        */
-       private class SelectionFocusHandler extends FocusAdapter {
-               @Override
-               public void focusGained(FocusEvent e) {
-                       notifySelectionListeners(e);
-               }
-       }
-
-       private void notifySelectionListeners(TypedEvent e) {
-               Event event = new Event();
-               event.widget = e.widget;
-               SelectionEvent selectionEvent = new SelectionEvent(event);
-
-               for (Object listener : selectionListenerList) {
-                       ((SelectionListener) listener).widgetSelected(selectionEvent);
-               }
-       }
-
-       /**
-        * <p>
-        * Constructor for CdmFormFactory.
-        * </p>
-        * 
-        * @param display
-        *            a {@link org.eclipse.swt.widgets.Display} object.
-        * @param selectionProvider
-        *            a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-        */
-       public CdmFormFactory(Display display, ISelectionProvider selectionProvider) {
-               super(display);
-               this.selectionProvider = selectionProvider;
-               init();
-       }
-
-       /**
-        * <p>
-        * Constructor for CdmFormFactory.
-        * </p>
-        * 
-        * @param display
-        *            a {@link org.eclipse.swt.widgets.Display} object.
-        */
-       public CdmFormFactory(Display display) {
-               super(display);
-               init();
-       }
-
-       /**
-        * 
-        */
-       private void init() {
-               boldFontHolder2 = new BoldFontHolder2();
-               selectionMouseHandler = new SelectionMouseHandler();
-               selectionFocusHandler = new SelectionFocusHandler();
-       }
-
-       /**
-        * Creates an instance initialized with the correct selectionProvider
-        * 
-        * Make sure to remove the instance when the entityComposite disposes via
-        * destroySelectionArbitrator(..)
-        * 
-        * @param entityElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
-        *         object.
-        */
-       public SelectionArbitrator createSelectionArbitrator(
-                       IEntityElement entityElement) {
-               SelectionArbitrator selectionArbitrator = new SelectionArbitrator(
-                               entityElement);
-               selectionArbitrator.addSelectionProvider(selectionProvider);
-               selectionProvider.addSelectionChangedListener(selectionArbitrator);
-               addSelectionListener(selectionArbitrator);
-               return selectionArbitrator;
-       }
-
-       /**
-        * <p>
-        * destroySelectionArbitrator
-        * </p>
-        * 
-        * @param selectionArbitrator
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
-        *            object.
-        */
-       public void destroySelectionArbitrator(
-                       SelectionArbitrator selectionArbitrator) {
-               removeSelectionListener(selectionArbitrator);
-               if (selectionProvider != null) {
-                       selectionProvider
-                                       .removeSelectionChangedListener(selectionArbitrator);
-               } else {
-                       StoreUtil
-                                       .error(this.getClass(),
-                                                       "Tried to destroy a selection listener from this factories listeners but was null",
-                                                       null);
-               }
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void adapt(Composite composite) {
-               composite.addMouseListener(selectionMouseHandler);
-               super.adapt(composite);
-       }
-
-       /**
-        * <p>
-        * adapt
-        * </p>
-        * 
-        * @param formElement
-        *            a
-        *            {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
-        *            object.
-        */
-       public void adapt(AbstractCdmFormElement formElement) {
-               formElement.setPropertyChangeListeners(propertyChangeListeners);
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void adapt(Control control, boolean trackFocus, boolean trackKeyboard) {
-               if (trackFocus) {
-                       control.addFocusListener(selectionFocusHandler);
-               }
-               super.adapt(control, trackFocus, trackKeyboard);
-       }
-
-       /**
-        * <p>
-        * destroyElement
-        * </p>
-        * 
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        */
-       public void destroyElement(ICdmFormElement formElement) {
-               // return if element was not initialized
-               if (formElement == null) {
-                       return;
-               }
-               // destroy selection arbitrator, if any
-               if (formElement instanceof ISelectableElement) {
-                       destroySelectionArbitrator(((ISelectableElement) formElement)
-                                       .getSelectionArbitrator());
-               }
-               // remove this element form its parents list of elements
-               // ICdmFormElement parentElement = formElement.getParentElement();
-               // if(parentElement != null){
-               // parentElement.removeElement(formElement);
-               // }
-               // call destroy on child elements recursively
-               for (ICdmFormElement childElement : formElement.getElements()) {
-                       destroyElement(childElement);
-               }
-               // dispose of the controls
-               for (Control control : formElement.getControls()) {
-                       // we added the layoutComposite of the parental element as the
-                       // layout composite to this formElement
-                       // but we do not want to destroy it.
-                       if (control.equals(formElement.getLayoutComposite())) {
-                               continue;
-                       } else {
-                               control.dispose();
-                               control = null;
-                       }
-               }
-       }
-
-       /**
-        * <p>
-        * createEmptyCell
-        * </p>
-        * 
-        * @param parent
-        *            a {@link org.eclipse.swt.widgets.Composite} object.
-        * @return a {@link org.eclipse.swt.widgets.Label} object.
-        */
-       public Label createEmptyCell(Composite parent) {
-               return this.createLabel(parent, null);
-       }
-
-       /**
-        * <p>
-        * createMultilineTextWithLabel
-        * </p>
-        * 
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param textHeight
-        *            a int.
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
-        *         object.
-        */
-       public TextWithLabelElement createMultilineTextWithLabel(
-                       ICdmFormElement parentElement, String labelString, int textHeight,
-                       int style) {
-               TextWithLabelElement element = new TextWithLabelElement(this,
-                               parentElement, labelString, "", textHeight, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createMultiLanguageTextElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param multilanguageText
-        *            a {@link java.util.Map} object.
-        * @param textHeight
-        *            a int.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
-        *         object.
-        */
-       public MultilanguageTextElement createMultiLanguageTextElement(
-                       ICdmFormElement parentElement, String labelString,
-                       Map<Language, LanguageString> multilanguageText, int textHeight,
-                       int style) {
-               MultilanguageTextElement element = new MultilanguageTextElement(this,
-                               parentElement, labelString, multilanguageText, textHeight,
-                               style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       public KeyStatementElement createKeyStatementElement(
-                       ICdmFormElement parentElement, String labelString,
-                       KeyStatement keyStatement, int textHeight, int style) {
-               KeyStatementElement element = new KeyStatementElement(this,
-                               parentElement, labelString, keyStatement, textHeight, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createTextWithLabelElement
-        * </p>
-        * 
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param initialText
-        *            a {@link java.lang.String} object.
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
-        *         object.
-        */
-       public TextWithLabelElement createTextWithLabelElement(
-                       ICdmFormElement parentElement, String labelString,
-                       String initialText, int style) {
-               TextWithLabelElement element = new TextWithLabelElement(this,
-                               parentElement, labelString, initialText, null, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       public UriWithLabelElement createUriWithLabelElement(
-                       ICdmFormElement parentElement, String labelString, URI initialUri,
-                       int style) {
-               UriWithLabelElement element = new UriWithLabelElement(this,
-                               parentElement, labelString, initialUri, null, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * @param element
-        * @param string
-        * @param uri
-        * @param style
-        * @return
-        */
-       public OpenUrlSelectorElement createOpenUrlSelectorElement(
-                       ICdmFormElement parentElement, String labelString,
-                       IOpenUrlEnabled openUrlEnabled, int style) {
-               OpenUrlSelectorElement element = new OpenUrlSelectorElement(this,
-                               parentElement, labelString, openUrlEnabled, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * 
-        * @param parentElement
-        * @param labelString
-        * @param conversationEnabled
-        * @param user
-        * @param style
-        * @return
-        */
-       public EditPasswordElement createEditPasswordElement(
-                       ICdmFormElement parentElement, String labelString,
-                       ConversationHolder conversation, User user, int style) {
-               EditPasswordElement element = new EditPasswordElement(this,
-                               parentElement, labelString, user, conversation);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createIntegerTextWithLabelElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param initialInteger
-        *            a {@link java.lang.Integer} object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
-        *         object.
-        */
-       public NumberWithLabelElement createIntegerTextWithLabelElement(
-                       ICdmFormElement parentElement, String labelString,
-                       Integer initialInteger, int style) {
-               NumberWithLabelElement element = new NumberWithLabelElement(this,
-                               parentElement, labelString, initialInteger, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createFloatTextWithLabelElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param initialFloat
-        *            a float.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
-        *         object.
-        */
-       public NumberWithLabelElement createFloatTextWithLabelElement(
-                       ICdmFormElement parentElement, String labelString,
-                       float initialFloat, int style) {
-               NumberWithLabelElement element = new NumberWithLabelElement(this,
-                               parentElement, labelString, initialFloat, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createLanguageStringWithLabelElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param languageString
-        *            a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
-        *         object.
-        */
-       public LanguageStringWithLabelElement createLanguageStringWithLabelElement(
-                       ICdmFormElement parentElement, String labelString,
-                       LanguageString languageString, int style) {
-               LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(
-                               this, parentElement, labelString, languageString, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createLanguageStringWithLabelElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param languageString
-        *            a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
-        * @param height
-        *            a int.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
-        *         object.
-        */
-       public LanguageStringWithLabelElement createLanguageStringWithLabelElement(
-                       ICdmFormElement parentElement, String labelString,
-                       LanguageString languageString, int height, int style) {
-               LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(
-                               this, parentElement, labelString, languageString, height, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createTextElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param initialText
-        *            a {@link java.lang.String} object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
-        *         object.
-        */
-       public TextWithLabelElement createTextElement(
-                       ICdmFormElement parentElement, String initialText, int style) {
-               TextWithLabelElement element = new TextWithLabelElement(this,
-                               parentElement, null, initialText, null, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createKeyValueViewerElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param keyHeading
-        *            a {@link java.lang.String} object.
-        * @param valueHeading
-        *            a {@link java.lang.String} object.
-        * @param map
-        *            a {@link java.util.Map} object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
-        *         object.
-        */
-       public KeyValueViewerElement createKeyValueViewerElement(
-                       ICdmFormElement parentElement, String keyHeading,
-                       String valueHeading, Map<Object, Object> map) {
-               KeyValueViewerElement element = new KeyValueViewerElement(this,
-                               parentElement, keyHeading, valueHeading, map);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createTermComboElement
-        * </p>
-        * 
-        * @param termComboType
-        *            a
-        *            {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
-        *            object.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param selection
-        *            a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
-        *         object.
-        */
-       
-       public <T extends DefinedTermBase> TermComboElement<T> createTermComboElement(
-                       Class<T> termComboType, ICdmFormElement parentElement,
-                       String labelString, T selection, int style) {
-               TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termComboType, labelString, selection, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createEnumComboElement
-        * </p>
-        * 
-        * @param enumComboType
-        *            a
-        *            {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
-        *            object.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
-        *         object.
-        */
-       public <T extends IDefinedTerm> EnumComboElement<T> createEnumComboElement(
-                       Class<T> enumComboType, ICdmFormElement parentElement,
-                       int style) {
-               EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createBrowserElement
-        * </p>
-        * 
-        * @param imageUri
-        *            a {@link java.net.URI} object.
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement} object.
-        */
-       public BrowserElement createBrowserElement(ICdmFormElement parentElement,
-                       URI imageUri, int style) {
-               BrowserElement element = new BrowserElement(this, parentElement,
-                               imageUri, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createImageElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param imageUri
-        *            a {@link java.net.URI} object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
-        */
-       public ImageElement createImageElement(ICdmFormElement parentElement,
-                       URI imageUri, int style) {
-               ImageElement element = new ImageElement(this, parentElement, imageUri,
-                               style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createTextActionElement
-        * </p>
-        * 
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param initialText
-        *            a {@link java.lang.String} object.
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param buttonLabel
-        *            a {@link java.lang.String} object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
-        *         object.
-        */
-       public TextActionElement createTextActionElement(
-                       ICdmFormElement parentElement, String labelString,
-                       String buttonLabel, String initialText, int style) {
-               TextActionElement element = new TextActionElement(this, parentElement,
-                               labelString, buttonLabel, initialText, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createCheckbox
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param label
-        *            a {@link java.lang.String} object.
-        * @param initialState
-        *            a boolean.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement} object.
-        */
-       public CheckboxElement createCheckbox(ICdmFormElement parentElement,
-                       String label, boolean initialState, int style) {
-               CheckboxElement element = new CheckboxElement(this, parentElement,
-                               label, initialState, style | orientation);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * Creates a section as a part of the form.
-        * 
-        * @return the section widget
-        * @param section
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        */
-       public Section adapt(AbstractFormSection section) {
-               section.setMenu(section.getLayoutComposite().getMenu());
-               adapt(section, true, true);
-
-               // handle focus and property change events for cdm use
-               section.addFocusListener(selectionFocusHandler);
-               section.setPropertyChangeListeners(propertyChangeListeners);
-
-               if (section.getToggle() != null) {
-                       section.getToggle().setHoverDecorationColor(
-                                       getColors().getColor(IFormColors.TB_TOGGLE_HOVER));
-                       section.getToggle().setDecorationColor(
-                                       getColors().getColor(IFormColors.TB_TOGGLE));
-               }
-
-               section.setFont(boldFontHolder2.getBoldFont(section
-                               .getLayoutComposite().getFont()));
-
-               if ((section.getStyle() & Section.TITLE_BAR) != 0
-                               || (section.getStyle() & Section.SHORT_TITLE_BAR) != 0) {
-                       getColors().initializeSectionToolBarColors();
-                       section.setTitleBarBackground(getColors().getColor(
-                                       IFormColors.TB_BG));
-                       section.setTitleBarBorderColor(getColors().getColor(
-                                       IFormColors.TB_BORDER));
-               }
-               // call setTitleBarForeground regardless as it also sets the label color
-               section.setTitleBarForeground(getColors().getColor(
-                               IFormColors.TB_TOGGLE));
-               return section;
-       }
-
-       private class BoldFontHolder2 {
-               private Font normalFont;
-
-               private Font boldFont;
-
-               public BoldFontHolder2() {
-               }
-
-               public Font getBoldFont(Font font) {
-                       createBoldFont(font);
-                       return boldFont;
-               }
-
-               private void createBoldFont(Font font) {
-                       if (normalFont == null || !normalFont.equals(font)) {
-                               normalFont = font;
-                               dispose();
-                       }
-                       if (boldFont == null) {
-                               boldFont = FormFonts.getInstance().getBoldFont(
-                                               getColors().getDisplay(), normalFont);
-                       }
-               }
-
-               public void dispose() {
-                       if (boldFont != null) {
-                               FormFonts.getInstance().markFinished(boldFont,
-                                               getColors().getDisplay());
-                               boldFont = null;
-                       }
-               }
-       }
-
-       /**
-        * <p>
-        * createToggleableTextField
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param initialText
-        *            a {@link java.lang.String} object.
-        * @param initialState
-        *            a boolean.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
-        *         object.
-        */
-       public ToggleableTextElement createToggleableTextField(
-                       ICdmFormElement parentElement, String labelString,
-                       String initialText, boolean initialState, int style) {
-               ToggleableTextElement element = new ToggleableTextElement(this,
-                               parentElement, labelString, initialText, initialState, style
-                                               | orientation);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createTimePeriodElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param timePeriod
-        *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
-        *         object.
-        */
-       public TimePeriodElement createTimePeriodElement(
-                       ICdmFormElement parentElement, String labelString,
-                       TimePeriod timePeriod, int style) {
-               TimePeriodElement element = new TimePeriodElement(this, parentElement,
-                               labelString, timePeriod, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createPointElement
-        * </p>
-        * 
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param point
-        *            a {@link eu.etaxonomy.cdm.model.location.Point} object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
-        */
-       public PointElement createPointElement(ICdmFormElement parentElement,
-                       Point point, int style) {
-               PointElement element = new PointElement(this, parentElement, point,
-                               style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createDateDetailSection
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
-        *         object.
-        */
-       public DateDetailSection createDateDetailSection(
-                       ICdmFormElement parentElement, int style) {
-               DateDetailSection section = new DateDetailSection(this, parentElement,
-                               style);
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-       }
-
-       /**
-        * <p>
-        * createPartialElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param partial
-        *            a {@link org.joda.time.Partial} object.
-        * @param style
-        *            a int.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement} object.
-        */
-       public PartialElement createPartialElement(ICdmFormElement parentElement,
-                       String labelString, Partial partial, int style) {
-               PartialElement element = new PartialElement(this, parentElement,
-                               labelString, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * addSelectionListener
-        * </p>
-        * 
-        * @param listener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        */
-       public void addSelectionListener(SelectionListener listener) {
-               selectionListenerList.add(listener);
-       }
-
-       /**
-        * <p>
-        * removeSelectionListener
-        * </p>
-        * 
-        * @param listener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        */
-       public void removeSelectionListener(SelectionListener listener) {
-               if (listener == null) {
-                       StoreUtil
-                                       .error(this.getClass(),
-                                                       "Tried to remove a selection listener from this factories listeners but was null",
-                                                       null);
-               } else {
-                       selectionListenerList.remove(listener);
-               }
-       }
-
-       /**
-        * <p>
-        * addPropertyChangeListener
-        * </p>
-        * 
-        * @param listener
-        *            a {@link org.eclipse.jface.util.IPropertyChangeListener}
-        *            object.
-        */
-       public void addPropertyChangeListener(IPropertyChangeListener listener) {
-               if(propertyChangeListeners.contains(listener)){
-                       return;
-               }
-               propertyChangeListeners.add(0, listener);
-       }
-
-       /**
-        * <p>
-        * removePropertyChangeListener
-        * </p>
-        * 
-        * @param listener
-        *            a {@link org.eclipse.jface.util.IPropertyChangeListener}
-        *            object.
-        */
-       public void removePropertyChangeListener(IPropertyChangeListener listener) {
-               propertyChangeListeners.remove(listener);
-       }
-
-       /**
-        * <p>
-        * createHorizontalSeparator
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a {@link org.eclipse.swt.widgets.Label} object.
-        */
-       public Label createHorizontalSeparator(ICdmFormElement parentElement,
-                       int style) {
-               Label separator = this.createSeparator(
-                               parentElement.getLayoutComposite(), SWT.HORIZONTAL | style);
-               separator.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
-               return separator;
-       }
-
-       /**
-        * <p>
-        * createVersionElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param entity
-        *            a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
-        *         object.
-        */
-       public VersionElement createVersionElement(ICdmFormElement parentElement,
-                       VersionableEntity entity, int style) {
-               VersionElement element = new VersionElement(this, parentElement,
-                               entity, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-       
-       /**
-        * @param cdmBaseSection
-        * @param object
-        * @param style
-        * @return
-        */
-       public CdmBaseElement createCdmBaseElement(ICdmFormElement parentElement,
-                       CdmBase entity, int style) {
-               CdmBaseElement element = new CdmBaseElement(this, parentElement,
-                               entity, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-
-       /**
-        * <p>
-        * createVersionSection
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
-        *         object.
-        */
-       public VersionSection createVersionSection(ICdmFormElement parentElement,
-                       int style) {
-               VersionSection section = new VersionSection(this, parentElement, style);
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-       }
-       
-       /**
-        * @param parent
-        * @param i
-        * @return
-        */
-       public CdmBaseSection createCdmBaseSection(ICdmFormElement parentElement, int style) {
-               CdmBaseSection section = new CdmBaseSection(this, parentElement, style);
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-       }
-
-       /**
-        * <p>
-        * createEmptyElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
-        */
-       public EmptyElement createEmptyElement(ICdmFormElement parentElement) {
-               EmptyElement element = new EmptyElement(this, parentElement, null,
-                               SWT.NULL);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createHeadlineSection
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
-        *         object.
-        */
-       public HeadlineSection createHeadlineSection(ICdmFormElement parentElement) {
-               HeadlineSection section = new HeadlineSection(this, parentElement,
-                               SWT.NULL);
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-       }
-
-       /**
-        * <p>
-        * createParsingMessageElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param parserProblem
-        *            a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
-        *         object.
-        */
-       public ParsingMessageElement createParsingMessageElement(
-                       ICdmFormElement parentElement, ParserProblem parserProblem,
-                       int style) {
-               ParsingMessageElement element = new ParsingMessageElement(this,
-                               parentElement, parserProblem, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       // SIMPLIFY
-
-       /**
-        * 
-        */
-       public static enum DetailType {
-               AUTHORSHIP, 
-               CLASSIFICATION, 
-               COLLECTION, 
-               DERIVED_UNIT, 
-               DERIVED_UNIT_FACADE, 
-               DERIVED_UNIT_GENERAL, 
-               DESCRIPTION, 
-               DESCRIPTIONELEMENT, 
-               DETERMINATION, 
-               FEATURE_DISTRIBUTION, 
-               FIELD_OBSERVATION, 
-               GATHERING_EVENT, 
-               GRANTEDAUTHORITY,
-               GROUP, 
-               HYBRID, 
-               INSTITUTION, 
-               MEDIA, 
-               NAMED_AREA, 
-               NAMED_AREA_LEVEL, 
-               NAMERELATIONSHIP, 
-               NATURAL_LANGUAGE, 
-               NOMENCLATURALREFERENCE, 
-               NONVIRALNAME, 
-               PARSINGMESSAGE, 
-               PERSON, 
-               POLYTOMOUS_KEY, 
-               POLYTOMOUS_KEY_NODE, 
-               REFERENCEBASE, 
-               REFERENCED_ENTITY, 
-               SCIENTIFICNAME, 
-               TAXON_NODE, 
-               TAXON_RELATIONSHIP, 
-               TAXONBASE, 
-               TEAM, 
-               TEAMORPERSONBASE, 
-               TERM_VOCABULARY,
-               USE_RECORD,
-               USER
-       }
-       
-       public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
-                       ISelectionProvider selectionProvider, int style) {
-               
-               AbstractFormSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement, selectionProvider, style);
-                       
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-               
-       }
-       
-       /**
-        * @param definedTermClass
-        * @param formElement
-        * @param style
-        * @return
-        */
-       public AbstractCdmDetailElement createDefinedTermDetailElement(
-                       Class definedTermClass, AbstractCdmDetailSection parentElement,
-                       int style) {
-               AbstractCdmDetailElement element = null;
-               
-               if (NamedArea.class.isAssignableFrom(definedTermClass)){
-                       element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
-               }
-               else {
-                       element = new DefinedTermDetailElement(this, parentElement);
-               }
-               
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * createCdmDetailSection
-        * </p>
-        * 
-        * @param detailType
-        *            a
-        *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
-        *            object.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param selectionProvider
-        *            a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-        * @param style
-        *            a int.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *         object.
-        */
-       public AbstractFormSection createCdmDetailSection(DetailType detailType,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
-                       ISelectionProvider selectionProvider, int style) {
-               AbstractFormSection section = null;
-
-               switch (detailType) {
-               case SCIENTIFICNAME:
-                       section = new NameDetailSection(this, conversation, parentElement,
-                                       selectionProvider, style);
-                       break;
-               case REFERENCEBASE:
-                       section = new ReferenceDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case NOMENCLATURALREFERENCE:
-                       section = new NomenclaturalReferenceDetailSection(this,
-                                       conversation, parentElement, selectionProvider, style);
-                       break;
-               case TAXONBASE:
-                       section = new TaxonBaseDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case AUTHORSHIP:
-                       section = new AuthorshipDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case TEAMORPERSONBASE:
-                       section = new TeamOrPersonBaseDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case TEAM:
-                       section = new TeamDetailSection(this, conversation, parentElement,
-                                       null, style);
-                       break;
-               case PERSON:
-                       section = new PersonDetailSection(this, conversation,
-                                       parentElement, null, style);
-                       break;
-               case DESCRIPTION:
-                       section = new DescriptionDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case DESCRIPTIONELEMENT:
-                       section = new DescriptionElementDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case PARSINGMESSAGE:
-                       section = new ParsingMessagesSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case NONVIRALNAME:
-                       section = new NonViralNameDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case MEDIA:
-                       section = new eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection(
-                                       this, conversation, parentElement, selectionProvider, style);
-                       break;
-               case DERIVED_UNIT_FACADE:
-                       section = new DerivedUnitFacadeDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case FIELD_OBSERVATION:
-                       section = new FieldObservationDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case GATHERING_EVENT:
-                       section = new GatheringEventDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case DERIVED_UNIT:
-                       section = new DerivedUnitBaseDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case NATURAL_LANGUAGE:
-                       section = new NaturalLanguageSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case FEATURE_DISTRIBUTION:
-                       section = new FeatureDistributionDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case CLASSIFICATION:
-                       section = new ClassificationDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case TAXON_NODE:
-                       section = new TaxonNodeDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case POLYTOMOUS_KEY:
-                       section = new PolytomousKeyDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case POLYTOMOUS_KEY_NODE:
-                       section = new PolytomousKeyNodeDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case INSTITUTION:
-                       section = new InstitutionDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case DERIVED_UNIT_GENERAL:
-                       section = new GeneralDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case HYBRID:
-                       section = new HybridDetailSection(this, conversation,
-                                       parentElement, selectionProvider, style);
-                       break;
-               case USER:
-                       section = new UserDetailSection(this, conversation, parentElement,
-                                       selectionProvider, style);
-                       break;
-               case GROUP:
-                       section = new GroupDetailSection(this, conversation, parentElement,
-                                       selectionProvider, style);
-                       break;
-               case DETERMINATION:
-                       section = new DeterminationDetailSection(this, conversation, parentElement,
-                                       selectionProvider, style);
-                       break;
-               case TAXON_RELATIONSHIP:
-                       section = new TaxonRelationshipDetailSection(this, conversation, parentElement, 
-                                       selectionProvider, style);
-                       break;
-               case REFERENCED_ENTITY:
-                       section = new ReferencedEntityDetailSection(this, conversation, parentElement, 
-                                       selectionProvider, style);
-                       break;
-               case TERM_VOCABULARY:
-                       section = new TermVocabularyDetailSection(this, conversation, parentElement, 
-                                       selectionProvider, style);
-                       break;
-               case NAMED_AREA:
-                       section = new NamedAreaDetailSection(this, conversation, parentElement, 
-                                       selectionProvider, style);
-                       break;
-               case USE_RECORD:
-                       section = new UseRecordDetailSection(this, conversation, parentElement,
-                                       selectionProvider, style);
-                       break;
-               }
-               
-
-               if (section == null) {
-                       throw new RuntimeException(
-                                       "You tried to create a cdm detail section that is not implemented yet.");
-               }
-
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-       }
-
-       
-       
-       /**
-        * <p>
-        * createCdmDetailElement
-        * </p>
-        * 
-        * @param detailType
-        *            a
-        *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
-        *            object.
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement}
-        *         object.
-        */
-       public AbstractCdmDetailElement createCdmDetailElement(
-                       DetailType detailType, ICdmFormElement parentElement, int style) {
-               AbstractCdmDetailElement element = null;
-
-               switch (detailType) {
-               case SCIENTIFICNAME:
-                       element = new NameDetailElement(this, parentElement, style);
-                       break;
-               case REFERENCEBASE:
-                       element = new ReferenceDetailElement(this, parentElement, style);
-                       break;
-               case NOMENCLATURALREFERENCE:
-                       element = new NomenclaturalReferenceDetailElement(this,
-                                       parentElement, style);
-                       break;
-               case TAXONBASE:
-                       element = new TaxonBaseDetailElement(this, parentElement, style);
-                       break;
-               case AUTHORSHIP:
-                       element = new AuthorshipDetailElement(this, parentElement, style);
-                       break;
-               case TEAM:
-                       element = new TeamDetailElement(this, parentElement, style);
-                       break;
-               case PERSON:
-                       element = new PersonDetailElement(this, parentElement, style);
-                       break;
-               case DESCRIPTION:
-                       element = new DescriptionDetailElement(this, parentElement, style);
-                       break;
-               case DESCRIPTIONELEMENT:
-                       element = new DescriptionElementDetailElement(this, parentElement,
-                                       style);
-                       break;
-               case NONVIRALNAME:
-                       element = new NonViralNameDetailElement(this, parentElement);
-                       break;
-               case DERIVED_UNIT_FACADE:
-                       element = new DerivedUnitFacadeDetailElement(this, parentElement);
-                       break;
-               case FIELD_OBSERVATION:
-                       element = new FieldObservationDetailElement(this, parentElement);
-                       break;
-               case GATHERING_EVENT:
-                       element = new GatheringEventDetailElement(this, parentElement);
-                       break;
-               case DERIVED_UNIT:
-                       element = new DerivedUnitBaseDetailElement(this, parentElement);
-                       break;
-               case NATURAL_LANGUAGE:
-                       element = new NaturalLanguageDetailElement(this, parentElement);
-                       break;
-               case FEATURE_DISTRIBUTION:
-                       element = new FeatureDistributionDetailElement(this, parentElement);
-                       break;
-               case CLASSIFICATION:
-                       element = new ClassificationDetailElement(this, parentElement);
-                       break;
-               case TAXON_NODE:
-                       element = new TaxonNodeDetailElement(this, parentElement);
-                       break;
-               case COLLECTION:
-                       element = new CollectionDetailElement(this, parentElement);
-                       break;
-               case POLYTOMOUS_KEY:
-                       element = new PolytomousKeyDetailElement(this, parentElement);
-                       break;
-               case POLYTOMOUS_KEY_NODE:
-                       element = new PolytomousKeyNodeDetailElement(this, parentElement);
-                       break;
-               case INSTITUTION:
-                       element = new InstitutionDetailElement(this, parentElement);
-                       break;
-               case DERIVED_UNIT_GENERAL:
-                       element = new GeneralDetailElement(this, parentElement);
-                       break;
-               case HYBRID:
-                       element = new HybridDetailElement(this, parentElement);
-                       break;
-               case USER:
-                       element = new UserDetailElement(this, parentElement);
-                       break;
-               case GROUP:
-                       element = new GroupDetailElement(this, parentElement);
-                       break;
-               case GRANTEDAUTHORITY:
-                       element = new GrantedAuthorityDetailElement(this, parentElement);
-                       break;
-               case DETERMINATION:
-                       element = new DeterminationDetailElement(this, parentElement);
-                       break;
-               case TAXON_RELATIONSHIP:
-                       element = new TaxonRelationshipDetailElement(this, parentElement);
-                       break;
-               case REFERENCED_ENTITY:
-                       element = new RefereneEntityDetailElement(this, parentElement);
-                       break;
-               case TERM_VOCABULARY:
-                       element = new TermVocabularyDetailElement(this, parentElement);
-                       break;
-               case NAMED_AREA:
-                       element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
-                       break;
-               case NAMED_AREA_LEVEL:
-                       element = new DefinedTermDetailElement<NamedAreaLevel>(this, parentElement);
-                       break;
-               case USE_RECORD:
-                       //element = new UseRecordDetailElement(this, parentElement, style);
-                       element = new UseRecordDetailElement(this, parentElement);
-                       break;
-               }
-
-               if (element == null) {
-                       StoreUtil
-                                       .error(this.getClass(),
-                                                       "Detail element was not created. Seems like the case was not implemented for the requested detail type: "
-                                                                       + detailType, null);
-               }
-
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * 
-        * @author n.hoffmann
-        * @created Mar 5, 2010
-        * @version 1.0
-        */
-       public static enum EntityDetailType {
-               TEAM, 
-               TEAMMEMBER, 
-               ANNOTATION, 
-               CREDIT, 
-               DESCRIPTIONELEMENTSOURCE, 
-               EXTENSION, 
-               MARKER, 
-               MEDIA, 
-               DESCRIPTIONELEMENTMEDIA, 
-               MEDIAREPRESENTATION, 
-               MEDIAREPRESENTATIONPART, 
-               MODIFIER, 
-               NOMENCLATURALSTATUS, 
-               NAME_RELATIONSHIP, 
-               PROTOLOG, 
-               RIGHTS, 
-               SOURCE, 
-               SCOPE, 
-               DESCRIPTIONSOURCE, 
-               TYPEDESIGNATION, 
-               STATE_DATA, 
-               STATISTICAL_MEASUREMENT_VALUE, 
-               DESCRIBED_SPECIMEN, 
-               COLLECTING_AREA, 
-               DETERMINATION_EVENT, 
-               SPECIMEN_COLLECTION, 
-               IDENTIFIABLE_SOURCE_COLLECTION, 
-               GEOGRAPHICAL_SCOPE, 
-               SCOPE_RESTRICTION, 
-               MEMBER, 
-               GRANTED_AUTHORITY, 
-               GROUPS_BY_USER, 
-               TAXONOMIC_SCOPE, 
-               DETERMINATION_CURRENT, 
-               DETERMINATION_HISTORY
-       }
-
-       /**
-        * <p>
-        * createEntityDetailSection
-        * </p>
-        * 
-        * @param entityDetailType
-        *            a
-        *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType}
-        *            object.
-        * @param style
-        *            a int.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *         object.
-        */
-       public AbstractFormSection createEntityDetailSection(
-                       EntityDetailType entityDetailType, ConversationHolder conversation,
-                       ICdmFormElement parentElement, int style) {
-               AbstractFormSection section = null;
-
-               switch (entityDetailType) {
-               case TEAM:
-                       section = new TeamDetailSection(this, conversation, parentElement,
-                                       null, style);
-                       break;
-               case TEAMMEMBER:
-                       section = new TeamMemberSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case ANNOTATION:
-                       section = new AnnotationSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case CREDIT:
-                       section = new CreditSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case DESCRIPTIONELEMENTSOURCE:
-                       section = new DescriptionElementSourceSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case EXTENSION:
-                       section = new ExtensionSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case MARKER:
-                       section = new MarkerSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case MEDIA:
-                       section = new MediaSection(this, conversation, parentElement, style);
-                       break;
-               case DESCRIPTIONELEMENTMEDIA:
-                       section = new DescriptionElementMediaSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case MEDIAREPRESENTATION:
-                       section = new MediaRepresentationSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case MEDIAREPRESENTATIONPART:
-                       section = new MediaRepresentationPartSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case MODIFIER:
-                       section = new ModifierSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case NOMENCLATURALSTATUS:
-                       section = new NomenclaturalStatusSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case NAME_RELATIONSHIP:
-                       section = new NameRelationshipDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case PROTOLOG:
-                       section = new ProtologueSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case RIGHTS:
-                       section = new RightsSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case SOURCE:
-                       section = new SourceSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case SCOPE:
-                       section = new ScopeSection(this, conversation, parentElement, style);
-                       break;
-               case DESCRIPTIONSOURCE:
-                       section = new DescriptionSourceSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case TYPEDESIGNATION:
-                       section = new TypeDesignationSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case STATE_DATA:
-                       section = new StateDataSection(this, conversation, parentElement,
-                                       style);
-                       break;
-               case STATISTICAL_MEASUREMENT_VALUE:
-                       section = new StatisticalMeasurementValueSection(this,
-                                       conversation, parentElement, style);
-                       break;
-               case DESCRIBED_SPECIMEN:
-                       section = new DescribedSpecimenSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case COLLECTING_AREA:
-                       section = new CollectingAreasDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case DETERMINATION_CURRENT:
-                       section = new CurrentDeterminationDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case DETERMINATION_HISTORY:
-                       section = new DeterminationHistoryDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case SPECIMEN_COLLECTION:
-                       section = new SpecimenCollectionDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case IDENTIFIABLE_SOURCE_COLLECTION:
-                       section = new SourceCollectionDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case GEOGRAPHICAL_SCOPE:
-                       section = new GeographicalScopeDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case SCOPE_RESTRICTION:
-                       section = new ScopeRestrictionSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case MEMBER:
-                       section = new MemberDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case GRANTED_AUTHORITY:
-                       section = new GrantedAuthorityDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case GROUPS_BY_USER:
-                       section = new GroupsByUserDetailSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               case TAXONOMIC_SCOPE:
-                       section = new TaxonomicScopeSection(this, conversation,
-                                       parentElement, style);
-                       break;
-               }
-               parentElement.addElement(section);
-               adapt(section);
-               return section;
-       }
-
-       /**
-        * <p>
-        * createEntityCollectionElement
-        * </p>
-        * 
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param versionableEntity
-        *            a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
-        *            object.
-        * @param backgroundColor
-        *            a {@link org.eclipse.swt.graphics.Color} object.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
-        *         object.
-        */
-       public AbstractEntityCollectionElement createEntityCollectionElement(
-                       AbstractFormSection parentElement, Object versionableEntity,
-                       SelectionListener removeListener, Color backgroundColor, int style) {
-               AbstractEntityCollectionElement element = null;
-
-               Object entity = HibernateProxyHelper.deproxy(versionableEntity);
-
-               if (entity instanceof Annotation) {
-                       element = new AnnotationElement(this, parentElement,
-                                       (Annotation) entity, removeListener, style);
-               } else if (entity instanceof Person) {
-                       element = new TeamMemberElement(this, parentElement,
-                                       (Person) entity, removeListener, style);
-               } else if (entity instanceof Credit) {
-                       element = new CreditElement(this, parentElement, (Credit) entity,
-                                       removeListener, style);
-               } else if (entity instanceof Extension) {
-                       element = new ExtensionElement(this, parentElement,
-                                       (Extension) entity, removeListener, style);
-               } else if (entity instanceof Marker) {
-                       element = new MarkerElement(this, parentElement, (Marker) entity,
-                                       removeListener, style);
-               } else if (entity instanceof Media) {
-                       element = new MediaElement(this, parentElement, (Media) entity,
-                                       removeListener, style);
-               } else if (entity instanceof MediaRepresentation) {
-                       element = new MediaRepresentationElement(this, parentElement,
-                                       (MediaRepresentation) entity, removeListener, style);
-               } else if (entity instanceof ImageFile) {
-                       element = new ImageFileElement(this, parentElement,
-                                       (ImageFile) entity, removeListener, style);
-               } else if (entity instanceof MediaRepresentationPart){
-                       element = new MediaRepresentationPartElement(this, parentElement, 
-                                       (MediaRepresentationPart) entity, removeListener, style);                       
-               } else if (entity instanceof NomenclaturalStatus) {
-                       element = new NomenclaturalStatusElement(this, parentElement,
-                                       (NomenclaturalStatus) entity, removeListener, style);
-               } else if (entity instanceof Rights) {
-                       element = new RightsElement(this, parentElement, (Rights) entity,
-                                       removeListener, style);
-               } else if (entity instanceof DescriptionElementSource) {
-                       element = new DescriptionElementSourceElement(this, parentElement,
-                                       (DescriptionElementSource) entity, removeListener, style);
-               } else if (entity instanceof IdentifiableSource) {
-                       element = new IdentifiableSourceElement(this, parentElement,
-                                       (IdentifiableSource) entity, removeListener, style);
-               } else if (entity instanceof Scope) {
-                       element = new ScopeElement(this, parentElement, (Scope) entity,
-                                       removeListener, style);
-               } else if (entity instanceof Modifier) {
-                       element = new ModifierElement(this, parentElement,
-                                       (Modifier) entity, removeListener, style);
-               } else if (entity instanceof Reference) {
-                       element = new DescriptionSourceElement(this, parentElement,
-                                       (Reference) entity, removeListener, style);
-               } else if (entity instanceof NameTypeDesignation) {
-                       element = new NameTypeDesignationElement(this, parentElement,
-                                       (NameTypeDesignation) entity, removeListener, style);
-               } else if (entity instanceof NameRelationship) {
-                       element = new NameRelationshipDetailElement(this, parentElement,
-                                       (NameRelationship) entity, removeListener, style);
-               } else if (entity instanceof SpecimenTypeDesignation) {
-                       element = new SpecimenTypeDesignationElement(this, parentElement,
-                                       (SpecimenTypeDesignation) entity, removeListener, style);
-               } else if (entity instanceof StateData) {
-                       element = new StateDataElement(this, parentElement,
-                                       (StateData) entity, removeListener, style);
-               } else if (entity instanceof StatisticalMeasurementValue) {
-                       element = new StatisticalMeasurementValueElement(this,
-                                       parentElement, (StatisticalMeasurementValue) entity,
-                                       removeListener, style);
-               } else if (entity instanceof DerivedUnit) {
-                       element = new DerivedUnitElement(this, parentElement,
-                                       (DerivedUnit) entity, removeListener, style);
-               } else if (entity instanceof NamedArea) {
-                       element = new NamedAreaDetailElement(this, parentElement,
-                                       (NamedArea) entity, removeListener, style);
-               } else if (entity instanceof DeterminationEvent) {
-                       element = new DeterminationEventDetailElement(this, parentElement,
-                                       (DeterminationEvent) entity, removeListener, style);
-               } else if (entity instanceof Specimen) {
-                       element = new SpecimenCollectionDetailElement(this, parentElement,
-                                       (Specimen) entity, removeListener, style);
-               } else if (entity instanceof User) {
-                       element = new MemberDetailElement(this, parentElement,
-                                       (User) entity, removeListener, style);
-               } else if (entity instanceof GrantedAuthority) {
-                       element = new GrantedAuthorityCollectionElement(this, parentElement,
-                                       (GrantedAuthorityImpl) entity, removeListener, style);
-               } else if (entity instanceof Group) {
-                       element = new GroupsByUserDetailElement(this, parentElement,
-                                       (Group) entity, removeListener, style);
-               } else if (entity instanceof Taxon) {
-                       element = new TaxonDetailElement(this, parentElement,
-                                       (Taxon) entity, removeListener, style);
-               } else if (entity instanceof DescriptionElementBase) {
-                       // this is the special case for protologs, maybe we can do this
-                       // differently when API improves
-                       DescriptionElementBase descriptionElement = (DescriptionElementBase) entity;
-                       if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
-                               element = new ProtologueElement(this, parentElement,
-                                               descriptionElement, removeListener, style);
-                       }
-               }
-
-               if (element == null) {
-                       StoreUtil
-                                       .errorDialog(
-                                                       "No element for entity",
-                                                       this,
-                                                       "Could not generate element for entity. "
-                                                                       + "Looks like the case is not handled already. Check implementation. Entity: "
-                                                                       + entity, null);
-
-               }
-
-               if (backgroundColor != null && !backgroundColor.isDisposed()) {
-                       element.setPersistentBackground(backgroundColor);
-               }
-
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-
-       /**
-        * <p>
-        * Creates a selection element for the given type T.
-        * </p>
-        * <p>
-        *      <strong>Selection elements not handled by this method:</strong>
-        *      <ul>
-        *              <li>{@link TaxonNodeSelectionElement} see {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}</li>
-        *              <li>{@link NomenclaturalAuthorTeamSelectionElement} see {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}</li>
-        *      </ul>   
-        * </p>
-        * 
-        * @param clazz
-        *                        a {@link Class} object of the type that you want the selection element to handle
-        * @param parentElement
-        *            a {@link ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link String} object.
-        * @param selectionType
-        * @param selection
-        *            a {@link ICdmBase} object.
-        * @param style
-        *            a int.
-        * @param conversation
-        *            a {@link ConversationHolder} object.
-        * @return a
-        *         {@link EntitySelectionElement}
-        *         object.
-        */
-       public <T extends ICdmBase> EntitySelectionElement<T> createSelectionElement(
-                       Class<T> clazz, ConversationHolder conversation,
-                       ICdmFormElement parentElement, String labelString,
-                       T selection, int mode, int style) {
-               EntitySelectionElement<T> element = new EntitySelectionElement<T>(this, conversation, parentElement, clazz, labelString, selection, mode, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-       
-       public TaxonNodeSelectionElement createTaxonNodeSelectionElement(
-                       ConversationHolder conversation,
-                       ICdmFormElement parentElement, String labelString,
-                       TaxonNode selection, int mode, int style) {
-               TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this, conversation, parentElement, labelString, selection, mode, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-       
-       public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
-                       ConversationHolder conversation,
-                       ICdmFormElement parentElement, String labelString,
-                       Team selection, int mode, int style) {
-               NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this, conversation, parentElement, labelString, selection, mode, style);
-               adapt(element);
-               parentElement.addElement(element);
-               return element;
-       }
-       
-       
-       /** {@inheritDoc} */
-       public LabelElement createLabel(ICdmFormElement parentElement, String text) {
-               LabelElement labelElement = new LabelElement(this, parentElement, text);
-               adapt(labelElement);
-               parentElement.addElement(labelElement);
-               return labelElement;
-       }
-
-       /**
-        * <p>
-        * Getter for the field <code>selectionProvider</code>.
-        * </p>
-        * 
-        * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-        */
-       public ISelectionProvider getSelectionProvider() {
-               return selectionProvider;
-       }
-
-       /**
-        * <p>
-        * createDetailedDescriptionDetailElement
-        * </p>
-        * 
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param entity
-        *            a
-        *            {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
-        *            object.
-        * @param style
-        *            a int.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
-        *         object.
-        */
-       public AbstractDetailedDescriptionDetailElement createDetailedDescriptionDetailElement(
-                       ICdmFormElement parentElement, DescriptionElementBase entity,
-                       int style) {
-               AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null;
-
-               if (entity instanceof CategoricalData) {
-                       detailedDescriptionElement = new CategoricalDataDetailElement(this,
-                                       parentElement, (CategoricalData) entity, style);
-               } else if (entity instanceof CommonTaxonName) {
-                       detailedDescriptionElement = new CommonNameDetailElement(this,
-                                       parentElement, (CommonTaxonName) entity, style);
-               } else if (entity instanceof Distribution) {
-                       detailedDescriptionElement = new DistributionDetailElement(this,
-                                       parentElement, (Distribution) entity, style);
-               } else if (entity instanceof IndividualsAssociation) {
-                       detailedDescriptionElement = new IndividualsAssociationDetailElement(
-                                       this, parentElement, (IndividualsAssociation) entity, style);
-               } else if (entity instanceof QuantitativeData) {
-                       detailedDescriptionElement = new QuantitativeDataDetailElement(
-                                       this, parentElement, (QuantitativeData) entity, style);
-               } else if (entity instanceof TaxonInteraction) {
-                       detailedDescriptionElement = new TaxonInteractionDetailElement(
-                                       this, parentElement, (TaxonInteraction) entity, style);
-               } else if (entity instanceof TextData) {
-                       detailedDescriptionElement = new TextDataDetailElement(this,
-                                       parentElement, (TextData) entity, style);
-               } else {
-                       throw new IllegalStateException(
-                                       "There is no interface for the given description element");
-               }
-               adapt(detailedDescriptionElement);
-               parentElement.addElement(detailedDescriptionElement);
-               return detailedDescriptionElement;
-
-       }
-
-       /**
-        * Creates a styled text as a part of the form.
-        * 
-        * @param parent
-        *            the text parent
-        * @param value
-        *            the text initial value
-        * @param style
-        *            the text style
-        * @return the text widget
-        */
-       public StyledText createStyledText(Composite parent, String value, int style) {
-               StyledText text = new StyledText(parent, getBorderStyle() | style
-                               | getOrientation());
-               if (value != null)
-                       text.setText(value);
-               text.setForeground(getColors().getForeground());
-               text.setBackground(getColors().getBackground());
-               // text.addFocusListener(visibilityHandler);
-               return text;
-       }
-
-
-
-
-
+    private void init() {
+        boldFontHolder2 = new BoldFontHolder2();
+        selectionMouseHandler = new SelectionMouseHandler();
+        selectionFocusHandler = new SelectionFocusHandler();
+    }
+
+    /**
+     * Creates an instance initialized with the correct selectionProvider
+     *
+     * Make sure to remove the instance when the entityComposite disposes via
+     * destroySelectionArbitrator(..)
+     *
+     * @param entityElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
+     *            object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
+     *         object.
+     */
+    public SelectionArbitrator createSelectionArbitrator(IEntityElement entityElement) {
+        SelectionArbitrator selectionArbitrator = new SelectionArbitrator(entityElement);
+        selectionArbitrator.addSelectionProvider(selectionProvider);
+        selectionProvider.addSelectionChangedListener(selectionArbitrator);
+        addSelectionListener(selectionArbitrator);
+        return selectionArbitrator;
+    }
+
+    /**
+     * <p>
+     * destroySelectionArbitrator
+     * </p>
+     *
+     * @param selectionArbitrator
+     *            a
+     *            {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
+     *            object.
+     */
+    public void destroySelectionArbitrator(SelectionArbitrator selectionArbitrator) {
+        removeSelectionListener(selectionArbitrator);
+        if (selectionProvider != null) {
+            selectionProvider.removeSelectionChangedListener(selectionArbitrator);
+        } else {
+            AbstractUtility.error(this.getClass(),
+                    "Tried to destroy a selection listener from this factories listeners but was null", null);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void adapt(Composite composite) {
+        composite.addMouseListener(selectionMouseHandler);
+        super.adapt(composite);
+    }
+
+    /**
+     * <p>
+     * Adapts the {@link AbstractCdmFormElement}:<br>
+     * - sets the {@link IPropertyChangeListener}s handled by this class
+     * </p>
+     *
+     * @param formElement
+     *            a
+     *            {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
+     *            object.
+     */
+    public void adapt(AbstractCdmFormElement formElement) {
+        formElement.setPropertyChangeListeners(propertyChangeListeners);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void adapt(Control control, boolean trackFocus, boolean trackKeyboard) {
+        if (trackFocus) {
+            control.addFocusListener(selectionFocusHandler);
+        }
+        super.adapt(control, trackFocus, trackKeyboard);
+    }
+
+    /**
+     * <p>
+     * destroyElement
+     * </p>
+     *
+     * @param formElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     */
+    public void destroyElement(ICdmFormElement formElement) {
+        // return if element was not initialized
+        if (formElement == null) {
+            return;
+        }
+        // destroy selection arbitrator, if any
+        if (formElement instanceof ISelectableElement) {
+            destroySelectionArbitrator(((ISelectableElement) formElement).getSelectionArbitrator());
+        }
+        // remove this element form its parents list of elements
+        // ICdmFormElement parentElement = formElement.getParentElement();
+        // if(parentElement != null){
+        // parentElement.removeElement(formElement);
+        // }
+        // call destroy on child elements recursively
+        for (ICdmFormElement childElement : formElement.getElements()) {
+            destroyElement(childElement);
+        }
+        // dispose of the controls
+        for (Control control : formElement.getControls()) {
+            // we added the layoutComposite of the parental element as the
+            // layout composite to this formElement
+            // but we do not want to destroy it.
+            if (control.equals(formElement.getLayoutComposite())) {
+                continue;
+            } else {
+                control.dispose();
+                control = null;
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * createEmptyCell
+     * </p>
+     *
+     * @param parent
+     *            a {@link org.eclipse.swt.widgets.Composite} object.
+     * @return a {@link org.eclipse.swt.widgets.Label} object.
+     */
+    public Label createEmptyCell(Composite parent) {
+        return this.createLabel(parent, null);
+    }
+
+    /**
+     * <p>
+     * createMultilineTextWithLabel
+     * </p>
+     *
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param textHeight
+     *            a int.
+     * @param style
+     *            a int.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+     *         object.
+     */
+    public TextWithLabelElement createMultilineTextWithLabel(ICdmFormElement parentElement, String labelString,
+            int textHeight, int style) {
+        TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, "", textHeight, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createMultiLanguageTextElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param multilanguageText
+     *            a {@link java.util.Map} object.
+     * @param textHeight
+     *            a int.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement}
+     *         object.
+     */
+    public MultilanguageTextElement createMultiLanguageTextElement(ICdmFormElement parentElement, String labelString,
+            Map<Language, LanguageString> multilanguageText, int textHeight, int style) {
+        MultilanguageTextElement element = new MultilanguageTextElement(this, parentElement, labelString,
+                multilanguageText, textHeight, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    public KeyStatementElement createKeyStatementElement(ICdmFormElement parentElement, String labelString,
+            KeyStatement keyStatement, int textHeight, int style) {
+        KeyStatementElement element = new KeyStatementElement(this, parentElement, labelString, keyStatement,
+                textHeight, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createTextWithLabelElement
+     * </p>
+     *
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param initialText
+     *            a {@link java.lang.String} object.
+     * @param style
+     *            a int.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+     *         object.
+     */
+    public TextWithLabelElement createTextWithLabelElement(ICdmFormElement parentElement, String labelString,
+            String initialText, int style) {
+        TextWithLabelElement element = new TextWithLabelElement(this, parentElement, labelString, initialText, null,
+                style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    public UriWithLabelElement createUriWithLabelElement(ICdmFormElement parentElement, String labelString,
+            URI initialUri, int style) {
+        UriWithLabelElement element = new UriWithLabelElement(this, parentElement, labelString, initialUri, null, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * @param element
+     * @param string
+     * @param uri
+     * @param style
+     * @return
+     */
+    public OpenUrlSelectorElement createOpenUrlSelectorElement(ICdmFormElement parentElement, String labelString,
+            IOpenUrlEnabled openUrlEnabled, int style) {
+        OpenUrlSelectorElement element = new OpenUrlSelectorElement(this, parentElement, labelString, openUrlEnabled,
+                style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     *
+     * @param parentElement
+     * @param labelString
+     * @param conversationEnabled
+     * @param user
+     * @param style
+     * @return
+     */
+    public EditPasswordElement createEditPasswordElement(ICdmFormElement parentElement, String labelString,
+            ConversationHolder conversation, User user, int style) {
+        EditPasswordElement element = new EditPasswordElement(this, parentElement, labelString, user, conversation);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createIntegerTextWithLabelElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param initialInteger
+     *            a {@link java.lang.Integer} object.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
+     *         object.
+     */
+    public NumberWithLabelElement createIntegerTextWithLabelElement(ICdmFormElement parentElement, String labelString,
+            Integer initialInteger, int style) {
+        NumberWithLabelElement element = new NumberWithLabelElement(this, parentElement, labelString, initialInteger,
+                style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createFloatTextWithLabelElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param initialFloat
+     *            a float.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
+     *         object.
+     */
+    public NumberWithLabelElement createFloatTextWithLabelElement(ICdmFormElement parentElement, String labelString,
+            float initialFloat, int style) {
+        NumberWithLabelElement element = new NumberWithLabelElement(this, parentElement, labelString, initialFloat,
+                style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createLanguageStringWithLabelElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param languageString
+     *            a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
+     *         object.
+     */
+    public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
+            String labelString, LanguageString languageString, int style) {
+        LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString,
+                languageString, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createLanguageStringWithLabelElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param languageString
+     *            a {@link eu.etaxonomy.cdm.model.common.LanguageString} object.
+     * @param height
+     *            a int.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement}
+     *         object.
+     */
+    public LanguageStringWithLabelElement createLanguageStringWithLabelElement(ICdmFormElement parentElement,
+            String labelString, LanguageString languageString, int height, int style) {
+        LanguageStringWithLabelElement element = new LanguageStringWithLabelElement(this, parentElement, labelString,
+                languageString, height, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createTextElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param initialText
+     *            a {@link java.lang.String} object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
+     *         object.
+     */
+    public TextWithLabelElement createTextElement(ICdmFormElement parentElement, String initialText, int style) {
+        TextWithLabelElement element = new TextWithLabelElement(this, parentElement, null, initialText, null, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createKeyValueViewerElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param keyHeading
+     *            a {@link java.lang.String} object.
+     * @param valueHeading
+     *            a {@link java.lang.String} object.
+     * @param map
+     *            a {@link java.util.Map} object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.KeyValueViewerElement}
+     *         object.
+     */
+    public KeyValueViewerElement createKeyValueViewerElement(ICdmFormElement parentElement, String keyHeading,
+            String valueHeading, Map<Object, Object> map) {
+        KeyValueViewerElement element = new KeyValueViewerElement(this, parentElement, keyHeading, valueHeading, map);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createTermComboElement
+     * </p>
+     *
+     * @param termComboType
+     *            a
+     *            {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
+     *            object.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param selection
+     *            a {@link eu.etaxonomy.cdm.model.common.DefinedTermBase}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
+     *         object.
+     */
+
+    public <T extends DefinedTermBase> TermComboElement<T> createTermComboElement(Class<T> termComboType,
+            ICdmFormElement parentElement, String labelString, T selection, int style) {
+        TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termComboType, labelString,
+                selection, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createEnumComboElement
+     * </p>
+     *
+     * @param enumComboType
+     *            a
+     *            {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
+     *            object.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
+     *         object.
+     */
+    public <T extends IDefinedTerm> EnumComboElement<T> createEnumComboElement(Class<T> enumComboType,
+            ICdmFormElement parentElement, int style) {
+        EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createBrowserElement
+     * </p>
+     *
+     * @param imageUri
+     *            a {@link java.net.URI} object.
+     * @param style
+     *            a int.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
+     *         object.
+     */
+    public BrowserElement createBrowserElement(ICdmFormElement parentElement, URI imageUri, int style) {
+        BrowserElement element = new BrowserElement(this, parentElement, imageUri, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createImageElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param imageUri
+     *            a {@link java.net.URI} object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
+     */
+    public ImageElement createImageElement(ICdmFormElement parentElement, URI imageUri, int style) {
+        ImageElement element = new ImageElement(this, parentElement, imageUri, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createTextActionElement
+     * </p>
+     *
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param initialText
+     *            a {@link java.lang.String} object.
+     * @param style
+     *            a int.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param buttonLabel
+     *            a {@link java.lang.String} object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
+     *         object.
+     */
+    public TextActionElement createTextActionElement(ICdmFormElement parentElement, String labelString,
+            String buttonLabel, String initialText, int style) {
+        TextActionElement element = new TextActionElement(this, parentElement, labelString, buttonLabel, initialText,
+                style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createCheckbox
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param label
+     *            a {@link java.lang.String} object.
+     * @param initialState
+     *            a boolean.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
+     *         object.
+     */
+    public CheckboxElement createCheckbox(ICdmFormElement parentElement, String label, boolean initialState, int style) {
+        CheckboxElement element = new CheckboxElement(this, parentElement, label, initialState, style | orientation);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * Creates a section as a part of the form.
+     *
+     * @return the section widget
+     * @param section
+     *            a
+     *            {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+     *            object.
+     */
+    public Section adapt(AbstractFormSection section) {
+        section.setMenu(section.getLayoutComposite().getMenu());
+        adapt(section, true, true);
+
+        // handle focus and property change events for cdm use
+        section.addFocusListener(selectionFocusHandler);
+        section.setPropertyChangeListeners(propertyChangeListeners);
+
+        if (section.getToggle() != null) {
+            section.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE_HOVER));
+            section.getToggle().setDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE));
+        }
+
+        section.setFont(boldFontHolder2.getBoldFont(section.getLayoutComposite().getFont()));
+
+        if ((section.getStyle() & ExpandableComposite.TITLE_BAR) != 0
+                || (section.getStyle() & ExpandableComposite.SHORT_TITLE_BAR) != 0) {
+            getColors().initializeSectionToolBarColors();
+            section.setTitleBarBackground(getColors().getColor(IFormColors.TB_BG));
+            section.setTitleBarBorderColor(getColors().getColor(IFormColors.TB_BORDER));
+        }
+        // call setTitleBarForeground regardless as it also sets the label color
+        section.setTitleBarForeground(getColors().getColor(IFormColors.TB_TOGGLE));
+        return section;
+    }
+
+    private class BoldFontHolder2 {
+        private Font normalFont;
+
+        private Font boldFont;
+
+        public BoldFontHolder2() {
+        }
+
+        public Font getBoldFont(Font font) {
+            createBoldFont(font);
+            return boldFont;
+        }
+
+        private void createBoldFont(Font font) {
+            if (normalFont == null || !normalFont.equals(font)) {
+                normalFont = font;
+                dispose();
+            }
+            if (boldFont == null) {
+                boldFont = FormFonts.getInstance().getBoldFont(getColors().getDisplay(), normalFont);
+            }
+        }
+
+        public void dispose() {
+            if (boldFont != null) {
+                FormFonts.getInstance().markFinished(boldFont, getColors().getDisplay());
+                boldFont = null;
+            }
+        }
+    }
+
+    /**
+     * <p>
+     * createToggleableTextField
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param initialText
+     *            a {@link java.lang.String} object.
+     * @param initialState
+     *            a boolean.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement}
+     *         object.
+     */
+    public ToggleableTextElement createToggleableTextField(ICdmFormElement parentElement, String labelString,
+            String initialText, boolean initialState, int style) {
+        ToggleableTextElement element = new ToggleableTextElement(this, parentElement, labelString, initialText,
+                initialState, style | orientation);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createTimePeriodElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param timePeriod
+     *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TimePeriodElement}
+     *         object.
+     */
+    public TimePeriodElement createTimePeriodElement(ICdmFormElement parentElement, String labelString,
+            TimePeriod timePeriod, int style) {
+        TimePeriodElement element = new TimePeriodElement(this, parentElement, labelString, timePeriod, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createPointElement
+     * </p>
+     *
+     * @param style
+     *            a int.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param point
+     *            a {@link eu.etaxonomy.cdm.model.location.Point} object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.PointElement} object.
+     */
+    public PointElement createPointElement(ICdmFormElement parentElement, Point point, int style) {
+        PointElement element = new PointElement(this, parentElement, point, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createDateDetailSection
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.DateDetailSection}
+     *         object.
+     */
+    public DateDetailSection createDateDetailSection(ICdmFormElement parentElement, int style) {
+        DateDetailSection section = new DateDetailSection(this, parentElement, style);
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+    }
+
+    /**
+     * <p>
+     * createPartialElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param partial
+     *            a {@link org.joda.time.Partial} object.
+     * @param style
+     *            a int.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.PartialElement}
+     *         object.
+     */
+    public PartialElement createPartialElement(ICdmFormElement parentElement, String labelString, Partial partial,
+            int style) {
+        PartialElement element = new PartialElement(this, parentElement, labelString, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * addSelectionListener
+     * </p>
+     *
+     * @param listener
+     *            a {@link org.eclipse.swt.events.SelectionListener} object.
+     */
+    public void addSelectionListener(SelectionListener listener) {
+        selectionListenerList.add(listener);
+    }
+
+    /**
+     * <p>
+     * removeSelectionListener
+     * </p>
+     *
+     * @param listener
+     *            a {@link org.eclipse.swt.events.SelectionListener} object.
+     */
+    public void removeSelectionListener(SelectionListener listener) {
+        if (listener == null) {
+            AbstractUtility.error(this.getClass(),
+                    "Tried to remove a selection listener from this factories listeners but was null", null);
+        } else {
+            selectionListenerList.remove(listener);
+        }
+    }
+
+    /**
+     * <p>
+     * addPropertyChangeListener
+     * </p>
+     *
+     * @param listener
+     *            a {@link org.eclipse.jface.util.IPropertyChangeListener}
+     *            object.
+     */
+    public void addPropertyChangeListener(IPropertyChangeListener listener) {
+        if (propertyChangeListeners.contains(listener)) {
+            return;
+        }
+        propertyChangeListeners.add(0, listener);
+    }
+
+    /**
+     * <p>
+     * removePropertyChangeListener
+     * </p>
+     *
+     * @param listener
+     *            a {@link org.eclipse.jface.util.IPropertyChangeListener}
+     *            object.
+     */
+    public void removePropertyChangeListener(IPropertyChangeListener listener) {
+        propertyChangeListeners.remove(listener);
+    }
+
+    /**
+     * <p>
+     * createHorizontalSeparator
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a {@link org.eclipse.swt.widgets.Label} object.
+     */
+    public Label createHorizontalSeparator(ICdmFormElement parentElement, int style) {
+        Label separator = this.createSeparator(parentElement.getLayoutComposite(), SWT.HORIZONTAL | style);
+        separator.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+        return separator;
+    }
+
+    /**
+     * <p>
+     * createVersionElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param entity
+     *            a {@link eu.etaxonomy.cdm.model.common.VersionableEntity}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionElement}
+     *         object.
+     */
+    public VersionElement createVersionElement(ICdmFormElement parentElement, VersionableEntity entity, int style) {
+        VersionElement element = new VersionElement(this, parentElement, entity, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * @param cdmBaseSection
+     * @param object
+     * @param style
+     * @return
+     */
+    public CdmBaseElement createCdmBaseElement(ICdmFormElement parentElement, CdmBase entity, int style) {
+        CdmBaseElement element = new CdmBaseElement(this, parentElement, entity, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createVersionSection
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.section.supplemental.VersionSection}
+     *         object.
+     */
+    public VersionSection createVersionSection(ICdmFormElement parentElement, int style) {
+        VersionSection section = new VersionSection(this, parentElement, style);
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+    }
+
+    /**
+     * @param parent
+     * @param i
+     * @return
+     */
+    public CdmBaseSection createCdmBaseSection(ICdmFormElement parentElement, int style) {
+        CdmBaseSection section = new CdmBaseSection(this, parentElement, style);
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+    }
+
+    /**
+     * <p>
+     * createEmptyElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.section.EmptyElement} object.
+     */
+    public EmptyElement createEmptyElement(ICdmFormElement parentElement) {
+        EmptyElement element = new EmptyElement(this, parentElement, null, SWT.NULL);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * createHeadlineSection
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection}
+     *         object.
+     */
+    public HeadlineSection createHeadlineSection(ICdmFormElement parentElement) {
+        HeadlineSection section = new HeadlineSection(this, parentElement, SWT.NULL);
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+    }
+
+    /**
+     * <p>
+     * createParsingMessageElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param parserProblem
+     *            a {@link eu.etaxonomy.cdm.strategy.parser.ParserProblem}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessageElement}
+     *         object.
+     */
+    public ParsingMessageElement createParsingMessageElement(ICdmFormElement parentElement,
+            ParserProblem parserProblem, int style) {
+        ParsingMessageElement element = new ParsingMessageElement(this, parentElement, parserProblem, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass, ConversationHolder conversation,
+            ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+
+        AbstractFormSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement,
+                selectionProvider, style);
+
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+
+    }
+
+    /**
+     * @param definedTermClass
+     * @param formElement
+     * @param style
+     * @return
+     */
+    public AbstractCdmDetailElement createDefinedTermDetailElement(Class definedTermClass, AbstractCdmDetailSection parentElement, int style) {
+        AbstractCdmDetailElement element = null;
+
+        if (NamedArea.class.isAssignableFrom(definedTermClass)) {
+            element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
+        } else {
+            element = new DefinedTermDetailElement(this, parentElement);
+        }
+
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    public NameDetailSection createNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NameDetailSection section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ReferenceDetailSection createReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ReferenceDetailSection section = new ReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public NomenclaturalReferenceDetailSection createNomenclaturalReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NomenclaturalReferenceDetailSection section = new NomenclaturalReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TaxonBaseDetailSection createTaxonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonBaseDetailSection section = new TaxonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public AuthorshipDetailSection createAuthorshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AuthorshipDetailSection section = new AuthorshipDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TeamOrPersonBaseDetailSection createTeamOrPersonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TeamOrPersonBaseDetailSection section = new TeamOrPersonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TeamDetailSection createTeamDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        TeamDetailSection section = new TeamDetailSection(this, conversation, parentElement, null, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public PersonDetailSection createPersonDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+        PersonDetailSection section = new PersonDetailSection(this, conversation, parentElement, null, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DescriptionDetailSection createDescriptionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DescriptionDetailSection section = new DescriptionDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DescriptionElementDetailSection createDescriptionElementDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DescriptionElementDetailSection section = new DescriptionElementDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ParsingMessagesSection createParsingMessagesSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ParsingMessagesSection section = new ParsingMessagesSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public NonViralNameDetailSection createNonViralNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NonViralNameDetailSection section = new NonViralNameDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public MediaDetailsSection createMediaDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        MediaDetailsSection section = new MediaDetailsSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DerivedUnitFacadeDetailSection createDerivedUnitFacadeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitFacadeDetailSection section = new DerivedUnitFacadeDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public FieldObservationDetailSection createFieldObservationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GatheringEventDetailSection createGatheringEventDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DerivedUnitBaseDetailSection createDerivedUnitBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitBaseDetailSection section = new DerivedUnitBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public NaturalLanguageSection createNaturalLanguageSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NaturalLanguageSection section = new NaturalLanguageSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public FeatureDistributionDetailSection createFeatureDistributionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FeatureDistributionDetailSection section = new FeatureDistributionDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ClassificationDetailSection createClassificationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ClassificationDetailSection section = new ClassificationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TaxonNodeDetailSection createTaxonNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonNodeDetailSection section = new TaxonNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public PolytomousKeyDetailSection createPolytomousKeyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PolytomousKeyDetailSection section = new PolytomousKeyDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public PolytomousKeyNodeDetailSection createPolytomousKeyNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PolytomousKeyNodeDetailSection section = new PolytomousKeyNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public InstitutionDetailSection createInstitutionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        InstitutionDetailSection section = new InstitutionDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GeneralDetailSection createGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public HybridDetailSection createHybridDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        HybridDetailSection section = new HybridDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public UserDetailSection createUserDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        UserDetailSection section = new UserDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GroupDetailSection createGroupDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GroupDetailSection section = new GroupDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public DeterminationDetailSection createDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DeterminationDetailSection section = new DeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public ReferencedEntityDetailSection createReferencedEntityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ReferencedEntityDetailSection section = new ReferencedEntityDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public TermVocabularyDetailSection createTermVocabularyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermVocabularyDetailSection section = new TermVocabularyDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+
+    public NamedAreaDetailSection createNamedAreaDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NamedAreaDetailSection section = new NamedAreaDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public UseRecordDetailSection createUseRecordDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        UseRecordDetailSection section = new UseRecordDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GeneralDetailSection createFOSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GeneralDetailSection section = new GeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public GatheringEventDetailSection createGatheringSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public FieldObservationDetailSection createFODetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldObservationDetailSection section = new FieldObservationDetailSection(this, conversation, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    private void addAndAdaptSection(ICdmFormElement parentElement, AbstractFormSection<?> section) {
+        parentElement.addElement(section);
+        adapt(section);
+    }
+
+
+    public UseRecordDetailElement createUseRecordDetailElement(ICdmFormElement parentElement){
+        UseRecordDetailElement element = new UseRecordDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DefinedTermDetailElement<NamedAreaLevel> createNamedAreaLevelElement(ICdmFormElement parentElement){
+        DefinedTermDetailElement<NamedAreaLevel> element = new DefinedTermDetailElement<NamedAreaLevel>(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement createNamedAreaDetailElement(ICdmFormElement parentElement){
+        eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TermVocabularyDetailElement createTermVocabularyDetailElement(ICdmFormElement parentElement){
+        TermVocabularyDetailElement element = new TermVocabularyDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ReferenceEntityDetailElement createReferenceEntityDetailElement(ICdmFormElement parentElement){
+        ReferenceEntityDetailElement element = new ReferenceEntityDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TaxonRelationshipDetailElement createTaxonRelationshipDetailElement(ICdmFormElement parentElement){
+        TaxonRelationshipDetailElement element = new TaxonRelationshipDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public GrantedAuthorityDetailElement createGrantedAuthorityDetailElement(ICdmFormElement parentElement){
+        GrantedAuthorityDetailElement element = new GrantedAuthorityDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public GroupDetailElement createGroupDetailElement(ICdmFormElement parentElement){
+        GroupDetailElement element = new GroupDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public UserDetailElement createUserDetailElement(ICdmFormElement parentElement){
+        UserDetailElement element = new UserDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public HybridDetailElement createHybridDetailElement(ICdmFormElement parentElement){
+        HybridDetailElement element = new HybridDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public InstitutionDetailElement createInstitutionDetailElement(ICdmFormElement parentElement){
+        InstitutionDetailElement element = new InstitutionDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PolytomousKeyNodeDetailElement createPolytomousKeyNodeDetailElement(ICdmFormElement parentElement){
+        PolytomousKeyNodeDetailElement element = new PolytomousKeyNodeDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PolytomousKeyDetailElement createPolytomousKeyDetailElement(ICdmFormElement parentElement){
+        PolytomousKeyDetailElement element = new PolytomousKeyDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public CollectionDetailElement createCollectionDetailElement(ICdmFormElement parentElement){
+        CollectionDetailElement element = new CollectionDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TaxonNodeDetailElement createTaxonNodeDetailElement(ICdmFormElement parentElement){
+        TaxonNodeDetailElement element = new TaxonNodeDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ClassificationDetailElement createClassificationDetailElement(ICdmFormElement parentElement){
+        ClassificationDetailElement element = new ClassificationDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public FeatureDistributionDetailElement createFeatureDistributionDetailElement(ICdmFormElement parentElement){
+        FeatureDistributionDetailElement element = new FeatureDistributionDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NaturalLanguageDetailElement createNaturalLanguageDetailElement(ICdmFormElement parentElement){
+        NaturalLanguageDetailElement element = new NaturalLanguageDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DerivedUnitFacadeDetailElement createDerivedUnitFacadeDetailElement(ICdmFormElement parentElement){
+        DerivedUnitFacadeDetailElement element = new DerivedUnitFacadeDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NonViralNameDetailElement createNonViralNameDetailElement(ICdmFormElement parentElement){
+        NonViralNameDetailElement element = new NonViralNameDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DescriptionElementDetailElement createDescriptionElementDetailElement(ICdmFormElement parentElement, int style){
+        DescriptionElementDetailElement element = new DescriptionElementDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DescriptionDetailElement createDescriptionDetailElement(ICdmFormElement parentElement, int style){
+        DescriptionDetailElement element = new DescriptionDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public PersonDetailElement createPersonDetailElement(ICdmFormElement parentElement, int style){
+        PersonDetailElement element = new PersonDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TeamDetailElement createTeamDetailElement(ICdmFormElement parentElement, int style){
+        TeamDetailElement element = new TeamDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public AuthorshipDetailElement createAuthorshipDetailElement(ICdmFormElement parentElement, int style){
+        AuthorshipDetailElement element = new AuthorshipDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public TaxonBaseDetailElement createTaxonBaseDetailElement(ICdmFormElement parentElement, int style){
+        TaxonBaseDetailElement element = new TaxonBaseDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NameDetailElement createNameDetailElement(ICdmFormElement parentElement, int style){
+        NameDetailElement element = new NameDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public ReferenceDetailElement createReferenceDetailElement(ICdmFormElement parentElement, int style){
+        ReferenceDetailElement element = new ReferenceDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public NomenclaturalReferenceDetailElement createNomenclaturalReferenceDetailElement(ICdmFormElement parentElement, int style){
+        NomenclaturalReferenceDetailElement element = new NomenclaturalReferenceDetailElement(this, parentElement, style);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+
+    public GeneralDetailElement createGeneralDetailElement(ICdmFormElement parentElement){
+        GeneralDetailElement element = new GeneralDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public GatheringEventDetailElement createGatheringEventDetailElement(ICdmFormElement parentElement) {
+        GatheringEventDetailElement element = new GatheringEventDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public FieldObservationDetailElement createFieldObservationDetailElement(ICdmFormElement parentElement) {
+        FieldObservationDetailElement element = new FieldObservationDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
+        DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    public DeterminationDetailElement createDeterminationDetailElement(ICdmFormElement parentElement) {
+        DeterminationDetailElement element = new DeterminationDetailElement(this, parentElement);
+        addAndAdaptElement(parentElement, element);
+        return element;
+    }
+
+    /**
+     * @param parentElement
+     * @param element
+     */
+    private void addAndAdaptElement(ICdmFormElement parentElement, AbstractCdmDetailElement<?> element) {
+        adapt(element);
+        parentElement.addElement(element);
+    }
+
+    /**
+     *
+     * Used to define which {@link AbstractEntityCollectionSection} should be
+     * created in
+     * {@link CdmFormFactory#createEntityDetailSection(EntityDetailType, ConversationHolder, ICdmFormElement, int)}
+     *
+     * @author n.hoffmann
+     * @created Mar 5, 2010
+     * @version 1.0
+     */
+    public static enum EntityDetailType {
+        TEAM, // never used
+        TEAMMEMBER,
+        ANNOTATION,
+        CREDIT,
+        DESCRIPTIONELEMENTSOURCE,
+        EXTENSION,
+        MARKER,
+        MEDIA,
+        DESCRIPTIONELEMENTMEDIA,
+        MEDIAREPRESENTATION,
+        MEDIAREPRESENTATIONPART,
+        MODIFIER,
+        NOMENCLATURALSTATUS,
+        NAME_RELATIONSHIP,
+        PROTOLOG,
+        RIGHTS,
+        SOURCE,
+        SCOPE,
+        DESCRIPTIONSOURCE,
+        TYPEDESIGNATION,
+        STATE_DATA,
+        STATISTICAL_MEASUREMENT_VALUE,
+        DESCRIBED_SPECIMEN,
+        COLLECTING_AREA, DETERMINATION_EVENT, // never used
+        SPECIMEN_COLLECTION,
+        IDENTIFIABLE_SOURCE_COLLECTION,
+        GEOGRAPHICAL_SCOPE, // never used
+        SCOPE_RESTRICTION,
+        MEMBER,
+        GRANTED_AUTHORITY,
+        GROUPS_BY_USER,
+        TAXONOMIC_SCOPE,
+        DETERMINATION_CURRENT,
+        DETERMINATION_HISTORY
+    }
+
+    /**
+     * <p>
+     * createEntityDetailSection
+     * </p>
+     *
+     * @param entityDetailType
+     *            a
+     *            {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType}
+     *            object.
+     * @param style
+     *            a int.
+     * @param conversation
+     *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
+     *            object.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+     *         object.
+     */
+    public AbstractFormSection createEntityDetailSection(EntityDetailType entityDetailType,
+            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
+        AbstractFormSection section = null;
+
+//        System.out.println("EntityDetailSection: " + entityDetailType);
+        switch (entityDetailType) {
+        case TEAM:
+            // TODO this is not an AbstractEntityCollectionSection
+            section = new TeamDetailSection(this, conversation, parentElement, null, style);
+            break;
+        case TEAMMEMBER:
+            section = new TeamMemberSection(this, conversation, parentElement, style);
+            break;
+        case ANNOTATION:
+            section = new AnnotationSection(this, conversation, parentElement, style);
+            break;
+        case CREDIT:
+            section = new CreditSection(this, conversation, parentElement, style);
+            break;
+        case DESCRIPTIONELEMENTSOURCE:
+            section = new DescriptionElementSourceSection(this, conversation, parentElement, style);
+            break;
+        case EXTENSION:
+            section = new ExtensionSection(this, conversation, parentElement, style);
+            break;
+        case MARKER:
+            section = new MarkerSection(this, conversation, parentElement, style);
+            break;
+        case MEDIA:
+            section = new MediaSection(this, conversation, parentElement, style);
+            break;
+        case DESCRIPTIONELEMENTMEDIA:
+            section = new DescriptionElementMediaSection(this, conversation, parentElement, style);
+            break;
+        case MEDIAREPRESENTATION:
+            section = new MediaRepresentationSection(this, conversation, parentElement, style);
+            break;
+        case MEDIAREPRESENTATIONPART:
+            section = new MediaRepresentationPartSection(this, conversation, parentElement, style);
+            break;
+        case MODIFIER:
+            section = new ModifierSection(this, conversation, parentElement, style);
+            break;
+        case NOMENCLATURALSTATUS:
+            section = new NomenclaturalStatusSection(this, conversation, parentElement, style);
+            break;
+        case NAME_RELATIONSHIP:
+            section = new NameRelationshipDetailSection(this, conversation, parentElement, style);
+            break;
+        case PROTOLOG:
+            section = new ProtologueSection(this, conversation, parentElement, style);
+            break;
+        case RIGHTS:
+            section = new RightsSection(this, conversation, parentElement, style);
+            break;
+        case SOURCE:
+            section = new SourceSection(this, conversation, parentElement, style);
+            break;
+        case SCOPE:
+            section = new ScopeSection(this, conversation, parentElement, style);
+            break;
+        case DESCRIPTIONSOURCE:
+            section = new DescriptionSourceSection(this, conversation, parentElement, style);
+            break;
+        case TYPEDESIGNATION:
+            section = new TypeDesignationSection(this, conversation, parentElement, style);
+            break;
+        case STATE_DATA:
+            section = new StateDataSection(this, conversation, parentElement, style);
+            break;
+        case STATISTICAL_MEASUREMENT_VALUE:
+            section = new StatisticalMeasurementValueSection(this, conversation, parentElement, style);
+            break;
+        case DESCRIBED_SPECIMEN:
+            section = new DescribedSpecimenSection(this, conversation, parentElement, style);
+            break;
+        case COLLECTING_AREA:
+            section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
+            break;
+        case DETERMINATION_CURRENT:
+            section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style);
+            break;
+        case DETERMINATION_HISTORY:
+            section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style);
+            break;
+        case SPECIMEN_COLLECTION:
+            section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
+            break;
+        case IDENTIFIABLE_SOURCE_COLLECTION:
+            section = new SourceCollectionDetailSection(this, conversation, parentElement, style);
+            break;
+        case GEOGRAPHICAL_SCOPE:
+            section = new GeographicalScopeDetailSection(this, conversation, parentElement, style);
+            break;
+        case SCOPE_RESTRICTION:
+            section = new ScopeRestrictionSection(this, conversation, parentElement, style);
+            break;
+        case MEMBER:
+            section = new MemberDetailSection(this, conversation, parentElement, style);
+            break;
+        case GRANTED_AUTHORITY:
+            section = new GrantedAuthorityDetailSection(this, conversation, parentElement, style);
+            break;
+        case GROUPS_BY_USER:
+            section = new GroupsByUserDetailSection(this, conversation, parentElement, style);
+            break;
+        case TAXONOMIC_SCOPE:
+            section = new TaxonomicScopeSection(this, conversation, parentElement, style);
+            break;
+        }
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+    }
+
+    /**
+     * <p>
+     * createEntityCollectionElement
+     * </p>
+     *
+     * @param removeListener
+     *            a {@link org.eclipse.swt.events.SelectionListener} object.
+     * @param style
+     *            a int.
+     * @param parentElement
+     *            a
+     *            {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
+     *            object.
+     * @param versionableEntity
+     *            a {@link eu.etaxonomy.cdm.model.common.IVersionableEntity}
+     *            object.
+     * @param backgroundColor
+     *            a {@link org.eclipse.swt.graphics.Color} object.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement}
+     *         object.
+     */
+    public AbstractEntityCollectionElement createEntityCollectionElement(AbstractFormSection parentElement,
+            Object versionableEntity, SelectionListener removeListener, Color backgroundColor, int style) {
+        AbstractEntityCollectionElement element = null;
+
+        Object entity = HibernateProxyHelper.deproxy(versionableEntity);
+
+        if (entity instanceof Annotation) {
+            element = new AnnotationElement(this, parentElement, (Annotation) entity, removeListener, style);
+        } else if (entity instanceof Person) {
+            element = new TeamMemberElement(this, parentElement, (Person) entity, removeListener, style);
+        } else if (entity instanceof Credit) {
+            element = new CreditElement(this, parentElement, (Credit) entity, removeListener, style);
+        } else if (entity instanceof Extension) {
+            element = new ExtensionElement(this, parentElement, (Extension) entity, removeListener, style);
+        } else if (entity instanceof Marker) {
+            element = new MarkerElement(this, parentElement, (Marker) entity, removeListener, style);
+        } else if (entity instanceof Media) {
+            element = new MediaElement(this, parentElement, (Media) entity, removeListener, style);
+        } else if (entity instanceof MediaRepresentation) {
+            element = new MediaRepresentationElement(this, parentElement, (MediaRepresentation) entity, removeListener,
+                    style);
+        } else if (entity instanceof ImageFile) {
+            element = new ImageFileElement(this, parentElement, (ImageFile) entity, removeListener, style);
+        } else if (entity instanceof MediaRepresentationPart) {
+            element = new MediaRepresentationPartElement(this, parentElement, (MediaRepresentationPart) entity,
+                    removeListener, style);
+        } else if (entity instanceof NomenclaturalStatus) {
+            element = new NomenclaturalStatusElement(this, parentElement, (NomenclaturalStatus) entity, removeListener,
+                    style);
+        } else if (entity instanceof Rights) {
+            element = new RightsElement(this, parentElement, (Rights) entity, removeListener, style);
+        } else if (entity instanceof DescriptionElementSource) {
+            element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
+                    removeListener, style);
+        } else if (entity instanceof IdentifiableSource) {
+            element = new IdentifiableSourceElement(this, parentElement, (IdentifiableSource) entity, removeListener,
+                    style);
+        } else if (entity instanceof Scope) {
+            element = new ScopeElement(this, parentElement, (Scope) entity, removeListener, style);
+        } else if (entity instanceof Modifier) {
+            element = new ModifierElement(this, parentElement, (Modifier) entity, removeListener, style);
+        } else if (entity instanceof Reference) {
+            element = new DescriptionSourceElement(this, parentElement, (Reference) entity, removeListener, style);
+        } else if (entity instanceof NameTypeDesignation) {
+            element = new NameTypeDesignationElement(this, parentElement, (NameTypeDesignation) entity, removeListener,
+                    style);
+        } else if (entity instanceof NameRelationship) {
+            element = new NameRelationshipDetailElement(this, parentElement, (NameRelationship) entity, removeListener,
+                    style);
+        } else if (entity instanceof SpecimenTypeDesignation) {
+            element = new SpecimenTypeDesignationElement(this, parentElement, (SpecimenTypeDesignation) entity,
+                    removeListener, style);
+        } else if (entity instanceof StateData) {
+            element = new StateDataElement(this, parentElement, (StateData) entity, removeListener, style);
+        } else if (entity instanceof StatisticalMeasurementValue) {
+            element = new StatisticalMeasurementValueElement(this, parentElement, (StatisticalMeasurementValue) entity,
+                    removeListener, style);
+        } else if (entity instanceof DerivedUnit) {
+            element = new DerivedUnitElement(this, parentElement, (DerivedUnit) entity, removeListener, style);
+        } else if (entity instanceof NamedArea) {
+            element = new NamedAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
+        } else if (entity instanceof DeterminationEvent) {
+            element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity,
+                    removeListener, style);
+        } else if (entity instanceof Specimen) {
+            element = new SpecimenCollectionDetailElement(this, parentElement, (Specimen) entity, removeListener, style);
+        } else if (entity instanceof User) {
+            element = new MemberDetailElement(this, parentElement, (User) entity, removeListener, style);
+        } else if (entity instanceof GrantedAuthority) {
+            element = new GrantedAuthorityCollectionElement(this, parentElement, (GrantedAuthorityImpl) entity,
+                    removeListener, style);
+        } else if (entity instanceof Group) {
+            element = new GroupsByUserDetailElement(this, parentElement, (Group) entity, removeListener, style);
+        } else if (entity instanceof Taxon) {
+            element = new TaxonDetailElement(this, parentElement, (Taxon) entity, removeListener, style);
+        } else if (entity instanceof DescriptionElementBase) {
+            // this is the special case for protologs, maybe we can do this
+            // differently when API improves
+            DescriptionElementBase descriptionElement = (DescriptionElementBase) entity;
+            if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
+                element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
+            }
+        }
+
+        if (element == null) {
+            AbstractUtility.errorDialog("No element for entity", this,
+                    "Could not generate element for entity. Looks like the case is not handled already. Check implementation. Entity: "
+                            + entity, null);
+        }
+
+        else if (backgroundColor != null && !backgroundColor.isDisposed()) {
+            element.setPersistentBackground(backgroundColor);
+        }
+
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /**
+     * <p>
+     * Creates a selection element for the given type T.
+     * </p>
+     * <p>
+     * <strong>Selection elements not handled by this method:</strong>
+     * <ul>
+     * <li>{@link TaxonNodeSelectionElement} see
+     * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
+     * </li>
+     * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
+     * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
+     * </li>
+     * </ul>
+     * </p>
+     *
+     * @param clazz
+     *            a {@link Class} object of the type that you want the selection
+     *            element to handle
+     * @param parentElement
+     *            a {@link ICdmFormElement} object.
+     * @param labelString
+     *            a {@link String} object.
+     * @param selectionType
+     * @param selection
+     *            a {@link ICdmBase} object.
+     * @param style
+     *            a int.
+     * @param conversation
+     *            a {@link ConversationHolder} object.
+     * @return a {@link EntitySelectionElement} object.
+     */
+    public <T extends ICdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
+            ConversationHolder conversation, ICdmFormElement parentElement, String labelString, T selection, int mode,
+            int style) {
+        EntitySelectionElement<T> element = new EntitySelectionElement<T>(this, conversation, parentElement, clazz,
+                labelString, selection, mode, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    public TaxonNodeSelectionElement createTaxonNodeSelectionElement(ConversationHolder conversation,
+            ICdmFormElement parentElement, String labelString, TaxonNode selection, int mode, int style) {
+        TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this, conversation, parentElement,
+                labelString, selection, mode, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
+            ConversationHolder conversation, ICdmFormElement parentElement, String labelString, Team selection,
+            int mode, int style) {
+        NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this,
+                conversation, parentElement, labelString, selection, mode, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
+    /** {@inheritDoc} */
+    public LabelElement createLabel(ICdmFormElement parentElement, String text) {
+        LabelElement labelElement = new LabelElement(this, parentElement, text);
+        adapt(labelElement);
+        parentElement.addElement(labelElement);
+        return labelElement;
+    }
+
+    /**
+     * <p>
+     * Getter for the field <code>selectionProvider</code>.
+     * </p>
+     *
+     * @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
+     */
+    public ISelectionProvider getSelectionProvider() {
+        return selectionProvider;
+    }
+
+    /**
+     * <p>
+     * createDetailedDescriptionDetailElement
+     * </p>
+     *
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param entity
+     *            a
+     *            {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase}
+     *            object.
+     * @param style
+     *            a int.
+     * @return a
+     *         {@link eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement}
+     *         object.
+     */
+    public AbstractDetailedDescriptionDetailElement createDetailedDescriptionDetailElement(
+            ICdmFormElement parentElement, DescriptionElementBase entity, int style) {
+        AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null;
+
+        if (entity instanceof CategoricalData) {
+            detailedDescriptionElement = new CategoricalDataDetailElement(this, parentElement,
+                    (CategoricalData) entity, style);
+        } else if (entity instanceof CommonTaxonName) {
+            detailedDescriptionElement = new CommonNameDetailElement(this, parentElement, (CommonTaxonName) entity,
+                    style);
+        } else if (entity instanceof Distribution) {
+            detailedDescriptionElement = new DistributionDetailElement(this, parentElement, (Distribution) entity,
+                    style);
+        } else if (entity instanceof IndividualsAssociation) {
+            detailedDescriptionElement = new IndividualsAssociationDetailElement(this, parentElement,
+                    (IndividualsAssociation) entity, style);
+        } else if (entity instanceof QuantitativeData) {
+            detailedDescriptionElement = new QuantitativeDataDetailElement(this, parentElement,
+                    (QuantitativeData) entity, style);
+        } else if (entity instanceof TaxonInteraction) {
+            detailedDescriptionElement = new TaxonInteractionDetailElement(this, parentElement,
+                    (TaxonInteraction) entity, style);
+        } else if (entity instanceof TextData) {
+            detailedDescriptionElement = new TextDataDetailElement(this, parentElement, (TextData) entity, style);
+        } else {
+            throw new IllegalStateException("There is no interface for the given description element");
+        }
+        adapt(detailedDescriptionElement);
+        parentElement.addElement(detailedDescriptionElement);
+        return detailedDescriptionElement;
+
+    }
+
+    /**
+     * Creates a styled text as a part of the form.
+     *
+     * @param parent
+     *            the text parent
+     * @param value
+     *            the text initial value
+     * @param style
+     *            the text style
+     * @return the text widget
+     */
+    public StyledText createStyledText(Composite parent, String value, int style) {
+        StyledText text = new StyledText(parent, getBorderStyle() | style | getOrientation());
+        if (value != null) {
+            text.setText(value);
+        }
+        text.setForeground(getColors().getForeground());
+        text.setBackground(getColors().getBackground());
+        // text.addFocusListener(visibilityHandler);
+        return text;
+    }
 
 }
index 33263074f1bbd20b5b06ab5c2c113dc4c065710a..878788b3150d8c646ecffa2e7c863a67ca8a81c6 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.element;
 
@@ -22,201 +22,200 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * <p>
  * TextWithLabelElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @version $Id: $
  */
-public class TextWithLabelElement extends AbstractCdmFormElement implements
-               ModifyListener, IEnableableFormElement, ISelectable {
-
-       protected Text text;
-       private Label label;
-
-       /** Constant <code>MAX_HEIGHT=0</code> */
-       public static final int MAX_HEIGHT = 0;
-       /** Constant <code>SINGLE=-1</code> */
-       public static final int SINGLE = -1;
-
-       /**
-        * <p>
-        * Constructor for TextWithLabelElement.
-        * </p>
-        * 
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param parentElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @param labelString
-        *            a {@link java.lang.String} object.
-        * @param initialText
-        *            a {@link java.lang.String} object.
-        * @param textHeight
-        *            a {@link java.lang.Integer} object.
-        * @param style
-        *            a int.
-        */
-       protected TextWithLabelElement(CdmFormFactory formFactory,
-                       ICdmFormElement parentElement, String labelString,
-                       String initialText, Integer textHeight, int style) {
-               super(formFactory, parentElement);
-
-               if (labelString != null) {
-                       label = formFactory.createLabel(getLayoutComposite(),
-                                       CdmUtils.Nz(labelString), SWT.NULL);
-                       addControl(label);
-                       label.setLayoutData(LayoutConstants.LEFT());
-               }
-
-               int scrollStyle = textHeight == null ? SWT.NULL
-                               : (SWT.V_SCROLL | SWT.MULTI);
-               
-               int combinedStyle = style | SWT.BORDER | scrollStyle;
-               
-               //SWT.PASSWORD does not work when SWT.WRAP is set. 
-               if(style != SWT.PASSWORD){
-                       combinedStyle = combinedStyle | SWT.WRAP;
-               }               
-               
-               text = formFactory.createText(getLayoutComposite(), "", combinedStyle);
-
-               addControl(text);
-
-               // text.setWO
-
-               if (textHeight == null) {
-                       text.addKeyListener(new KeyAdapter() {
-                               @Override
-                               public void keyPressed(KeyEvent e) {
-                                       if (e.character == SWT.CR) {
-                                               // Don't accept carriage returns as input when in single
-                                               // line mode
-                                               e.doit = false;
-                                       } else if (e.character == SWT.TAB) {
-                                               // traverse is not working for wrapped text widgets so
-                                               // we reintroduce it here
-                                               e.doit = false;
-                                               TextWithLabelElement.this.text
-                                                               .traverse(SWT.TRAVERSE_TAB_NEXT);
-                                       }
-                               }
-                       });
-               }
-
-               TableWrapData layoutData = LayoutConstants.FILL();
-               if (textHeight != null && textHeight > 0) {
-                       (layoutData).heightHint = textHeight;
-               }
-
-               text.setLayoutData(layoutData);
-
-               text.addModifyListener(this);
-
-               setText(initialText);
-       }
-
-       /**
-        * Get the text of this composites text composite
-        * 
-        * @return a {@link java.lang.String} object.
-        */
-       public String getText() {
-               return text.getText();
-       }
-
-       /**
-        * Set the text of this composites text composite
-        * 
-        * @param string
-        *            a {@link java.lang.String} object.
-        */
-       public void setText(String string) {
-               Listener[] listeners = text.getListeners(SWT.Modify);
-
-               for (Listener listener : listeners) {
-                       text.removeListener(SWT.Modify, listener);
-               }
-
-               text.setText(CdmUtils.Nz(string));
-
-               for (Listener listener : listeners) {
-                       text.addListener(SWT.Modify, listener);
-               }
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events
-        * .ModifyEvent)
-        */
-       /** {@inheritDoc} */
-       public void modifyText(ModifyEvent e) {
-               firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
-       }
-
-       /** {@inheritDoc} */
-       public void setEnabled(boolean enabled) {
-               text.setEnabled(enabled);
-               String symbolicName = enabled ? Resources.COLOR_FONT_DEFAULT
-                               : Resources.COLOR_TEXT_DISABLED;
-               text.setForeground(getColor(symbolicName));
-       }
-
-       /** {@inheritDoc} */
-       public void setIrrelevant(boolean irrelevant) {
-               String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT
-                               : Resources.COLOR_COMPOSITE_BACKGROUND;
-
-               Color color = getColor(colorId);
-               text.setBackground(color);
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void setBackground(Color color) {
-               if (label != null)
-                       label.setBackground(color);
-       }
-
-       @Override
-       public void setSelected(boolean selected) {
-               setBackground(selected ? SELECTED : getPersistentBackground());
-       }
-       
-       /*
-        * (non-Javadoc)
-        * 
-        * @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#setFocus()
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void setFocus() {
-               text.setFocus();
-       }
-
-       /**
-        * <p>
-        * getMainControl
-        * </p>
-        * 
-        * @return a {@link org.eclipse.swt.widgets.Control} object.
-        */
-       public Control getMainControl() {
-               return text;
-       }
-
-       /**
-        * <p>
-        * setTextLimit
-        * </p>
-        * 
-        * @param limit
-        *            a int.
-        */
-       public void setTextLimit(int limit) {
-               text.setTextLimit(limit);
-       }
+public class TextWithLabelElement extends AbstractCdmFormElement implements ModifyListener, IEnableableFormElement,
+        ISelectable {
+
+    protected Text text;
+    private Label label;
+
+    /** Constant <code>MAX_HEIGHT=0</code> */
+    public static final int MAX_HEIGHT = 0;
+    /** Constant <code>SINGLE=-1</code> */
+    public static final int SINGLE = -1;
+
+    /**
+     * <p>
+     * Constructor for TextWithLabelElement.
+     * </p>
+     *
+     * @param formFactory
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
+     *            object.
+     * @param parentElement
+     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+     *            object.
+     * @param labelString
+     *            a {@link java.lang.String} object.
+     * @param initialText
+     *            a {@link java.lang.String} object.
+     * @param textHeight
+     *            a {@link java.lang.Integer} object.
+     * @param style
+     *            a int.
+     * @wbp.parser.entryPoint
+     */
+    protected TextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
+            String initialText, Integer textHeight, int style) {
+        super(formFactory, parentElement);
+
+        if (labelString != null) {
+            label = formFactory.createLabel(getLayoutComposite(), CdmUtils.Nz(labelString), SWT.NULL);
+            addControl(label);
+            label.setLayoutData(LayoutConstants.LEFT());
+        }
+
+        int scrollStyle = textHeight == null ? SWT.NULL : (SWT.V_SCROLL | SWT.MULTI);
+
+        int combinedStyle = style | SWT.BORDER | scrollStyle;
+
+        // SWT.PASSWORD does not work when SWT.WRAP is set.
+        if (style != SWT.PASSWORD) {
+            combinedStyle = combinedStyle | SWT.WRAP;
+        }
+
+        text = formFactory.createText(getLayoutComposite(), "", combinedStyle);
+
+        addControl(text);
+
+        // text.setWO
+
+        if (textHeight == null) {
+            text.addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyPressed(KeyEvent e) {
+                    if (e.character == SWT.CR) {
+                        // Don't accept carriage returns as input when in single
+                        // line mode
+                        e.doit = false;
+                    } else if (e.character == SWT.TAB) {
+                        // traverse is not working for wrapped text widgets so
+                        // we reintroduce it here
+                        e.doit = false;
+                        TextWithLabelElement.this.text.traverse(SWT.TRAVERSE_TAB_NEXT);
+                    }
+                }
+            });
+        }
+
+        TableWrapData layoutData = LayoutConstants.FILL();
+        if (textHeight != null && textHeight > 0) {
+            (layoutData).heightHint = textHeight;
+        }
+
+        text.setLayoutData(layoutData);
+
+        text.addModifyListener(this);
+
+        setText(initialText);
+    }
+
+    /**
+     * Get the text of this composites text composite
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getText() {
+        return text.getText();
+    }
+
+    /**
+     * Set the text of this composites text composite
+     *
+     * @param string
+     *            a {@link java.lang.String} object.
+     */
+    public void setText(String string) {
+        Listener[] listeners = text.getListeners(SWT.Modify);
+
+        for (Listener listener : listeners) {
+            text.removeListener(SWT.Modify, listener);
+        }
+
+        text.setText(CdmUtils.Nz(string));
+
+        for (Listener listener : listeners) {
+            text.addListener(SWT.Modify, listener);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events
+     * .ModifyEvent)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void modifyText(ModifyEvent e) {
+        firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setEnabled(boolean enabled) {
+        text.setEnabled(enabled);
+        String symbolicName = enabled ? Resources.COLOR_FONT_DEFAULT : Resources.COLOR_TEXT_DISABLED;
+        text.setForeground(getColor(symbolicName));
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setIrrelevant(boolean irrelevant) {
+        String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_COMPOSITE_BACKGROUND;
+
+        Color color = getColor(colorId);
+        text.setBackground(color);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setBackground(Color color) {
+        if (label != null) {
+            label.setBackground(color);
+        }
+    }
+
+    @Override
+    public void setSelected(boolean selected) {
+        setBackground(selected ? SELECTED : getPersistentBackground());
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#setFocus()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void setFocus() {
+        text.setFocus();
+    }
+
+    /**
+     * <p>
+     * getMainControl
+     * </p>
+     *
+     * @return a {@link org.eclipse.swt.widgets.Control} object.
+     */
+    public Control getMainControl() {
+        return text;
+    }
+
+    /**
+     * <p>
+     * setTextLimit
+     * </p>
+     *
+     * @param limit
+     *            a int.
+     */
+    public void setTextLimit(int limit) {
+        text.setTextLimit(limit);
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement2.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement2.java
new file mode 100644 (file)
index 0000000..8837628
--- /dev/null
@@ -0,0 +1,35 @@
+// $Id$
+/**
+* Copyright (C) 2013 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.element;
+
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author pplitzner
+ * @date 11.06.2013
+ *
+ */
+public class TextWithLabelElement2 extends Composite {
+
+    /**
+     * Create the composite.
+     * @param parent
+     * @param style
+     */
+    public TextWithLabelElement2(Composite parent, int style) {
+        super(parent, style);
+
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+}
index ff6292ab6f0ff8284ddb664a8066527e6b2808a5..4704d2b24f15e6283effeb2466a3e75cee169197 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -21,27 +21,24 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
-import eu.etaxonomy.taxeditor.ui.element.ISelectable;
 
 /**
  * <p>
  * Abstract AbstractCdmDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Feb 26, 2010
  * @version 1.0
  */
-public abstract class AbstractCdmDetailElement<T> extends
-               AbstractCdmFormElement implements IEntityElement<T>,
-               IEnableableFormElement, IConversationEnabled, ISelectable {
+public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement implements IEntityElement<T>, IEnableableFormElement, IConversationEnabled {
 
        private T entity;
 
@@ -51,7 +48,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * Constructor for AbstractCdmDetailElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -63,14 +60,14 @@ public abstract class AbstractCdmDetailElement<T> extends
         */
        public AbstractCdmDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
-               super(formFactory, (ICdmFormElement) formElement);
+               super(formFactory, formElement);
                // register as property change listener
                formFactory.addPropertyChangeListener(this);
        }
 
        /**
         * Sets the entity and updates controls
-        * 
+        *
         * @param entity
         *            a T object.
         */
@@ -81,17 +78,18 @@ public abstract class AbstractCdmDetailElement<T> extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
         */
        /**
         * <p>
         * Getter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @return a T object.
         */
-       public T getEntity() {
+       @Override
+    public T getEntity() {
                return entity;
        }
 
@@ -106,12 +104,13 @@ public abstract class AbstractCdmDetailElement<T> extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.ISelectableComposite#setSelected(boolean)
         */
        /** {@inheritDoc} */
-       public void setSelected(boolean selected) {
+       @Override
+    public void setSelected(boolean selected) {
                Composite section = getLayoutComposite().getParent();
                section.setBackground(selected ? SELECTED : getPersistentBackground());
        }
@@ -119,7 +118,7 @@ public abstract class AbstractCdmDetailElement<T> extends
        /**
         * Sets all field to the given enablement state except the objects in
         * collection except
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#setEnabled(boolean)
         * @param enabled
         *            a boolean.
@@ -143,7 +142,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * Setter for the field <code>irrelevant</code>.
         * </p>
-        * 
+        *
         * @param irrelevant
         *            a boolean.
         * @param except
@@ -168,19 +167,21 @@ public abstract class AbstractCdmDetailElement<T> extends
        }
 
        /** {@inheritDoc} */
-       public void setEnabled(boolean enabled) {
+       @Override
+    public void setEnabled(boolean enabled) {
                setEnabled(enabled, null);
        }
 
        /** {@inheritDoc} */
-       public void setIrrelevant(boolean irrelevant) {
+       @Override
+    public void setIrrelevant(boolean irrelevant) {
                this.irrelevant = irrelevant;
                setIrrelevant(irrelevant, null);
        }
 
        /**
         * Create all content elements
-        * 
+        *
         * @param formElement
         *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
         *            object.
@@ -246,7 +247,7 @@ public abstract class AbstractCdmDetailElement<T> extends
        /**
         * Gets called when the source of the event is a child widget of this
         * widget.
-        * 
+        *
         * @param eventSource
         *            a {@link java.lang.Object} object.
         */
@@ -256,7 +257,7 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * handleException
         * </p>
-        * 
+        *
         * @param event
         *            a
         *            {@link eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent}
@@ -264,14 +265,14 @@ public abstract class AbstractCdmDetailElement<T> extends
         */
        public void handleException(CdmPropertyChangeEvent event) {
                // override this in subclasses if you want to deal with the error
-               StoreUtil.error(event.getSource().getClass(), event.getException());
+               AbstractUtility.error(event.getSource().getClass(), event.getException());
        }
 
        /**
         * <p>
         * isIrrelevant
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public boolean isIrrelevant() {
@@ -282,11 +283,12 @@ public abstract class AbstractCdmDetailElement<T> extends
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                if (getParentElement() instanceof IConversationEnabled) {
                        return ((IConversationEnabled) getParentElement())
                                        .getConversationHolder();
@@ -296,6 +298,7 @@ public abstract class AbstractCdmDetailElement<T> extends
        }
 
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {
        }
 }
index 0d013aa17f49c7342744698dee0cb820bb4a4d2a..ee222adad8914b47c7c1daafd4e324e88cfd723b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -17,7 +17,7 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.events.ExpansionEvent;
 import org.eclipse.ui.forms.events.IExpansionListener;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -27,28 +27,25 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
 import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 
 /**
- * <p>
- * Abstract AbstractCdmDetailSection class.
- * </p>
- * 
+ * This class visualizes an CDM entity of type ENTITY.
+ *
+ * @param <ENTITY> A CDM entity which should be visualized by this section.
+ *
  * @author n.hoffmann
  * @created Feb 26, 2010
  * @version 1.0
  */
-public abstract class AbstractCdmDetailSection<ENTITY> extends
-               AbstractFormSection<ENTITY> implements IEnableableFormElement,
-               IExpansionListener {
+public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSection<ENTITY> implements IEnableableFormElement, IExpansionListener {
 
-       protected AbstractCdmDetailElement<ENTITY> detailElement;
+       private AbstractCdmDetailElement<ENTITY> detailElement;
 
        /**
         * <p>
         * Constructor for AbstractCdmDetailSection.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -68,27 +65,26 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
        public AbstractCdmDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, parentElement, selectionProvider,
-                               Section.CLIENT_INDENT | style);
-
-               setText(getHeading());
+           this(formFactory, null, conversation, parentElement, selectionProvider, style);
+       }
 
-               addExpansionListener(this);
 
-               createControls(this, SWT.NULL);
-       }
-       
        public AbstractCdmDetailSection(CdmFormFactory formFactory, Class<ENTITY> clazz,
                        ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, parentElement, selectionProvider,
-                               Section.CLIENT_INDENT | style);
-               
-               setText(getHeading());
+                               ExpandableComposite.CLIENT_INDENT | style);
 
-               addExpansionListener(this);
+        setText(getHeading());
 
-               createControlsByType(this, clazz, SWT.NULL);
+        addExpansionListener(this);
+
+        if(clazz==null){
+            createControls(this, style);
+        }
+        else{
+            createControlsByType(this, clazz, SWT.NULL);
+        }
        }
 
        /**
@@ -96,9 +92,18 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
         * @param definedTermClass
         * @param null1
         */
-       protected void createControlsByType(
-                       AbstractCdmDetailSection<ENTITY> abstractCdmDetailSection,
-                       Class<ENTITY> entityClass, int style) {
+       protected void createControlsByType(AbstractCdmDetailSection<ENTITY> formElement, Class<ENTITY> entityClass, int style) {
+           TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
+           layout.topMargin = 10;
+           layout.numColumns = 2;
+
+           getLayoutComposite().setLayout(layout);
+           if(entityClass==null){
+               detailElement = createCdmDetailElement(formElement, style);
+           }
+           else{
+               detailElement = createCdmDetailElementByType(formElement, entityClass, style);
+           }
        }
 
 
@@ -106,7 +111,7 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
         * <p>
         * createControls
         * </p>
-        * 
+        *
         * @param formElement
         *            a
         *            {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection}
@@ -114,34 +119,21 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
         * @param style
         *            a int.
         */
-       protected void createControls(AbstractCdmDetailSection<ENTITY> formElement,
-                       int style) {
-               TableWrapLayout layout = (TableWrapLayout) getLayoutComposite()
-                               .getLayout();
-               layout.topMargin = 10;
-               layout.numColumns = 2;
-
-               getLayoutComposite().setLayout(layout);
-               detailElement = formFactory.createCdmDetailElement(getDetailType(),
-                               formElement, style);
+       protected void createControls(AbstractCdmDetailSection<ENTITY> formElement, int style) {
+           createControlsByType(formElement, null, style);
        }
 
-       /**
-        * <p>
-        * getDetailType
-        * </p>
-        * 
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
-        *         object.
-        */
-       protected abstract DetailType getDetailType();
+       protected abstract AbstractCdmDetailElement<ENTITY> createCdmDetailElement(AbstractCdmDetailSection<ENTITY> parentElement, int style);
+
+       protected AbstractCdmDetailElement<ENTITY> createCdmDetailElementByType(AbstractCdmDetailSection<ENTITY> parentElement, Class<ENTITY> entityClass, int style){
+           return createCdmDetailElement(parentElement, style);
+       }
 
        /**
         * <p>
         * getHeading
         * </p>
-        * 
+        *
         * @return the heading for this section
         */
        public abstract String getHeading();
@@ -161,7 +153,7 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.section.AbstractEditorFormSection#setBackground
         * (org.eclipse.swt.graphics.Color)
@@ -179,7 +171,7 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
         * <p>
         * setEntity
         * </p>
-        * 
+        *
         * @param entity
         *            a ENTITY object.
         */
@@ -228,19 +220,22 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends
        }
 
        /** {@inheritDoc} */
-       public void setIrrelevant(boolean irrelevant) {
+       @Override
+    public void setIrrelevant(boolean irrelevant) {
                if (detailElement != null) {
                        detailElement.setIrrelevant(irrelevant);
                }
        }
 
        /** {@inheritDoc} */
-       public void expansionStateChanging(ExpansionEvent e) {
+       @Override
+    public void expansionStateChanging(ExpansionEvent e) {
                // logger.warn("Expansion State Changing");
        }
 
        /** {@inheritDoc} */
-       public void expansionStateChanged(ExpansionEvent e) {
+       @Override
+    public void expansionStateChanged(ExpansionEvent e) {
                // logger.warn("Expansion State Changed");
        }
 }
index 1a9f43ee577c869e74cbd59b9fb1deb56d87e0f4..ecc7c9107e8a6ed102df8893b5465e78a04a5525 100644 (file)
@@ -1,11 +1,12 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section;
 
 import java.util.Collection;
 
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.ToolBarManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
@@ -19,37 +20,42 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.events.ExpansionEvent;
 import org.eclipse.ui.forms.events.IExpansionListener;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
-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;
 
 /**
- * <p>Abstract AbstractEntityCollectionSection class.</p>
+ * This class visualizes an CDM entity of type ENTITY and additionally provides the functionality to add
+ * other elements of type ELEMENT to them.
+ *
+ * @param <ENTITY> A CDM entity which should be visualized by this section.
+ * @param <ELEMENT> An element that can be added (multiple times) to this entity.
  *
  * @author n.hoffmann
  * @version $Id: $
  */
+
 public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends AbstractFormSection<ENTITY> implements IExpansionListener{
-               
+
        protected Composite container;
-       
+
        private Label label_empty;
 
        private String title;
-       
+
        /**
         * <p>Constructor for AbstractEntityCollectionSection.</p>
         *
-        * @param conversation 
+        * @param conversation
         * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
         * @param style a int.
         * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
@@ -58,18 +64,18 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
         * @param <ELEMENT> a ELEMENT object.
         */
        public AbstractEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, String title, int style) {
-               super(formFactory, parentElement, Section.CLIENT_INDENT | style);
+               super(formFactory, parentElement, ExpandableComposite.CLIENT_INDENT | style);
                this.title = title;
                this.setText(getTitleString());
                showToolbar();
-               
+
                addExpansionListener(this);
        }
-       
+
        protected Control createToolbar() {
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-               
-               Action addAction = new Action("add", Action.AS_PUSH_BUTTON){
+
+               Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
                        /* (non-Javadoc)
                         * @see org.eclipse.jface.action.Action#run()
                         */
@@ -78,34 +84,35 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
                                ELEMENT element = createNewElement();
                                if(element != null){
                                        addElement(element);
-                                       if(! getSection().isExpanded())
-                                               getSection().setExpanded(true);
+                                       if(! getSection().isExpanded()) {
+                        getSection().setExpanded(true);
+                    }
                                        internalUpdateSection(true);
                                }
                        }
                };
                addAction.setImageDescriptor(new ImageDescriptor() {
-                       
+
                        @Override
                        public ImageData getImageData() {
                                return ImageResources.getImage(ImageResources.ADD_ICON).getImageData();
                        }
                });
                addAction.setToolTipText(getTooltipString());
-               
+
                toolBarManager.add(addAction);
-               
+
                return toolBarManager.createControl(this);
        }
-       
+
        public void showToolbar(){
                setTextClient(createToolbar());
        }
-       
+
        public void removeToolbar(){
                setTextClient(null);
        }
-       
+
        /**
         * <p>setEntity</p>
         *
@@ -119,8 +126,8 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
                }
                setSectionTitle();
                layout();
-       };
-               
+       }
+
        /**
         * Sets the title for the section. Adds a "+" sign if the collection is not empty for this section.
         * Override in subclasses if you want to have a different behaviour.
@@ -132,7 +139,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
                        this.setText(getTitleString());
                }
        }
-       
+
        /**
         * Removes all content from the container
         */
@@ -143,7 +150,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
                }
                removeElements();
        }
-       
+
        /**
         * Call this method after dynamically changing the client area.
         * If the options changed is set to true, will also fire a state changed
@@ -153,57 +160,59 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
         */
        protected void internalUpdateSection(boolean changed){
                destroyDynamicContent();
-               if(isExpanded() || expandSectionWhenContentAvailable())
-                       renderContent(isExpanded());
-               if(changed)
-                       firePropertyChangeEvent(this);
+               if(isExpanded() || expandSectionWhenContentAvailable()) {
+            renderContent(isExpanded());
+        }
+               if(changed) {
+            firePropertyChangeEvent(this);
+        }
        }
 
        /**
-        * Create the elements to be shown in this seciton client area 
+        * Create the elements to be shown in this section client area
         */
        private void renderContent(boolean forceExpansion)
        {
                Collection<ELEMENT> elements = getCollection(getEntity());
-               
+
                if(elements == null || elements.isEmpty()){
                        createEmptyContent();
                }else{
                        createDynamicContents(elements);
                        forceExpansion = true;
                }
-               
+
                this.setExpanded(forceExpansion);
-               
+
                reflow();
        }
-       
+
        /**
         * <p>createEmptyContent</p>
         */
        protected void createEmptyContent(){
                label_empty = formFactory.createLabel(getLayoutComposite(), getEmptyString());
        }
-       
+
        /**
         * Creates the widgets for the collection
         *
         * @param elements a {@link java.util.Collection} object.
         */
        protected void createDynamicContents(Collection<ELEMENT> elements)
-       {               
+       {
                int i = 0;
                for(final ELEMENT element : elements){
                        SelectionAdapter removeListener = new SelectionAdapter(){
                                @Override
                                public void widgetSelected(SelectionEvent e) {
-                                       removeElement(element);                                 
+                                       removeElement(element);
                                        internalUpdateSection(true);
                                }
                        };
                        boolean modulo = i++%2 == 0;
                        String colorResource = modulo ? Resources.COLOR_LIST_EVEN : Resources.COLOR_LIST_ODD;
-                       createElementComposite(element, removeListener, StoreUtil.getColor(colorResource));
+                       createElementComposite(element, removeListener, AbstractUtility.getColor(colorResource));
                }
        }
 
@@ -217,7 +226,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
        protected void createElementComposite(ELEMENT element, SelectionListener removeListener, Color backgroundColor){
                formFactory.createEntityCollectionElement(this, element, removeListener, backgroundColor, SWT.NULL);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.section.AbstractEditorFormSection#setBackground(org.eclipse.swt.graphics.Color)
         */
@@ -238,7 +247,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
        public String getTitleString() {
                return CdmUtils.Nz(title);
        }
-       
+
        /**
         * <p>setTitleString</p>
         *
@@ -249,25 +258,27 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
                setSectionTitle();
                layout();
        }
-       
+
        /** {@inheritDoc} */
-       public void expansionStateChanging(ExpansionEvent e) {
+       @Override
+    public void expansionStateChanging(ExpansionEvent e) {
 //             logger.warn("Expansion State Changing");
        }
-       
+
        /** {@inheritDoc} */
-       public void expansionStateChanged(ExpansionEvent e) {
+       @Override
+    public void expansionStateChanged(ExpansionEvent e) {
                if(isExpanded()){
                        renderContent(isExpanded());
                }else{
                        destroyDynamicContent();
                }
        }
-       
+
        private boolean expandSectionWhenContentAvailable(){
                return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOULD_EXPAND_SECTION_WHEN_DATA_AVAILABLE);
        }
-       
+
        /**
         * Get the specific collection of this entity
         *
@@ -275,39 +286,39 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT> extends A
         * @return a {@link java.util.Collection} object.
         */
        public abstract Collection<ELEMENT> getCollection(ENTITY entity);
-       
+
        /**
         * Create a new Element for this collection
         *
         * @return a ELEMENT object.
         */
        public abstract ELEMENT createNewElement();
-       
+
        /**
         * Add an element to the entities collection
         *
         * @param element a ELEMENT object.
         */
        public abstract void addElement(ELEMENT element);
-       
+
        /**
         * Remove an element from the entities collection
         *
         * @param element a ELEMENT object.
         */
        public abstract void removeElement(ELEMENT element);
-       
+
        /**
         * String to display when the collection is empty
         *
         * @return a {@link java.lang.String} object.
         */
        public abstract String getEmptyString();
-       
+
        /**
         * <p>getTooltipString</p>
         *
         * @return String to display when hovering the add button
         */
-       protected abstract String getTooltipString();   
+       protected abstract String getTooltipString();
 }
index bf510748c0b7c858abd7e245e24067f9e48c27e2..11e4a2d99af794295747a17584dc4f846b11d83e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Institution;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -40,19 +40,19 @@ public class InstitutionDetailSection extends AbstractCdmDetailSection<Instituti
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.INSTITUTION;
+       public String getHeading() {
+               return "Institution";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Institution";
+       protected AbstractCdmDetailElement<Institution> createCdmDetailElement(AbstractCdmDetailSection<Institution> parentElement, int style) {
+           return formFactory.createInstitutionDetailElement(parentElement);
        }
 
 }
index 0c0656b635378414d3715fd4942d840c15d77104..5f4933cba4ef5653106741682ffa7cff0b7fa144 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 package eu.etaxonomy.taxeditor.ui.section.agent;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -38,19 +35,17 @@ public class InstitutionWizardPage extends
                super(formFactory, conversation, entity);
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
-       @Override
-       public AbstractCdmDetailElement<Institution> createElement(ICdmFormElement rootElement) {
-               InstitutionDetailElement detailElement = (InstitutionDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.INSTITUTION, rootElement,
-                                               SWT.NULL);
-               detailElement.setEntity(entity);
-               return detailElement;
-       }
+           /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
+     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+     */
+    @Override
+    public AbstractCdmDetailElement<Institution> createElement(ICdmFormElement rootElement) {
+        InstitutionDetailElement detailElement = formFactory.createInstitutionDetailElement(rootElement);
+        detailElement.setEntity(entity);
+        return detailElement;
+    }
 }
index 77e6277e6f8c7b9a549815400891b68fdc54bc6b..7821e7a022f15efce0702bd700fceb240d782704 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -44,13 +44,15 @@ public class PersonDetailSection extends AbstractCdmDetailSection<Person>{
 
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.PERSON;
+       public String getHeading() {
+               return "Person";
        }
 
-       /** {@inheritDoc} */
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       public String getHeading() {
-               return "Person";
+       protected AbstractCdmDetailElement<Person> createCdmDetailElement(AbstractCdmDetailSection<Person> parentElement, int style) {
+           return formFactory.createPersonDetailElement(parentElement, style);
        }
 }
index 75fecc33702b2672c26efc3af81e6e899037340c..51ab6ad03799fdf66dd1a567339f3e14664e2b5f 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,7 +17,6 @@ import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
@@ -41,15 +40,15 @@ public class PersonWizardPage extends AbstractCdmEntityWizardPage<Person> {
                super(formFactory, conversation, entity);
                setTitle("Person");
        }
-       
-       
+
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<Person> createElement(ICdmFormElement rootElement) {
-               PersonDetailElement personElement = (PersonDetailElement) formFactory.createCdmDetailElement(DetailType.PERSON, rootElement, SWT.NULL);
+               PersonDetailElement personElement = formFactory.createPersonDetailElement(rootElement, SWT.NULL);
                personElement.setEntity(entity);
                return personElement;
        }
index 8752f86de666a2aff7f3ab8144f93168040c94e7..bacd6b548cd6c0302b89f23d542d7cb7710aab4b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Team;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -44,13 +44,15 @@ public class TeamDetailSection extends AbstractCdmDetailSection<Team>{
 
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.TEAM;
+       public String getHeading() {
+               return "Team";
        }
 
-       /** {@inheritDoc} */
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       public String getHeading() {
-               return "Team";
+       protected AbstractCdmDetailElement<Team> createCdmDetailElement(AbstractCdmDetailSection<Team> parentElement, int style) {
+           return formFactory.createTeamDetailElement(parentElement, style);
        }
 }
index 77808b23d48950f7a7534cdbee30827db98923b7..578d220b26eb28124b25f57d5de3464f09d6daec 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,9 +16,10 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -43,12 +44,6 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.TEAMORPERSONBASE;
-       }
 
        /** {@inheritDoc} */
        @Override
@@ -62,4 +57,14 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
                }
                return "Team or Person";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<TeamOrPersonBase> createCdmDetailElement(AbstractCdmDetailSection<TeamOrPersonBase> parentElement, int style) {
+           AbstractUtility.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
+           //TODO DetailElement missing??
+           return null;
+       }
 }
index bbabd642afbab04ce72d0afd09ebdc33b665bfb0..9016f92c6e2a4a41dba32c84e313d2fd2e35ac00 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -17,14 +17,13 @@ import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
  * <p>
  * TeamWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Jun 1, 2010
  * @version 1.0
@@ -35,7 +34,7 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
         * <p>
         * Constructor for TeamWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -55,8 +54,7 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
        @Override
        public AbstractCdmDetailElement<Team> createElement(
                        ICdmFormElement rootElement) {
-               TeamDetailElement teamElement = (TeamDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.TEAM, rootElement, SWT.NULL);
+               TeamDetailElement teamElement = formFactory.createTeamDetailElement(rootElement, SWT.NULL);
                teamElement.setEntity(entity);
                return teamElement;
        }
index c3e67fe2e0d7bd2e16156e388b900b0279b43b9b..83eb7ee1543bc44d79ab2e0a10cba1e9e8f25091 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class ClassificationDetailSection extends AbstractCdmDetailSection<Classification> {
-       
+
        /**
         * <p>Constructor for ClassificationDetailSection.</p>
         *
@@ -42,7 +42,7 @@ public class ClassificationDetailSection extends AbstractCdmDetailSection<Classi
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
         */
@@ -53,20 +53,19 @@ public class ClassificationDetailSection extends AbstractCdmDetailSection<Classi
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
+       public String getHeading() {
                return null;
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return null;
+       protected AbstractCdmDetailElement<Classification> createCdmDetailElement(AbstractCdmDetailSection<Classification> parentElement, int style) {
+           return formFactory.createClassificationDetailElement(parentElement);
        }
 }
index 0f47182680bca1f9d9c8f0c1a7a006363abedc37..292916ba5399d68ef0a64cf66229bf2044bff306 100644 (file)
@@ -1,29 +1,26 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 /**
  * <p>
  * ClassificationWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created 23.06.2009
  * @version 1.0
@@ -35,7 +32,7 @@ public class ClassificationWizardPage extends
         * <p>
         * Constructor for ClassificationWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -49,24 +46,22 @@ public class ClassificationWizardPage extends
                        ConversationHolder conversation, Classification entity) {
                super(formFactory, conversation, entity);
                setTitle("Classification");
-               
-       }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public ClassificationDetailElement createElement(ICdmFormElement rootElement) {
-               ClassificationDetailElement detailElement = (ClassificationDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.CLASSIFICATION, rootElement,
-                                               SWT.NULL);
-               detailElement.setEntity(getEntity());           
-               return detailElement;
        }
-       
+
+           /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
+     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public ClassificationDetailElement createElement(ICdmFormElement rootElement) {
+        ClassificationDetailElement detailElement = formFactory.createClassificationDetailElement(rootElement);
+        detailElement.setEntity(getEntity());
+        return detailElement;
+    }
+
 }
index 1460d9330e1d2d99e3b04d28ff15a3703cebed95..0508372da8f9116d5969f55247edc163ecfced5b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,16 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class TaxonNodeDetailSection extends AbstractCdmDetailSection<TaxonNode> {
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return null;
-       }
-       
+
        /**
         * <p>Constructor for TaxonNodeDetailSection.</p>
         *
@@ -60,4 +51,13 @@ public class TaxonNodeDetailSection extends AbstractCdmDetailSection<TaxonNode>
        public String getHeading() {
                return null;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<TaxonNode> parentElement, int style) {
+           //FIXME generic
+           return formFactory.createTaxonNodeDetailElement(parentElement);
+       }
 }
index 4db6c49fc5f547c725ac36cb7fa11dbe93f2af18..4f261d545aa00361064feb154708d8f54072bfac 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -11,7 +11,6 @@
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
@@ -19,13 +18,12 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 
 /**
  * <p>
  * TaxonNodeWizardPage class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Sep 15, 2009
  * @version 1.0
@@ -36,7 +34,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
         * <p>
         * Constructor for TaxonNodeWizardPage.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -54,7 +52,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
         * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
@@ -63,9 +61,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
        @Override
        public TaxonNodeDetailElement createElement(ICdmFormElement rootElement) {
 
-               TaxonNodeDetailElement detailElement = (TaxonNodeDetailElement) formFactory
-                               .createCdmDetailElement(DetailType.TAXON_NODE, rootElement,
-                                               SWT.NULL);
+        TaxonNodeDetailElement detailElement = formFactory.createTaxonNodeDetailElement(rootElement);
                detailElement.setEntity(entity);
                formFactory.addPropertyChangeListener(this);
                return detailElement;
@@ -75,7 +71,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
         * <p>
         * openInEditor
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public boolean openInEditor() {
@@ -84,7 +80,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
         * .jface.util.PropertyChangeEvent)
@@ -98,7 +94,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
        }
 
        /**
-        * 
+        *
         */
        @Override
        protected void checkComplete() {
@@ -119,7 +115,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
         * <p>
         * Getter for the field <code>parentTreeNode</code>.
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.model.taxon.ITreeNode} object.
         */
        public ITreeNode getParentTreeNode() {
@@ -133,7 +129,7 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<ITreeNode>
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#dispose()
         */
        /** {@inheritDoc} */
@@ -22,12 +22,12 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @date Dec 1, 2011
  *
  */
-public class RefereneEntityDetailElement extends AbstractCdmDetailElement<ReferencedEntityBase>{
+public class ReferenceEntityDetailElement extends AbstractCdmDetailElement<ReferencedEntityBase>{
 
        private EntitySelectionElement<Reference> selection_reference;
        private TextWithLabelElement text_referenceDetail;
 
-       public RefereneEntityDetailElement(CdmFormFactory formFactory,
+       public ReferenceEntityDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
index f0ade829c97b042a644dcadb8fba674f48a620c3..d9825324dff6423943b6b543588cd228aefa1152 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -31,15 +31,17 @@ public class ReferencedEntityDetailSection extends AbstractCdmDetailSection<Refe
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.REFERENCED_ENTITY;
-       }
-
        @Override
        public String getHeading() {
                return "Reference";
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<ReferencedEntityBase> createCdmDetailElement(AbstractCdmDetailSection<ReferencedEntityBase> parentElement, int style) {
+           return formFactory.createReferenceEntityDetailElement(parentElement);
+       }
 
 }
index 569ebb9b78584a2c62e3f56b59d962b2042a87d9..5cf40dc83b3e5e65939178f357045eb172601438 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -40,18 +40,20 @@ public class DescriptionDetailSection extends AbstractCdmDetailSection<Descripti
        public DescriptionDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
-               
+
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Description";
        }
 
-       /** {@inheritDoc} */
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.DESCRIPTION;
+       protected AbstractCdmDetailElement<DescriptionBase> createCdmDetailElement(AbstractCdmDetailSection<DescriptionBase> parentElement, int style) {
+           return formFactory.createDescriptionDetailElement(parentElement, style);
        }
 }
index 8f43590dd54e9dec345fa2e0bd42c810f92a9dcd..2fe95883904f4c6b43a56b3bf15e2627354f3666 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -22,8 +22,8 @@ import eu.etaxonomy.cdm.model.description.TextData;
 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.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.description.operation.ChangeDescriptionElementType;
 
@@ -36,7 +36,7 @@ import eu.etaxonomy.taxeditor.ui.section.description.operation.ChangeDescription
  */
 public class DescriptionElementDetailSection extends
                AbstractCdmDetailSection<DescriptionElementBase> {
-       
+
        /**
         * <p>Constructor for DescriptionElementDetailSection.</p>
         *
@@ -50,19 +50,20 @@ public class DescriptionElementDetailSection extends
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       
-       protected Control createToolbar() {
+
+
+       @Override
+    protected Control createToolbar() {
                if(! hasSpecificElement()){
                        return null;
                }
-               
+
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-               
+
                final String destinationString = (getEntity() instanceof TextData) ? "the specific element" : "free text";
-               
-               final String label = "Change to " + destinationString; 
-               
+
+               final String label = "Change to " + destinationString;
+
                Action addAction = new Action("Change Type", Action.AS_PUSH_BUTTON) {
                        /* (non-Javadoc)
                         * @see org.eclipse.jface.action.Action#run()
@@ -73,52 +74,54 @@ public class DescriptionElementDetailSection extends
                                                + destinationString + "? Current data will be lost.");
                                if (confirmed) {
                                        // FIXME
-                                       ChangeDescriptionElementType operation = new ChangeDescriptionElementType(label, 
+                                       ChangeDescriptionElementType operation = new ChangeDescriptionElementType(label,
                                                        getEntity(), StoreUtil.getDetailsView(), StoreUtil.getUndoContext());
                                        StoreUtil.executeOperation(operation);
                                }
                        }
                };
-               // TODO enable this once a proper icon has been found 
+               // TODO enable this once a proper icon has been found
 //             addAction.setImageDescriptor(new ImageDescriptor() {
-//                     
+//
 //                     @Override
 //                     public ImageData getImageData() {
 //                             return ImageResources.getImage(ImageResources.ADD_ICON).getImageData();
 //                     }
 //             });
                addAction.setToolTipText(label);
-               
+
                toolBarManager.add(addAction);
-               
+
                return toolBarManager.createControl(this);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Description Element";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DESCRIPTIONELEMENT;
-       }
-       
        /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
                this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));
                setTextClient(createToolbar());
        }
-       
+
        private boolean hasSpecificElement(){
-               return  getEntity().getFeature().isSupportsCategoricalData() 
+               return  getEntity().getFeature().isSupportsCategoricalData()
                                || getEntity().getFeature().isSupportsCommonTaxonName()
                                || getEntity().getFeature().isSupportsDistribution()
                                || getEntity().getFeature().isSupportsIndividualAssociation()
                                || getEntity().getFeature().isSupportsQuantitativeData()
                                || getEntity().getFeature().isSupportsTaxonInteraction();
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<DescriptionElementBase> createCdmDetailElement(AbstractCdmDetailSection<DescriptionElementBase> parentElement, int style) {
+           return formFactory.createDescriptionElementDetailElement(parentElement, style);
+       }
 }
index f82b59c3ce15d818c97ef1e5dc2ce8cf6d56416a..04a0171b1b7d09d74d1626003dbcb9aff67498a5 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,8 +17,8 @@ import org.eclipse.ui.forms.widgets.TableWrapLayout;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.media.MediaElement;
 
@@ -47,16 +47,7 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return null;
-       }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void createControls(AbstractCdmDetailSection formElement,
@@ -64,18 +55,19 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
                TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
                layout.topMargin = 10;
                layout.numColumns = 2;
-               
+
                getLayoutComposite().setLayout(layout);
-               
-               
+
+
        }
-       
+
        /**
         * <p>setEntity</p>
         *
         * @param entity a {@link eu.etaxonomy.cdm.model.media.Media} object.
         */
-       public void setEntity(Media entity) {
+       @Override
+    public void setEntity(Media entity) {
                if(element_media != null){
                        this.removeElements();
                }
@@ -94,4 +86,12 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
        public String getHeading() {
                return "Image";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<Media> createCdmDetailElement(AbstractCdmDetailSection<Media> parentElement, int style) {
+           return null;
+       }
 }
index e073f7e3a38aeaea89c675187e88e89dee8a2c25..ee928e4e381f1968d84b0145dbd06817ddc5772c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class NaturalLanguageSection extends AbstractCdmDetailSection<TaxonDescription> {
-       
+
        /**
         * <p>Constructor for NaturalLanguageSection.</p>
         *
@@ -42,22 +42,21 @@ public class NaturalLanguageSection extends AbstractCdmDetailSection<TaxonDescri
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.NATURAL_LANGUAGE;
+       public String getHeading() {
+               return "Natural Language Description";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return "Natural Language Description";
+       protected AbstractCdmDetailElement<TaxonDescription> createCdmDetailElement(AbstractCdmDetailSection<TaxonDescription> parentElement, int style) {
+           return formFactory.createNaturalLanguageDetailElement(parentElement);
        }
 }
index 84aeb25ec64a58e5ca68f89d546a73679d2cc70b..456fc997f3569aca86f576cd8a45d468261a8125 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Feature;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class FeatureDistributionDetailSection extends AbstractCdmDetailSection<Feature> {
-       
+
        /**
         * <p>Constructor for FeatureDistributionDetailSection.</p>
         *
@@ -42,22 +42,22 @@ public class FeatureDistributionDetailSection extends AbstractCdmDetailSection<F
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.FEATURE_DISTRIBUTION;
+       public String getHeading() {
+               return "Distribution Map";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return "Distribution Map";
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<Feature> parentElement, int style) {
+           //FIXME generic
+           return formFactory.createFeatureDistributionDetailElement(parentElement);
        }
 }
index 47d911def13d98047f3a14b1ee733ead823e036a..3fd5b3887f93fcbc7639bc8b83045f302dca68be 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.ui.section.grantedAuthority;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
@@ -34,7 +31,7 @@ public class GrantedAuthorityDetailWizardPage extends AbstractCdmEntityWizardPag
        @Override
        public AbstractCdmDetailElement<GrantedAuthorityImpl> createElement(
                        ICdmFormElement rootElement) {
-               GrantedAuthorityDetailElement authorityElement = (GrantedAuthorityDetailElement) formFactory.createCdmDetailElement(DetailType.GRANTEDAUTHORITY, rootElement, SWT.NULL);
+               GrantedAuthorityDetailElement authorityElement = formFactory.createGrantedAuthorityDetailElement(rootElement);
                authorityElement.setEntity(getEntity());
                return authorityElement;
        }
index 9d66d8208c1c5cdb636b6c6475aa8d41a041b7c8..e5543bd3496daa996eeeceb3fc2b680b05f946a7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.Group;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -40,19 +40,19 @@ public class GroupDetailSection extends AbstractCdmDetailSection<Group> {
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.GROUP;
+       public String getHeading() {
+               return "Group " + (getEntity() != null ? getEntity().getName() : "");
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Group " + (getEntity() != null ? getEntity().getName() : "");
+       protected AbstractCdmDetailElement<Group> createCdmDetailElement(AbstractCdmDetailSection<Group> parentElement, int style) {
+           return formFactory.createGroupDetailElement(parentElement);
        }
 
 }
index 35a6292a342e153ffc519f5646f8b1afcf95b20a..15c4f491029dc95713ac20c8d6ae665e902c6239 100644 (file)
@@ -1,23 +1,20 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.group;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 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.section.AbstractCdmDetailElement;
 
 /**
@@ -44,7 +41,7 @@ public class GroupDetailWizardPage  extends AbstractCdmEntityWizardPage<Group>{
        @Override
        public AbstractCdmDetailElement<Group> createElement(
                        ICdmFormElement rootElement) {
-               GroupDetailElement groupElement = (GroupDetailElement) formFactory.createCdmDetailElement(DetailType.GROUP, rootElement, SWT.NULL);
+               GroupDetailElement groupElement = formFactory.createGroupDetailElement(rootElement);
                return groupElement;
        }
 
index 390de78b72ce361b96f01beec1150c73eab65777..68a5db7d82cd6091816507fb0948683c2274c639 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -9,7 +9,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -25,19 +25,19 @@ public class PolytomousKeyDetailSection extends AbstractCdmDetailSection<Polytom
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.POLYTOMOUS_KEY;
+       public String getHeading() {
+               return "Polytomous Key";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Polytomous Key";
+       protected AbstractCdmDetailElement<PolytomousKey> createCdmDetailElement(AbstractCdmDetailSection<PolytomousKey> parentElement, int style) {
+           return formFactory.createPolytomousKeyDetailElement(parentElement);
        }
 
 }
index fdfa6470970409575b0751e4f4ebc0155b50aa73..65c4d636c64fa269a0719d991b603160edb3ea03 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -9,7 +9,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -23,21 +23,21 @@ public class PolytomousKeyNodeDetailSection extends AbstractCdmDetailSection<Pol
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.POLYTOMOUS_KEY_NODE;
+       public String getHeading() {
+               return "Polytomous Key Node";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Polytomous Key Node";
+       protected AbstractCdmDetailElement<PolytomousKeyNode> createCdmDetailElement(AbstractCdmDetailSection<PolytomousKeyNode> parentElement, int style) {
+           return formFactory.createPolytomousKeyNodeDetailElement(parentElement);
        }
 
 }
index 7fba074cd955d3b01b3917ce0afeeb8a6d05d765..66c071ced89a6194752dcd6949672531c606bbdd 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -46,7 +46,7 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
                        ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /**
         * {@inheritDoc}
         *
@@ -61,7 +61,8 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
@@ -76,12 +77,6 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        public String getHeading() {
                return "Authorship";
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.AUTHORSHIP;
-       }
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
@@ -90,5 +85,13 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           return formFactory.createAuthorshipDetailElement(parentElement, style);
+       }
+
 }
index 77fb8fe00c420f43c7e1bf5b6788faa641d42847..ae1812feb33c3d6804ac019fd5d4c4541a5ec7ba 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -46,7 +46,7 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase>
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonBaseDetailSection#setTaxonBase(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -65,14 +65,6 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase>
                return taxonBase;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.HYBRID;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
@@ -88,5 +80,14 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonNameBase>
        protected void setSectionTitle() {
                setText(getHeading());
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<TaxonNameBase> parentElement, int style) {
+        //FIXME generic
+           return formFactory.createHybridDetailElement(parentElement);
+       }
+
 }
index 1b18a4562e5071ced863e21f0a2cde729e28204f..32315ed8d3fbf27442281994cfd28579413f141a 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -48,7 +48,8 @@ public class NameDetailSection extends AbstractCdmDetailSection<NonViralName> im
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
@@ -60,19 +61,13 @@ public class NameDetailSection extends AbstractCdmDetailSection<NonViralName> im
                return "Scientific Name";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.SCIENTIFICNAME;
-       }
-
        /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
                if(!isDisposed()){
                        String title = "";
                        if(getEntity() != null && (getEntity() instanceof NonViralName)){
-                                title = ": " + ((NonViralName) getEntity()).getNameCache();
+                                title = ": " + getEntity().getNameCache();
                        }
                        this.setText(getHeading() + title);
                }
@@ -85,5 +80,12 @@ public class NameDetailSection extends AbstractCdmDetailSection<NonViralName> im
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           return formFactory.createNameDetailElement(parentElement, style);
+       }
 }
index 55662b2d56b7870597dc735d34b92724ea0d3ebd..d4e17a472caef42b9a0a579f8b68cf870202d2fc 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -12,14 +12,13 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import java.util.Arrays;
 
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 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.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
@@ -28,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement
  * <p>
  * NonViralNameDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created May 20, 2010
  * @version 1.0
@@ -45,7 +44,7 @@ public class NonViralNameDetailElement extends
         * <p>
         * Constructor for NonViralNameDetailElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -60,7 +59,7 @@ public class NonViralNameDetailElement extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
         * (eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement,
@@ -68,39 +67,27 @@ public class NonViralNameDetailElement extends
         */
        /** {@inheritDoc} */
        @Override
-       protected void createControls(ICdmFormElement formElement,
-                       final NonViralName entity, int style) {
-
-               toggleable_cache = formFactory.createToggleableTextField(formElement,
-                               "Cache", entity.getTitleCache(), entity.isProtectedTitleCache()
-                                               || entity.isProtectedFullTitleCache(), style);
-
-               combo_nomenclaturalCode = formFactory
-                               .createEnumComboElement(NomenclaturalCode.class,
-                                               formElement, style);
-               combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
-               section_name = (NameDetailSection) formFactory.createCdmDetailSection(
-                               DetailType.SCIENTIFICNAME, getConversationHolder(),
-                               formElement, null, Section.TWISTIE | Section.EXPANDED);
-               section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_name);
-               addElement(section_name);
-               section_author = (AuthorshipDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.AUTHORSHIP,
-                                               getConversationHolder(), formElement, null,
-                                               Section.TWISTIE | Section.EXPANDED);
-               section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_author);
-               addElement(section_author);
-               
-               section_hybrid = (HybridDetailSection) formFactory.createCdmDetailSection(DetailType.HYBRID, 
-                                               getConversationHolder(), formElement, null, 
-                                               Section.TWISTIE);
-               section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_hybrid);
-               addElement(section_hybrid);
-       }
+    protected void createControls(ICdmFormElement formElement, final NonViralName entity, int style) {
+
+        toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
+
+        combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+        combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+
+        section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        addControl(section_name);
+        addElement(section_name);
+        section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        addControl(section_author);
+        addElement(section_author);
+
+        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        addControl(section_hybrid);
+        addElement(section_hybrid);
+    }
 
        /** {@inheritDoc} */
        @Override
@@ -144,7 +131,7 @@ public class NonViralNameDetailElement extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
         * .lang.Object)
@@ -159,8 +146,9 @@ public class NonViralNameDetailElement extends
                        // initiating the free text name editor
                        getEntity().setProtectedFullTitleCache(false);
                } else if (eventSource == section_name || eventSource == section_author) {
-                       if (getParentElement() instanceof AbstractCdmDetailSection)
-                               ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+                       if (getParentElement() instanceof AbstractCdmDetailSection) {
+                ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+            }
                        if (!toggleable_cache.getState()) {
                                toggleable_cache.setText(getEntity().getTitleCache());
                        }
index 6657d7a744bcefa27ca3337d414b6239d25525d7..654a025e439f8bffc0632401d0ddc8d70134bbac 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -11,6 +11,7 @@
 package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.ToolBarManager;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.swt.SWT;
@@ -20,11 +21,11 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-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.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -53,20 +54,21 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#createToolbar()
         */
        @Override
        protected Control createToolbar() {
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-               
+
                if(getEntity() != null && checkForMultipleNameUsages(getEntity())){
-               
-                       Action cloneAction = new Action("Clone", Action.AS_PUSH_BUTTON){
-                               public void run() {
-                                       boolean confirm = StoreUtil.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
-                                       
+
+                       Action cloneAction = new Action("Clone", IAction.AS_PUSH_BUTTON){
+                               @Override
+                public void run() {
+                                       boolean confirm = AbstractUtility.confirmDialog("Confirm cloning", "Do you really want to clone the name?");
+
                                        if(confirm){
                                                NonViralName clonedName;
                                                clonedName = (NonViralName) getEntity().clone();
@@ -76,35 +78,26 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
 //                                             EditorUtil.getActiveMultiPageTaxonEditor().r
                                                firePropertyChangeEvent(new CdmPropertyChangeEvent(NonViralNameDetailSection.this, null));
                                        }
-                                       
+
                                };
                        };
-                       
+
                        cloneAction.setToolTipText("Clone the name if you do not want to edit the shared instance");
-                       
+
                        toolBarManager.add(cloneAction);
-               
+
                }
                return toolBarManager.createControl(this);
        }
-       
+
 
        /**
-        * @param nonViralName 
-        * 
+        * @param nonViralName
+        *
         */
        private boolean checkForMultipleNameUsages(NonViralName nonViralName) {
                return nonViralName.getTaxonBases().size() != 1;
        }
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.NONVIRALNAME;
-       }
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
@@ -119,7 +112,8 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase taxon) {
+       @Override
+    public void setTaxonBase(TaxonBase taxon) {
                taxonBase = taxon;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(taxon.getName());
                setEntity(name);
@@ -132,4 +126,12 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           return formFactory.createNonViralNameDetailElement(parentElement);
+       }
 }
index 4603f031d019265fda97ab9977e2f023980f12dc..de04f7c59b8da4de5f7428fa946fd819aae0db7d 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.name;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -43,15 +40,15 @@ public class NonViralNameWizardPage extends AbstractCdmEntityWizardPage<NonViral
                super(formFactory, conversation, entity);
                setTitle("Name");
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<NonViralName> createElement(ICdmFormElement rootElement) {
-               nameElement = (NonViralNameDetailElement) formFactory.createCdmDetailElement(DetailType.NONVIRALNAME, rootElement, SWT.NULL);
+               nameElement = formFactory.createNonViralNameDetailElement(rootElement);
                nameElement.setEntity(entity);
                return nameElement;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void dispose() {
index 9c9574b310ccd2c7a535b823e71bd0dda3749075..ba24188ba30f70087150c3f54ca1110a784a0d8a 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -49,14 +46,14 @@ public class CollectionWizardPage extends AbstractCdmEntityWizardPage<Collection
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<Collection> createElement(ICdmFormElement rootElement) {
-               CollectionDetailElement collectionDetailElement = (CollectionDetailElement) formFactory.createCdmDetailElement(DetailType.COLLECTION, rootElement, SWT.NULL);
+               CollectionDetailElement collectionDetailElement = formFactory.createCollectionDetailElement(rootElement);
                collectionDetailElement.setEntity(entity);
                return collectionDetailElement;
        }
index 931596b948d31a3948500e29b39376b437794c9b..4f74484327f15fad999d8b6b534d1e27018aeb01 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
-       
+
        /**
         * <p>Constructor for DerivedUnitBaseDetailSection.</p>
         *
@@ -42,22 +42,21 @@ public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<Deriv
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.DERIVED_UNIT;
+       public String getHeading() {
+               return "Specimen Details";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return "Specimen Details";
+       protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createDerivedUnitBaseDetailElement(parentElement);
        }
 }
index 3524daad56d4285c53e69b2f18106bc92944e827..69b53eb65dd7dca0e769676ad0a0a94edf4415a4 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -46,14 +43,14 @@ public class DerivedUnitBaseWizardPage extends AbstractCdmEntityWizardPage<Deriv
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               DerivedUnitBaseDetailElement detailElement = (DerivedUnitBaseDetailElement) formFactory.createCdmDetailElement(DetailType.DERIVED_UNIT, rootElement, SWT.NULL);
-               detailElement.setEntity(getEntity());           
+               DerivedUnitBaseDetailElement detailElement = formFactory.createDerivedUnitBaseDetailElement(rootElement);
+               detailElement.setEntity(getEntity());
                return detailElement;
        }
 
index 937ee2113f1ce93f8dd64e40613ef5acab178ddc..edd068f7ff91d83f365e3d54c60da50ae5063128 100644 (file)
@@ -1,25 +1,24 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 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;
@@ -32,10 +31,10 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<DerivedUnitBase> {
-       
+
        private DerivedUnitFacade facade;
 
-       private DerivedUnitFacadeConfigurator configurator;
+       private final DerivedUnitFacadeConfigurator configurator;
 
        private GeneralDetailSection section_general;
        private GatheringEventDetailSection section_gatheringEvent;
@@ -55,24 +54,24 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
                configurator.setMoveDerivedUnitMediaToGallery(true);
                configurator.setMoveFieldObjectMediaToGallery(true);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setEntity(DerivedUnitBase entity) {
                super.setEntity(entity);
                try {
                        facade = DerivedUnitFacade.NewInstance(entity, configurator);
-                       
+
                        section_general.setEntity(facade);
                        section_derivedUnitBase.setEntity(facade);
                        section_gatheringEvent.setEntity(facade);
                        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);
                }
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void removeElements() {
@@ -98,13 +97,13 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
                        section_fieldObservation = null;
                }
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public DerivedUnitBase getEntity() {
                throw new IllegalArgumentException("Should not be called");
        }
-       
+
        /**
         * <p>Getter for the field <code>facade</code>.</p>
         *
@@ -113,28 +112,28 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
        public DerivedUnitFacade getFacade(){
                return facade;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        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);
@@ -144,8 +143,9 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<Der
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == section_derivedUnitBase || eventSource == section_gatheringEvent || eventSource == section_fieldObservation){
-                       if(getParentElement() instanceof AbstractCdmDetailSection)
-                               ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+                       if(getParentElement() instanceof AbstractCdmDetailSection) {
+                ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+            }
                }
        }
 }
index c099a4d204c77f4ad3828fcba8924c3a32f14bf3..5c410bf52a3e96cd75da6192d8550206bd48b7ae 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,8 +15,8 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class DerivedUnitFacadeDetailSection extends AbstractCdmDetailSection<DerivedUnitBase> {
-       
+
        /**
         * <p>Constructor for DerivedUnitFacadeDetailSection.</p>
         *
@@ -42,16 +42,18 @@ public class DerivedUnitFacadeDetailSection extends AbstractCdmDetailSection<Der
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.DERIVED_UNIT_FACADE;
-       }
 
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Unit";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<DerivedUnitBase> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitBase> parentElement, int style) {
+           return formFactory.createDerivedUnitFacadeDetailElement(parentElement);
+       }
 }
index bdd7200942a4f3d9c18e3ef6e903bb86a98e6aa3..c2ae96f52ef0504d08be5275e2d622cf8f1b4a37 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -40,19 +40,19 @@ public class DeterminationDetailSection extends AbstractCdmDetailSection<Derived
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.DETERMINATION;
+       public String getHeading() {
+               return "Determinations";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "Determinations"; 
+       protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createDeterminationDetailElement(parentElement);
        }
 
 }
index d2467e24a2edfa641e2386847ef15940acb61b09..5a1fc39fa2b3c54c207d65b049a5c5e1b5bcd6f3 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.model.description.Sex;
-import eu.etaxonomy.cdm.model.description.Stage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
@@ -29,7 +26,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  * @version 1.0
  */
 public class FieldObservationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
-       
+
        private TextWithLabelElement text_ecology;
 
        private TextWithLabelElement text_plantDescription;
@@ -40,10 +37,10 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
 
        private NumberWithLabelElement number_individualCount;
 
-       private TermComboElement<Sex> combo_sex;
+//     private TermComboElement<Sex> combo_sex;
+//
+//     private TermComboElement<Stage> combo_lifeStage;
 
-       private TermComboElement<Stage> combo_lifeStage;
-       
        /**
         * <p>Constructor for FieldObservationDetailElement.</p>
         *
@@ -54,7 +51,7 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
-               
+
        /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement,
@@ -64,10 +61,10 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
                // Disable for now
 //             text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style);
                text_fieldNotes = formFactory.createTextWithLabelElement(formElement, "Field Notes", entity.getFieldNotes(), style);
-               
+
                number_individualCount = formFactory.createIntegerTextWithLabelElement(formElement, "Individual Count", entity.getIndividualCount(), style);
-               combo_lifeStage = formFactory.createTermComboElement(Stage.class, formElement, "Life Stage", entity.getLifeStage(), style);
-               combo_sex = formFactory.createTermComboElement(Sex.class, formElement, "Sex", entity.getSex(), style);
+//             combo_lifeStage = formFactory.createTermComboElement(Stage.class, formElement, "Life Stage", entity.getLifeStage(), style);
+//             combo_sex = formFactory.createTermComboElement(Sex.class, formElement, "Sex", entity.getSex(), style);
        }
 
        /** {@inheritDoc} */
@@ -88,11 +85,11 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
                else if(eventSource == number_individualCount){
                        getEntity().setIndividualCount(number_individualCount.getInteger());
                }
-               else if(eventSource == combo_lifeStage){
-                       getEntity().setLifeStage(combo_lifeStage.getSelection());
-               }
-               else if(eventSource == combo_sex){
-                       getEntity().setSex(combo_sex.getSelection());
-               }
+//             else if(eventSource == combo_lifeStage){
+//                     getEntity().setLifeStage(combo_lifeStage.getSelection());
+//             }
+//             else if(eventSource == combo_sex){
+//                     getEntity().setSex(combo_sex.getSelection());
+//             }
        }
 }
index 7869c7dcb5cd159b025fc5b3f5190eaa92c32e35..cb538c9fca492b52522f3b97ee1d89f76989c0b9 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class FieldObservationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
-       
+
        /**
         * <p>Constructor for FieldObservationDetailSection.</p>
         *
@@ -42,16 +42,18 @@ public class FieldObservationDetailSection extends AbstractCdmDetailSection<Deri
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.FIELD_OBSERVATION;
-       }
 
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Field Observation Details";
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createFieldObservationDetailElement(parentElement);
+       }
 }
index 803e713553d42d9276d42fc7322972761971c536..5228bdc9e64af2cad7ce087250fd7d314260572c 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -46,13 +43,13 @@ public class FieldObservationWizardPage extends AbstractCdmEntityWizardPage<Deri
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               FieldObservationDetailElement detailElement = (FieldObservationDetailElement) formFactory.createCdmDetailElement(DetailType.FIELD_OBSERVATION, rootElement, SWT.NONE);
+               FieldObservationDetailElement detailElement = formFactory.createFieldObservationDetailElement(rootElement);
                detailElement.setEntity(getEntity());
                return detailElement;
        }
index 38eabcf2ea28696c934bef3911a361504d53d177..0a4d04a81e661e8e5023df6591b06904dcf16bf5 100644 (file)
@@ -1,20 +1,20 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
 
 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.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.preference.Resources;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  * <p>
  * GatheringEventDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Jun 24, 2010
  * @version 1.0
@@ -55,7 +55,7 @@ public class GatheringEventDetailElement extends
         * <p>
         * Constructor for GatheringEventDetailElement.
         * </p>
-        * 
+        *
         * @param formFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -68,49 +68,33 @@ public class GatheringEventDetailElement extends
                super(formFactory, formElement);
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected void createControls(ICdmFormElement formElement,
-                       DerivedUnitFacade entity, int style) {
-               // collectingArea
-               number_absoluteElevationError = formFactory
-                               .createIntegerTextWithLabelElement(formElement,
-                                               "Elevation Error", entity.getAbsoluteElevationError(),
-                                               style);
-               number_absoluteElevationMinimum = formFactory
-                               .createIntegerTextWithLabelElement(formElement,
-                                               "Elevation Minimum (m)",
-                                               entity.getAbsoluteElevationMinimum(), style);
-               number_absoluteElevationMaximum = formFactory
-                               .createIntegerTextWithLabelElement(formElement,
-                                               "Elevation Maximum (m)",
-                                               entity.getAbsoluteElevationMaximum(), style);
-
-               text_collectingMethod = formFactory.createTextWithLabelElement(
-                               formElement, "Collecting Method", entity.getCollectingMethod(),
-                               style);
-
-               number_distanceToGround = formFactory
-                               .createIntegerTextWithLabelElement(formElement,
-                                               "Distance To Ground (m)", entity.getDistanceToGround(),
-                                               style);
-               number_distanceToWaterSurface = formFactory
-                               .createIntegerTextWithLabelElement(formElement,
-                                               "Distance To Water Surface (m)",
-                                               entity.getDistanceToWaterSurface(), style);
-               // exactLocation
-               text_gatheringEventDescription = formFactory
-                               .createTextWithLabelElement(formElement,
-                                               "Gathering Event Description",
-                                               entity.getGatheringEventDescription(), style);
-
-               section_collectingAreas = (CollectingAreasDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.COLLECTING_AREA,
-                                               getConversationHolder(), formElement, Section.TWISTIE);
-               section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(
-                               2, 1));
-               section_collectingAreas.setEntity(entity);
-       }
+    /** {@inheritDoc} */
+    @Override
+    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+        // collectingArea
+        number_absoluteElevationError = formFactory.createIntegerTextWithLabelElement(
+                formElement, "Elevation Error", entity.getAbsoluteElevationError(), style);
+        number_absoluteElevationMinimum = formFactory.createIntegerTextWithLabelElement(
+                formElement, "Elevation Minimum (m)", entity.getAbsoluteElevationMinimum(), style);
+        number_absoluteElevationMaximum = formFactory.createIntegerTextWithLabelElement(
+                formElement, "Elevation Maximum (m)", entity.getAbsoluteElevationMaximum(), style);
+
+        text_collectingMethod = formFactory.createTextWithLabelElement(
+                formElement, "Collecting Method", entity.getCollectingMethod(), style);
+
+        number_distanceToGround = formFactory.createIntegerTextWithLabelElement(
+                formElement, "Distance To Ground (m)", entity.getDistanceToGround(), style);
+        number_distanceToWaterSurface = formFactory.createIntegerTextWithLabelElement(
+                formElement, "Distance To Water Surface (m)", entity.getDistanceToWaterSurface(), style);
+        // exactLocation
+        text_gatheringEventDescription = formFactory.createTextWithLabelElement(
+                formElement, "Gathering Event Description", entity.getGatheringEventDescription(), style);
+
+        section_collectingAreas = (CollectingAreasDetailSection) formFactory.createEntityDetailSection(
+                EntityDetailType.COLLECTING_AREA, getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+        section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        section_collectingAreas.setEntity(entity);
+    }
 
        /** {@inheritDoc} */
        @Override
@@ -128,7 +112,7 @@ public class GatheringEventDetailElement extends
                        } catch (IllegalArgumentException e) {
                                number_absoluteElevationMinimum
                                                .setBackground(getColor(Resources.COLOR_PARSE_ERROR));
-                               StoreUtil.warn(getClass(), e.getLocalizedMessage());
+                               AbstractUtility.warn(getClass(), e.getLocalizedMessage());
                        }
                } else if (eventSource == number_absoluteElevationMaximum) {
                        try {
@@ -140,7 +124,7 @@ public class GatheringEventDetailElement extends
                        } catch (IllegalArgumentException e) {
                                number_absoluteElevationMaximum
                                                .setBackground(getColor(Resources.COLOR_PARSE_ERROR));
-                               StoreUtil.warn(getClass(), e.getLocalizedMessage());
+                               AbstractUtility.warn(getClass(), e.getLocalizedMessage());
                        }
                } else if (eventSource == text_collectingMethod) {
                        getEntity().setCollectingMethod(text_collectingMethod.getText());
index 9673eaa0ce9a57bfc6993e97c68800504c61dfd6..44c86337ced629fe37cc2d9cfe7c1d8e52ea6510 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  * @version 1.0
  */
 public class GatheringEventDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
-       
+
        /**
         * <p>Constructor for GatheringEventDetailSection.</p>
         *
@@ -42,23 +42,22 @@ public class GatheringEventDetailSection extends AbstractCdmDetailSection<Derive
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       
+
+
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        /** {@inheritDoc} */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.GATHERING_EVENT;
+       public String getHeading() {
+               return "Gathering Event Details";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
-       /** {@inheritDoc} */
        @Override
-       public String getHeading() {
-               return "Gathering Event Details";
+       protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createGatheringEventDetailElement(parentElement);
        }
 }
index 54dd833b140ad02f8779378c97c072328ae87a4a..bcfd178d4cc87a5e45145517faa9731f304a8efd 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -46,13 +43,13 @@ public class GatheringEventWizardPage extends AbstractCdmEntityWizardPage<Derive
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               GatheringEventDetailElement detailElement = (GatheringEventDetailElement) formFactory.createCdmDetailElement(DetailType.GATHERING_EVENT, rootElement, SWT.NULL);
+               GatheringEventDetailElement detailElement = formFactory.createGatheringEventDetailElement(rootElement);
                detailElement.setEntity(getEntity());
                return detailElement;
        }
index 30f43dd00f4dad403647906fbbcb280a36ee594c..8ad6526234531b9d62eea3b6f0c9c761d7ee8a9b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -14,7 +14,6 @@ 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.Collection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
@@ -43,8 +42,8 @@ public class GeneralDetailElement extends
        private TimePeriodElement element_date;
        private EntitySelectionElement<AgentBase> selection_collector;
        private TextWithLabelElement text_collectingNumber;
-       private EntitySelectionElement<Collection> selection_collection;
-       private TextWithLabelElement text_accessionNumber;
+//     private EntitySelectionElement<Collection> selection_collection;
+//     private TextWithLabelElement text_accessionNumber;
 
        /**
         * @param formFactory
@@ -57,7 +56,7 @@ public class GeneralDetailElement extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
         * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
@@ -74,7 +73,7 @@ public class GeneralDetailElement extends
                                entity.getCountry(), EntitySelectionElement.NOTHING, style);
                languageText_locality = formFactory
                                .createLanguageStringWithLabelElement(formElement, "Locality",
-                                               entity.getLocality(), style);           
+                                               entity.getLocality(), style);
                element_point = formFactory.createPointElement(formElement,
                                entity.getExactLocation(), style);
                number_elevation = formFactory.createIntegerTextWithLabelElement(
@@ -89,20 +88,20 @@ public class GeneralDetailElement extends
                                                style);
                text_collectingNumber = formFactory.createTextWithLabelElement(formElement,
                                "Collecting number", entity.getFieldNumber(), style);
-               selection_collection = formFactory
-                               .createSelectionElement(Collection.class,
-                                               getConversationHolder(), formElement, "Collection",
-                                               entity.getCollection(),
-                                               EntitySelectionElement.ALL, style);
-               text_accessionNumber = formFactory.createTextWithLabelElement(
-                               formElement, "Accession Number", entity.getAccessionNumber(),
-                               style);
-               
+//             selection_collection = formFactory
+//                             .createSelectionElement(Collection.class,
+//                                             getConversationHolder(), formElement, "Collection",
+//                                             entity.getCollection(),
+//                                             EntitySelectionElement.ALL, style);
+//             text_accessionNumber = formFactory.createTextWithLabelElement(
+//                             formElement, "Accession Number", entity.getAccessionNumber(),
+//                             style);
+
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
         * .lang.Object)
@@ -127,11 +126,12 @@ public class GeneralDetailElement extends
                        getEntity().setCollector(selection_collector.getSelection());
                } else if (eventSource == text_collectingNumber) {
                        getEntity().setFieldNumber(text_collectingNumber.getText());
-               } else if (eventSource == selection_collection) {
-                       getEntity().setCollection(selection_collection.getSelection());
-               } else if (eventSource == text_accessionNumber) {
-                       getEntity().setAccessionNumber(text_accessionNumber.getText());
                }
+//               else if (eventSource == selection_collection) {
+//                     getEntity().setCollection(selection_collection.getSelection());
+//             } else if (eventSource == text_accessionNumber) {
+//                     getEntity().setAccessionNumber(text_accessionNumber.getText());
+//             }
 
                if (eventSource != toggleableText_titleCache) {
                        toggleableText_titleCache.setText(getEntity().getTitleCache());
index 10c56b57c5ae3788260e79f4bf4f587800a99e41..d2b3e7276464dd369cac52513469344626542902 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -41,19 +41,19 @@ public class GeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFa
 
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.DERIVED_UNIT_GENERAL;
+       public String getHeading() {
+               return "General";
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "General";
+       protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+           return formFactory.createGeneralDetailElement(parentElement);
        }
 
 }
index 9b1224a0d87f83d08c126604d8914f9f175f0740..700686948103a2f3f4b89d7bbe508229df5038f1 100644 (file)
@@ -1,22 +1,19 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -45,13 +42,13 @@ public class GeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFa
        protected void checkComplete() {
                setPageComplete(true);
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        @Override
        public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
-               GeneralDetailElement detailElement = (GeneralDetailElement) formFactory.createCdmDetailElement(DetailType.DERIVED_UNIT_GENERAL, rootElement, SWT.NULL);
+               GeneralDetailElement detailElement = formFactory.createGeneralDetailElement(rootElement);
                detailElement.setEntity(getEntity());
                checkComplete();
                return detailElement;
index d9a824f9cd0184a61da1d7d9b202a5a295f9be67..33cd1e7b9a856e4f6a77afc8ca726dea2c40ea40 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -48,12 +48,6 @@ public class NomenclaturalReferenceDetailSection extends
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.NOMENCLATURALREFERENCE;
-       }
 
        /** {@inheritDoc} */
        @Override
@@ -62,12 +56,13 @@ public class NomenclaturalReferenceDetailSection extends
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                TaxonNameBase name = (TaxonNameBase) HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
@@ -76,7 +71,7 @@ public class NomenclaturalReferenceDetailSection extends
                        INomenclaturalReference reference = getEntity().getNomenclaturalReference();
                        String nomenclaturalCitation = reference.getNomenclaturalCitation(getEntity().getNomenclaturalMicroReference());
                        title = ": " + nomenclaturalCitation;
-               }       
+               }
                this.setText(getHeading() + title);
        }
 
@@ -87,4 +82,12 @@ public class NomenclaturalReferenceDetailSection extends
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<TaxonNameBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonNameBase> parentElement, int style) {
+           return formFactory.createNomenclaturalReferenceDetailElement(parentElement, style);
+       }
 }
index c04bad78fde5ae27840db5a81cc3359312b91d2f..ec35e1d9172b6857694f470130054ebc41fcae62 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
  * @version 1.0
  */
 public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference> implements ITaxonBaseDetailSection{
-       
+
        private TaxonBase taxonBase;
 
        /**
@@ -54,12 +54,13 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
-               
+
                Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
-               
+
                setEntity(reference);
        }
 
@@ -73,12 +74,6 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
                return "Reference";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.REFERENCEBASE;
-       }       
-       
        /** {@inheritDoc} */
        @Override
        public void refresh() {
@@ -93,5 +88,13 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
-       
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<Reference> createCdmDetailElement(AbstractCdmDetailSection<Reference> parentElement, int style) {
+           return formFactory.createReferenceDetailElement(parentElement, style);
+       }
+
 }
index bfd30b9e7e6b12295420953602204ef9495b83d5..a8bdfe4d0d4f5bdca50a1dc84334d12dbd361c83 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,7 +16,6 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler;
@@ -42,14 +41,15 @@ public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference>
                super(formFactory, conversation, entity);
                setTitle("Reference");
        }
-       
-       /* 
+
+       /*
         * (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
         */
        /** {@inheritDoc} */
-       public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
-               ReferenceDetailElement referenceElement = (ReferenceDetailElement) formFactory.createCdmDetailElement(DetailType.REFERENCEBASE, rootElement, SWT.NULL);
+       @Override
+    public AbstractCdmDetailElement<Reference> createElement(ICdmFormElement rootElement){
+               ReferenceDetailElement referenceElement = formFactory.createReferenceDetailElement(rootElement, SWT.NULL);
                referenceElement.addExceptionHandler(this);
                referenceElement.setEntity(entity);
                return referenceElement;
index af0d316cf39b659ef73810b7035e3d73ef52d129..bf989c41c3a3bbe6a703b7ddfea5845ad565a913 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -39,7 +39,7 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
        /** Constant <code>HEADING_PROBLEM="The name has problems."</code> */
        public static final String HEADING_PROBLEM = "The name has problems.";
        private TaxonBase taxonBase;
-       
+
        /**
         * <p>Constructor for ParsingMessagesSection.</p>
         *
@@ -53,15 +53,16 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
                        ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected void createControls(AbstractCdmDetailSection formElement, int style) {
                // we do it differently here
        }
-       
+
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                setEntity((NonViralName) HibernateProxyHelper.deproxy(entity.getName()));
                destroyParsingProblemComposites();
@@ -69,7 +70,7 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
                        displayParsingProblems();
                }
        }
-       
+
        private void destroyParsingProblemComposites() {
                setText(HEADING_SUCCESS);
                for(Control control : getLayoutComposite().getChildren()){
@@ -92,12 +93,6 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
                return HEADING_SUCCESS;
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.PARSINGMESSAGE;
-       }
-
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -105,4 +100,13 @@ public class ParsingMessagesSection extends AbstractCdmDetailSection<NonViralNam
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
+           //no detail element
+           return null;
+       }
 }
index 8ba2e34493164cfece42ac545f70b434259a599c..e0a5d92eb6cfed6cc58c454d04f405c70ccd7cc7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
@@ -50,9 +50,10 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
-               TaxonBase taxonBase = (TaxonBase) HibernateProxyHelper.deproxy(entity); 
+               TaxonBase taxonBase = (TaxonBase) HibernateProxyHelper.deproxy(entity);
                setEntity(taxonBase);
        }
 
@@ -62,12 +63,6 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
                return getEntity() != null ? getEntity().getClass().getSimpleName() : "TaxonBase";
        }
 
-       /** {@inheritDoc} */
-       @Override
-       protected DetailType getDetailType() {
-               return DetailType.TAXONBASE;
-       }
-       
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
         */
@@ -76,4 +71,12 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
                return taxonBase;
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
+       @Override
+       protected AbstractCdmDetailElement<TaxonBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase> parentElement, int style) {
+           return formFactory.createTaxonBaseDetailElement(parentElement, style);
+       }
+
 }
index 262a9eb5728b81713c15c6f6c6bc06371042bf5c..c787ad00d6c7ab31bd01226e64194ffe0c05381e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -32,13 +32,16 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
        }
 
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.TAXON_RELATIONSHIP;
+       public String getHeading() {
+               return "Taxon Relationship";
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+        */
        @Override
-       public String getHeading() {
-               return "Taxon Relationship";
+       protected AbstractCdmDetailElement<TaxonRelationship> createCdmDetailElement(AbstractCdmDetailSection<TaxonRelationship> parentElement, int style) {
+           return formFactory.createTaxonRelationshipDetailElement(parentElement);
        }
 
 }
index e1010d885b8509bfd72987cba837cb213eaa92ef..a80b492c070a74a1f27225c8fbc7e20506714615 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.user;
 
@@ -12,7 +12,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.User;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
@@ -37,19 +37,18 @@ public class UserDetailSection extends AbstractCdmDetailSection<User> {
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
+        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
         */
        @Override
-       protected DetailType getDetailType() {
-               return DetailType.USER;
+       public String getHeading() {
+               return "User " + (getEntity() != null ? getEntity().getUsername() : "");
        }
 
        /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
         */
        @Override
-       public String getHeading() {
-               return "User " + (getEntity() != null ? getEntity().getUsername() : "");
+       protected AbstractCdmDetailElement<User> createCdmDetailElement(AbstractCdmDetailSection<User> parentElement, int style) {
+           return formFactory.createUserDetailElement(parentElement);
        }
-
 }
index 3c82fbe956124e1db7840248c3ad18f0e3f71a6a..972b92dc637a70813541891d4cbd349d35f86717 100644 (file)
@@ -1,15 +1,12 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.user;
 
-import org.eclipse.swt.SWT;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
@@ -30,11 +27,11 @@ public class UserDetailWizardPage extends AbstractCdmEntityWizardPage<User> {
         */
        @Override
        public AbstractCdmDetailElement<User> createElement(ICdmFormElement rootElement) {
-               UserDetailElement userElement = (UserDetailElement) formFactory.createCdmDetailElement(DetailType.USER, rootElement, SWT.NULL);
+               UserDetailElement userElement = formFactory.createUserDetailElement(rootElement);
                userElement.setEntity(getEntity());
                return userElement;
        }
-       
+
        @Override
        protected void checkComplete() {
                boolean hasUsername = getEntity().getUsername() != null;
index 953928966b73d2cbe145f9eeb0b6bf0fa0d0e594..01b8ce6e5aa6cae218f36dcf69efd83a438d3327 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2011 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -14,20 +14,20 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
  * UseRecordDetailSection Class\r
- * @author a.theys     \r
+ * @author a.theys\r
  * @created mar 13, 2012\r
  * @version 1.0\r
  */\r
 public class UseRecordDetailSection extends AbstractCdmDetailSection<DescriptionElementBase> {\r
-       \r
+\r
        /**Constructor for class UseRecordDetailSection\r
-        * \r
+        *\r
         * @param cdmFormFactory\r
         * @param conversation\r
         * @param parentElement\r
@@ -38,23 +38,26 @@ public class UseRecordDetailSection extends AbstractCdmDetailSection<Description
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {\r
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);\r
        }\r
-       \r
-       /** {@inheritDoc} */\r
-       @Override\r
-       protected DetailType getDetailType() {\r
-               return DetailType.USE_RECORD;\r
-       }\r
-       \r
+\r
        /** {@inheritDoc} */\r
        @Override\r
        public String getHeading() {\r
                return "Use Record";\r
        }\r
-       \r
+\r
        /** {@inheritDoc} */\r
        @Override\r
        protected void setSectionTitle() {\r
                this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));\r
                setTextClient(createToolbar());\r
        }\r
+\r
+       /* (non-Javadoc)\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
+        */\r
+       @Override\r
+       protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<DescriptionElementBase> parentElement, int style) {\r
+           return formFactory.createUseRecordDetailElement(parentElement);\r
+       }\r
+\r
 }\r
index 1e3b307c887153ef8b07b1251d3368f59bb983f6..b7e482e6021c2c55b625433460e36ff9b0a6e329 100644 (file)
@@ -1,22 +1,21 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
-import org.eclipse.ui.forms.widgets.TableWrapLayout;\r
 \r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -28,7 +27,7 @@ public class DefinedTermDetailSection<T extends DefinedTermBase> extends Abstrac
 \r
        /**\r
         * @param formFactory\r
-        * @param definedTermClass \r
+        * @param definedTermClass\r
         * @param conversation\r
         * @param parentElement\r
         * @param selectionProvider\r
@@ -41,33 +40,28 @@ public class DefinedTermDetailSection<T extends DefinedTermBase> extends Abstrac
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
-       protected DetailType getDetailType() {\r
-               return null;\r
+       public String getHeading() {\r
+               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
-       \r
-       @Override\r
-       protected void createControlsByType(\r
-                       AbstractCdmDetailSection<T> abstractCdmDetailSection,\r
-                       Class<T> clazz, int style) {\r
-               TableWrapLayout layout = (TableWrapLayout) getLayoutComposite()\r
-                               .getLayout();\r
-               layout.topMargin = 10;\r
-               layout.numColumns = 2;\r
 \r
-               getLayoutComposite().setLayout(layout);\r
-               detailElement = formFactory.createDefinedTermDetailElement(clazz,\r
-                               abstractCdmDetailSection, style);\r
+       //FIXME clean up create element methods\r
+       /* (non-Javadoc)\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElementByType(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, java.lang.Class, int)\r
+        */\r
+       @Override\r
+       protected AbstractCdmDetailElement createCdmDetailElementByType(AbstractCdmDetailSection<T> parentElement, Class<T> entityClass, int style) {\r
+           return formFactory.createDefinedTermDetailElement(entityClass, parentElement, style);\r
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
         */\r
        @Override\r
-       public String getHeading() {\r
-               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
+       protected AbstractCdmDetailElement<T> createCdmDetailElement(AbstractCdmDetailSection<T> parentElement, int style) {\r
+           return null;\r
        }\r
 \r
 }\r
index c8242850facfffeac967494cbf1daec615d4d100..86082a69091da8672f363862ef07f576943f3f48 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -40,21 +40,20 @@ public class NamedAreaDetailSection extends AbstractCdmDetailSection<NamedArea>
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
-       protected DetailType getDetailType() {\r
-               \r
-               return DetailType.NAMED_AREA;\r
+       public String getHeading() {\r
+\r
+               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
         */\r
        @Override\r
-       public String getHeading() {\r
-               \r
-               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
+       protected AbstractCdmDetailElement<NamedArea> createCdmDetailElement(AbstractCdmDetailSection<NamedArea> parentElement, int style) {\r
+           return formFactory.createNamedAreaDetailElement(parentElement);\r
        }\r
 \r
 }\r
index cf6394ef779f5d0d3f4edbd445b206459695ae0d..69daf2ba76b39f7046cad95a9767df3b09f11722 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -37,20 +37,19 @@ public class NamedAreaLevelDetailSection extends AbstractCdmDetailSection<NamedA
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
-       protected DetailType getDetailType() {\r
-               \r
-               return DetailType.NAMED_AREA_LEVEL;\r
+       public String getHeading() {\r
+               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
        /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
         */\r
        @Override\r
-       public String getHeading() {\r
-               return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
+       protected AbstractCdmDetailElement<NamedAreaLevel> createCdmDetailElement(AbstractCdmDetailSection<NamedAreaLevel> parentElement, int style) {\r
+           return formFactory.createNamedAreaLevelElement(parentElement);\r
        }\r
 \r
 }\r
index 18f10bf670b19f925a2ab49267a8ac11ba852130..767ffb8fef3d93ff17677bd9dee7224373944fae 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -15,7 +15,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
 \r
 /**\r
@@ -40,24 +40,15 @@ public class TermVocabularyDetailSection extends
                // TODO Auto-generated constructor stub\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()\r
-        */\r
-       @Override\r
-       protected DetailType getDetailType() {\r
-               \r
-               return DetailType.TERM_VOCABULARY;\r
-       }\r
-\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
         */\r
        @Override\r
        public String getHeading() {\r
-               \r
+\r
                return "Vocabulary: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
-       \r
+\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#setSectionTitle()\r
         */\r
@@ -65,4 +56,12 @@ public class TermVocabularyDetailSection extends
        protected void setSectionTitle() {\r
                setText(getHeading());\r
        }\r
+\r
+       /* (non-Javadoc)\r
+        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
+        */\r
+       @Override\r
+       protected AbstractCdmDetailElement<TermVocabulary> createCdmDetailElement(AbstractCdmDetailSection<TermVocabulary> parentElement, int style) {\r
+           return formFactory.createTermVocabularyDetailElement(parentElement);\r
+       }\r
 }\r
index 2a019c07d46fd032af85d7ac9a7724c73bfc5384..57cb798855860ffd4ba5adf4329fbd317353866d 100644 (file)
@@ -1,16 +1,15 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.view;
 
-import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.widgets.Composite;
@@ -36,23 +35,24 @@ import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
  * @created Feb 9, 2010
  * @version 1.0
  */
-public abstract class AbstractCdmDataViewer extends Viewer implements ISelectionProvider, IConversationEnabled{
-       
+public abstract class AbstractCdmDataViewer extends Viewer implements IConversationEnabled{
+
        protected ManagedForm managedForm;
 
        protected CdmFormFactory formFactory;
 
        protected ScrolledForm scrolledForm;
-       
-       private Composite body;
-       
+
+       private final Composite body;
+
        protected RootElement rootElement;
 
+       //TODO: create a super class for this?
        private Object input;
 
-       private AbstractCdmViewPart viewPart;
+       private final AbstractCdmViewPart viewPart;
+
 
-       
        /**
         * <p>Constructor for AbstractCdmDataViewer.</p>
         *
@@ -61,9 +61,9 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
         */
        public AbstractCdmDataViewer(Composite parent, AbstractCdmViewPart viewPart) {
                this.viewPart = viewPart;
-               
+
                managedForm = new ManagedForm(parent){
-                       
+
                        /* (non-Javadoc)
                         * @see org.eclipse.ui.forms.ManagedForm#dirtyStateChanged()
                         */
@@ -72,18 +72,18 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
                                markViewPartDirty();
                        }
                };
-               
+
                createFormFactory();
-               
+
                scrolledForm = managedForm.getForm();
-               
+
                body = scrolledForm.getBody();
-               
+
                body.setLayout(LayoutConstants.LAYOUT());
-               
+
                rootElement = new RootElement(formFactory, body);
        }
-       
+
        /**
         * <p>createFormFactory</p>
         */
@@ -98,8 +98,8 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
        protected void markViewPartDirty(){
                viewPart.changed(input);
        }
-       
-       
+
+
        /**
         * @return
         */
@@ -116,22 +116,22 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
                for(Control child : body.getChildren()){
                        return child;
                }
-               
+
                return body;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object)
         */
        /** {@inheritDoc} */
        @Override
        public void setInput(Object input) {
-               this.input = input;     
+               this.input = input;
                // reset selection
                setSelection(new StructuredSelection(input));
                refresh();
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.viewers.Viewer#getInput()
         */
@@ -140,7 +140,7 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
        public Object getInput() {
                return input;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.jface.viewers.Viewer#refresh()
         */
@@ -148,51 +148,51 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
        @Override
        public void refresh() {
                showParts();
-               
+
                managedForm.setInput(input);
-               
+
                managedForm.refresh();
-               
+
                managedForm.reflow(true);
        }
 
-       
+
        /**
         * <p>layout</p>
         */
        public void layout(){
                body.layout();
        }
-       
+
        /**
         * <p>showParts</p>
         */
        protected abstract void showParts();
-       
-       
+
+
        /**
         * <p>destroySections</p>
         */
-       protected void destroySections() {      
+       protected void destroySections() {
                for (IFormPart formPart : managedForm.getParts()){
                        removePart((CdmSectionPart) formPart);
-               }       
-               
+               }
+
                managedForm.setInput(null);
-                               
+
                formFactory.destroyElement(rootElement);
-               
+
                createFormFactory();
-               
+
                rootElement = new RootElement(formFactory, body);
-               
+
                for(Control control : body.getChildren()){
                        control.dispose();
                        control = null;
                }
        }
-       
-       
+
+
        /**
         * <p>setFocus</p>
         */
@@ -205,14 +205,14 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
                        break;
                }
        }
-       
+
        /**
         * <p>reflow</p>
         */
        public void reflow(){
                managedForm.reflow(true);
        }
-       
+
        /**
         * <p>removePart</p>
         *
@@ -222,7 +222,7 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
                managedForm.removePart(sectionPart);
                formFactory.removePropertyChangeListener(sectionPart);
        }
-       
+
        /**
         * <p>addPart</p>
         *
@@ -233,17 +233,19 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection
                managedForm.addPart(sectionPart);
                formFactory.addPropertyChangeListener(sectionPart);
        }
-       
+
        /**
         * <p>getConversationHolder</p>
         *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                return viewPart.getConversationHolder();
        }
-       
+
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {}
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {}
 
 }
index 1c4c3e82d5ee8a3ff17fac5811f5d7f846a89421..8d1f9ad9d6bd7cb678f7b18bfbb77491f5f1d8ad 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.view;
 
@@ -7,14 +7,14 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IEditorPart;
 
 import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>
  * Abstract AbstractCdmEditorViewPart class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Sep 21, 2010
  * @version 1.0
@@ -23,7 +23,7 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
         * .eclipse.swt.widgets.Composite)
@@ -31,47 +31,42 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
-
                super.createPartControl(parent);
-
        }
 
        /**
         * <p>
         * getEditor
         * </p>
-        * 
+        *
         * @return the currently active editor
         */
        public IEditorPart getEditor() {
-               return StoreUtil.getActiveEditor();
+               return AbstractUtility.getActiveEditor();
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setFocus() {
                super.setFocus();
-               
-               if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){       
+
+               if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
                        boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
                        setEnabled(doEnable);
                }
-       }
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public void changed(Object object) {
-               if (part instanceof AbstractCdmViewPart) {
-                       ((AbstractCdmViewPart) part).changed(object);
-               } else {
-                       IEditorPart editor = getEditor();
-                       if (editor != null
-                                       && editor instanceof IDirtyMarkableSelectionProvider) {
-
-                               ((IDirtyMarkableSelectionProvider) editor).changed(object);
-
-                       }
-               }
-       }
+    /** {@inheritDoc} */
+    @Override
+    public void changed(Object object) {
+        if (part instanceof AbstractCdmViewPart) {
+            ((AbstractCdmViewPart) part).changed(object);
+        } else {
+            IEditorPart editor = getEditor();
+            if (editor != null && editor instanceof IDirtyMarkableSelectionProvider) {
+                ((IDirtyMarkableSelectionProvider) editor).changed(object);
+            }
+        }
+    }
 
 }
index 5535d297e4a6254c624852faf101d1d0d63e0b54..4d20a88ed1877135cf08c240b24408995cabaec7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -28,9 +28,9 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>Abstract AbstractCdmViewPart class.</p>
@@ -40,40 +40,41 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public abstract class AbstractCdmViewPart extends ViewPart implements ISelectionListener, IPostOperationEnabled, IConversationEnabled, IDirtyMarkableSelectionProvider{
-       
+
        protected ISelectionService selectionService;
 
        public static IStructuredSelection EMPTY_SELECTION = new StructuredSelection();
-       
+
        protected IWorkbenchPart part;
-       
+
     private PageBook pageBook;
 
        private Label emptySelectionLabel;
 
        private Composite viewerComposite;
-       
+
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
                selectionService = getSite().getWorkbenchWindow().getSelectionService();
                selectionService.addSelectionListener(this);
-               
+
                pageBook = new PageBook(parent, SWT.NULL);
-               createViewerComposite(pageBook);
+               //create viewerComposite
+               viewerComposite = new SashForm(pageBook, SWT.HORIZONTAL);
                createViewer(viewerComposite);
-               
+
                // Page 2: Nothing selected
         emptySelectionLabel = new Label(pageBook, SWT.TOP + SWT.LEFT + SWT.WRAP);
-        
+
         setInitialSelection();
        }
-       
+
        /**
-        * 
+        *
         */
        private void setInitialSelection() {
-               selectionChanged(StoreUtil.getActivePart(), getInitialSelection());
+               selectionChanged(AbstractUtility.getActivePart(), getInitialSelection());
        }
 
        /**
@@ -84,18 +85,18 @@ public abstract class AbstractCdmViewPart extends ViewPart implements ISelection
        protected ISelection getInitialSelection() {
                return selectionService.getSelection();
        }
-       
+
        private void createViewerComposite(Composite parent) {
                viewerComposite = new SashForm(parent, SWT.HORIZONTAL);
        }
-    
+
        /**
         * <p>showEmptyPage</p>
         */
        public void showEmptyPage(){
                pageBook.showPage(emptySelectionLabel);
        }
-       
+
     /**
      * <p>showViewer</p>
      *
@@ -103,15 +104,15 @@ public abstract class AbstractCdmViewPart extends ViewPart implements ISelection
      * @param selection a {@link org.eclipse.jface.viewers.ISelection} object.
      */
     public void showViewer(IWorkbenchPart part, IStructuredSelection selection){
-       this.part = part;               
-       
+       this.part = part;
+
                Object element = selection.getFirstElement();
-               
+
                getViewer().setInput(element);
-               
+
                showViewer();
     }
-    
+
     /**
      * <p>getViewer</p>
      *
@@ -125,53 +126,59 @@ public abstract class AbstractCdmViewPart extends ViewPart implements ISelection
        public void showViewer(){
                pageBook.showPage(viewerComposite);
     }
-  
+
        public void setEnabled(boolean enabled){
                pageBook.setEnabled(enabled);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void setFocus() {
                if(getConversationHolder() != null){
                        getConversationHolder().bind();
-               }       
-               getViewer().getControl().setFocus();    
+               }
+               getViewer().getControl().setFocus();
        }
-       
+
        /**
         * <p>createViewer</p>
         *
         * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
         */
        public abstract void createViewer(Composite parent);
-       
+
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
                changed(objectAffectedByOperation);
                return true;
        }
-       
+
        /** {@inheritDoc} */
-       public abstract void changed(Object object);
-       
+       @Override
+    public abstract void changed(Object object);
+
        /**
         * <p>getConversationHolder</p>
         *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         */
-       public ConversationHolder getConversationHolder() {
-               if(part != null)
-                       return ((IConversationEnabled) part).getConversationHolder();
-               
+       @Override
+    public ConversationHolder getConversationHolder() {
+               if(part != null) {
+                   //FIXME what if part is not an IConversationEnabled? ClassCastException?
+            return ((IConversationEnabled) part).getConversationHolder();
+        }
+
                return null;
        }
-       
+
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {
-               
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {
+
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void dispose() {
index 5d884ed617b466a02984094e37866ea877077702..3ef1c37e74a072ade9db70f3bf3b9c85b23ef333 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -19,11 +19,11 @@ import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
-import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
 
 /**
  * <p>DetailsViewPart class.</p>
@@ -33,7 +33,7 @@ import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
  * @version 1.0
  */
 public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartContentHasSupplementalData{
-       
+
        /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.forms.det"{trunked}</code> */
        public static String ID = "eu.etaxonomy.taxeditor.view.detail";
 
@@ -43,35 +43,36 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
        @Override
        public void createViewer(Composite parent) {
                //selectionService.addPostSelectionListener(this);
-               
+
                viewer = new DetailsViewer(parent, this);
                getSite().setSelectionProvider(viewer);
        }
 
        /** {@inheritDoc} */
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-               if(StoreUtil.getActiveEditor() == null){
+       @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+               if(AbstractUtility.getActiveEditor() == null){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part == this){
                        return;
                }
-               
+
                if(!(selection instanceof IStructuredSelection)){
                        return;
                }
-               
+
                IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-               
-               if((part instanceof IEditorPart) || (part instanceof AbstractCdmViewPart)) {
+
+               if((part instanceof IEditorPart) || (part instanceof IPartContentHasDetails)) {
                        if(structuredSelection.size() != 1){
                                showEmptyPage();
                                return;
                        }
-                       
-                       // do not show details for feature nodes TODO really? 
+
+                       // do not show details for feature nodes TODO really?
                        if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
                                // do show the map for distributions
                                Feature feature = ((FeatureNodeContainer) ((IStructuredSelection) selection).getFirstElement()).getFeature();
@@ -80,30 +81,30 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
                                        return;
                                }
                        }
-                       
+
                        showViewer(part, structuredSelection);
                }else{
-                       showEmptyPage();                
-               }       
+                       showEmptyPage();
+               }
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public boolean postOperation(CdmBase objectAffectedByOperation) {
-               
+
                viewer.setInput(objectAffectedByOperation);
-               
+
                return super.postOperation(objectAffectedByOperation);
        }
-       
-       
+
+
        /** {@inheritDoc} */
        @Override
        public Viewer getViewer() {
                return viewer;
        }
 
-       
+
        /** {@inheritDoc} */
        @Override
        public void dispose() {
@@ -116,7 +117,8 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                return true;
        }
 }
index ac6c878be3a20cdd17b5210896b75f73acb0a7d4..4fe9b9f42a321474a6af11e2560d2f83d5eb0661 100644 (file)
@@ -1,10 +1,9 @@
-
 // $Id$
 /**
  * Copyright (C) 2011 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -17,7 +16,7 @@ import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
-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.DerivedUnitFacadeNotSupportedException;
@@ -42,15 +41,13 @@ import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-
 import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.section.agent.PersonDetailSection;
@@ -70,10 +67,8 @@ import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSectio
 import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.ScopeRestrictionSection;
 import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
@@ -98,747 +93,599 @@ import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
 import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
 
 /**
- * <p>
- * DetailsViewer class.
- * </p>
- * 
+ *
+ * The DetailsViewer handles the content of the details view (
+ * {@link DetailsViewPart}).<br>
+ * Depending on the type of the selected element the section of the details view
+ * are created.
+ *
  * @author n.hoffmann
  * @created Feb 12, 2010
  * @version 1.0
  */
 public class DetailsViewer extends AbstractCdmDataViewer {
 
-       private ISelection selection;
-
-       /**
-        * <p>
-        * Constructor for DetailsViewer.
-        * </p>
-        * 
-        * @param parent
-        *            a {@link org.eclipse.swt.widgets.Composite} object.
-        * @param viewPart
-        *            a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
-        *            object.
-        */
-       public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
-               super(parent, viewPart);
-       }
-
-       // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
-       // since we are getting implementations of DerivedUnitBase from the bulk
-       // editor
-       // and not derived unit facade objects,
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
-        * .lang.Object)
-        */
-       @Override
-       public void setInput(Object input) {
-               if (input instanceof DerivedUnitBase) {
-                       try {
-                               input = DerivedUnitFacade.NewInstance((DerivedUnitBase) input,
-                                               PreferencesUtil.getDerivedUnitConfigurator());
-                       } catch (DerivedUnitFacadeNotSupportedException e) {
-                               StoreUtil.error(getClass(), e);
-                       }
-               }
-               super.setInput(input);
-       }
-
-       @Override
-       protected void markViewPartDirty() {
-               if (getInput() instanceof DerivedUnitFacade) {
-                       getViewPart().changed(
-                                       ((DerivedUnitFacade) getInput()).innerDerivedUnit());
-               }
-
-               super.markViewPartDirty();
-       }
-
-       // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.eclipse.jface.viewers.Viewer#refresh()
-        */
-       /** {@inheritDoc} */
-       @Override
-       protected void showParts() {
-           // FIXME (CM) : Need to clean out this code.
-           // Too much type checking to decide which detail view to display.
-           // Need to build in a mechanism where navigators / editors are 'aware'
-           // of the corresponding detail viewer.
-               if (getInput() instanceof TaxonBase) {
-                       createTaxonSections(rootElement);
-
-               } else if (getInput() instanceof NonViralName) {
-                       createNameSections(rootElement);
-
-               } else if (getInput() instanceof Reference) {
-                       createReferenceSections(rootElement);
-
-               } else if (getInput() instanceof Team) {
-                       createTeamDetailSection(rootElement);
-
-               } else if (getInput() instanceof Person) {
-                       createPersonDetailSection(rootElement);
-
-               } else if (getInput() instanceof TeamOrPersonBase) {
-                       createTeamOrPersonBaseDetailSection(rootElement);
-
-               } else if (getInput() instanceof DescriptionBase) {
-                       Set<Marker> descriptionMarkers = ((DescriptionBase) getInput()).getMarkers();
-                       MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
-                       Boolean isUseDescription = false;
-                       for (Marker marker : descriptionMarkers) {
-                               if (marker.getMarkerType().equals(useMarkertype)) {
-                                       isUseDescription = true;
-                               }
-                       }
-                       if (((DescriptionBase) getInput()).isImageGallery()) {
-                               createImageGallerySection(rootElement);
-
-                       } else if (isUseDescription) { 
-                               createUseDescriptionSection(rootElement);
-                       } else {
-                               createDescriptionSection(rootElement);
-
-                       }
-               } else if (getInput() instanceof DescriptionElementBase) {
-                       Set<Marker> descriptionMarkers = ((DescriptionElementBase) getInput()).getInDescription().getMarkers();
-                       MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
-                       Boolean isUseDescription = false;
-                       for (Marker marker : descriptionMarkers) {
-                               if (marker.getMarkerType().equals(useMarkertype)) {
-                                       isUseDescription = true;
-                               }
-                       }
-                       
-                       if (isUseDescription == true && getInput() instanceof CategoricalData ) {
-                               createUseRecordSection(rootElement);
-                       }
-                       else {
-                               createDescriptionElementSection(rootElement);
-                       }
-
-               } else if (getInput() instanceof Media) {
-                       createMediaElementSection(rootElement);
-
-               } else if (getInput() instanceof DerivedUnitFacade) {
-                       createDerivedUnitBaseElementSection(rootElement);
-
-               } else if (getInput() instanceof FeatureNodeContainer) {
-                       createFeatureDistributionSection(rootElement);
-
-               } else if (getInput() instanceof PolytomousKey) {
-                       //createPolytomousKeySection(rootElement);
-
-               } else if ((getInput() instanceof PolytomousKeyNode)
-                               || (getInput() instanceof PolytomousKeyRelationship)) {
-                       createPolytomousKeyNodeSection(rootElement);
-
-               } else if (getInput() instanceof User) {
-                       createUserSection(rootElement);
-
-               } else if (getInput() instanceof Group) {
-                       createGroupSection(rootElement);
-
-               } else if (getInput() instanceof TaxonRelationship) {
-                       createTaxonRelationshipSection(rootElement);
-
-               } else if (getInput() instanceof TermVocabulary) {
-                       createTermVocabularySection(rootElement);
-
-               } else if (getInput() instanceof DefinedTermBase) {
-                       createDefinedTermSection(rootElement);
-               } else {
-                       destroySections();
-               }
-               layout();
-       }
-
-       
-       /**
-        * @param rootElement
-        */
-       private void createGroupSection(RootElement parent) {
-               destroySections();
-
-               GroupDetailSection groupDetailSection = (GroupDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.GROUP,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-               MemberDetailSection memberDetailSection = (MemberDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.MEMBER,
-                                               getConversationHolder(), parent, Section.TWISTIE
-                                                               | Section.EXPANDED);
-               GrantedAuthorityDetailSection grantedAuthorityDetailSection = (GrantedAuthorityDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.GRANTED_AUTHORITY,
-                                               getConversationHolder(), parent, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(groupDetailSection);
-               addPart(memberDetailSection);
-               addPart(grantedAuthorityDetailSection);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.eclipse.jface.viewers.Viewer#getSelection()
-        */
-       /** {@inheritDoc} */
-       @Override
-       public ISelection getSelection() {
-               return selection;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
-        * .ISelection, boolean)
-        */
-       /** {@inheritDoc} */
-       @Override
-       public void setSelection(ISelection selection, boolean reveal) {
-               this.selection = selection;
-               SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(
-                               this, selection);
-               fireSelectionChanged(selectionChangedEvent);
-       }
-
-       /**
-        * createTaxonSections(RootElement parent)
-        * @param parent
-        */
-       private void createTaxonSections(RootElement parent) {
-               destroySections();
-
-               TaxonBaseDetailSection taxonBaseDetailSection = (TaxonBaseDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.TAXONBASE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.NONVIRALNAME,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.NOMENCLATURALSTATUS,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               ProtologueSection protologSection = (ProtologueSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.PROTOLOG,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.TYPEDESIGNATION,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               ParsingMessagesSection parsingMessagesSection = (ParsingMessagesSection) formFactory
-                               .createCdmDetailSection(DetailType.PARSINGMESSAGE,
-                                               getConversationHolder(), parent, this, Section.EXPANDED);
-
-               addPart(taxonBaseDetailSection);
-               addPart(nonViralNameSection);
-               addPart(nomenclaturalStatusSection);
-               addPart(protologSection);
-               addPart(referenceDetailSection);
-               addPart(typeDesignationSection);
-               addPart(nameRelationshipSection);
-               addPart(parsingMessagesSection);
-       }
-
-       /**
-        * createNameSections
-        * @param parent
-        */
-       private void createNameSections(RootElement parent) {
-               destroySections();
-               NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.NONVIRALNAME,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.NOMENCLATURALSTATUS,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               ProtologueSection protologSection = (ProtologueSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.PROTOLOG,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.TYPEDESIGNATION,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               addPart(nonViralNameSection);
-               addPart(nomenclaturalStatusSection);
-               addPart(protologSection);
-               addPart(referenceDetailSection);
-               addPart(typeDesignationSection);
-               addPart(nameRelationshipSection);
-       }
-
-       /**
-        * createReferenceSections
-        * @param parent
-        */
-       private void createReferenceSections(RootElement parent) {
-               destroySections();
-
-               ReferenceDetailSection referenceDetailSection = (ReferenceDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.REFERENCEBASE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(referenceDetailSection);
-       }
-
-       /**
-        * createTeamOrPersonBaseDetailSection
-        * @param parent
-        */
-       private void createTeamOrPersonBaseDetailSection(RootElement parent) {
-               destroySections();
-               TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.TEAMORPERSONBASE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(teamOrPersonBaseDetailSection);
-       }
-
-       /**
-        * createTeamDetailSection
-        * @param parent
-        */
-       private void createTeamDetailSection(RootElement parent) {
-               destroySections();
-               TeamDetailSection teamDetailSection = (TeamDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.TEAM,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(teamDetailSection);
-       }
-       
-       /**
-        * createPersonDetailSection
-        * @param parent
-        */
-       private void createPersonDetailSection(RootElement parent) {
-               destroySections();
-               PersonDetailSection personDetailSection = (PersonDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.PERSON,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-               addPart(personDetailSection);
-       }
-
-       /**
-        * createDescriptionElementSection
-        * @param parent
-        */
-       private void createDescriptionElementSection(RootElement parent) {
-               destroySections();
-
-               DescriptionElementDetailSection descriptionElementDetailSection = (DescriptionElementDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DESCRIPTIONELEMENT,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.DESCRIPTIONELEMENTSOURCE,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection) formFactory
-                               .createEntityDetailSection(
-                                               EntityDetailType.DESCRIPTIONELEMENTMEDIA,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               addPart(descriptionElementDetailSection);
-               addPart(descriptionElementSourceSection);
-               addPart(descriptionElementMediaSection);
-       }
-
-       /**
-        * createDescriptionSection
-        * @param parent
-        */
-       private void createDescriptionSection(RootElement parent) {
-               destroySections();
-               DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DESCRIPTION,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               NaturalLanguageSection naturalLanguageSection = (NaturalLanguageSection) formFactory
-                               .createCdmDetailSection(DetailType.NATURAL_LANGUAGE,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               ScopeSection scopeSection = (ScopeSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.SCOPE,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               addPart(descriptionDetailSection);
-               addPart(naturalLanguageSection);
-               addPart(describedSpecimenSection);
-               addPart(descriptionSourceSection);
-               addPart(scopeSection);
-       }
-       
-       /**
-        * Creates the use Description section
-        * @param parent
-        */
-       private void createUseDescriptionSection(RootElement parent) {
-               destroySections();
-               DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DESCRIPTION,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
-                                               getConversationHolder(), parent, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               addPart(descriptionDetailSection);
-               addPart(descriptionSourceSection);
-               
-       }
-
-
-       /**
-        * @param rootElement
-        */
-       private void createImageGallerySection(RootElement parent) {
-               destroySections();
-               DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DESCRIPTION,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(descriptionDetailSection);
-       }
-       
-       /**
-        * createMediaElementSection
-        * @param parent
-        */
-
-       private void createMediaElementSection(RootElement parent) {
-               destroySections();
-               MediaDetailsSection mediaDetailSection = (MediaDetailsSection) formFactory
-                               .createCdmDetailSection(DetailType.MEDIA,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(mediaDetailSection);
-       }
-
-       /**
-        * createDerivedUnitBaseElementSection
-        * @param parent
-        */
-       private void createDerivedUnitBaseElementSection(RootElement parent) {
-               destroySections();
-
-               GeneralDetailSection generalDetailSection = (GeneralDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               GatheringEventDetailSection gatheringEventDetailSection = (GatheringEventDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.GATHERING_EVENT,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               FieldObservationDetailSection fieldObservationDetailSection = (FieldObservationDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.FIELD_OBSERVATION,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = (DerivedUnitBaseDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DERIVED_UNIT,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               DeterminationDetailSection determinationDetailSection = (DeterminationDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.DETERMINATION,
-                                               getConversationHolder(), parent, this, Section.TWISTIE);
-
-               addPart(generalDetailSection);
-               addPart(gatheringEventDetailSection);
-               addPart(fieldObservationDetailSection);
-               addPart(derivedUnitBaseDetailSection);
-               addPart(determinationDetailSection);
-
-       }
-
-       /**
-        * @param rootElement
-        */
-       private void createFeatureDistributionSection(RootElement parent) {
-               destroySections();
-
-               FeatureDistributionDetailSection featureDistributionSection = (FeatureDistributionDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.FEATURE_DISTRIBUTION,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(featureDistributionSection);
-       }
-
-       private void createPolytomousKeySection(RootElement parent) {
-               destroySections();
-
-               PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-               TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE,
-                                               getConversationHolder(), parent, Section.TWISTIE);
-
-               addPart(polytomousKeyDetailSection);
-               addPart(geographicalScopeDetailSection);
-               addPart(scopeRestrictionSection);
-               addPart(taxonomicScopeSection);
-       }
-
-       /**
-        * createPolytomousKeyNodeSection
-        * @param parent
-        */
-       private void createPolytomousKeyNodeSection(RootElement parent) {
-               destroySections();
-
-        PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
-                .createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
-                        getConversationHolder(), parent, this, Section.TWISTIE
-                               | Section.COMPACT);
-        
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        
-        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
-                .createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE,
-                        getConversationHolder(), parent, this, Section.TWISTIE
-                                | Section.EXPANDED);
-
-//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-//
-//        GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
-//                .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
-//                        getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
-//
-//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-//
-//        ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
-//                .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
-//                        getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
-//
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory
-                .createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE,
-                        getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);        
-
-           addPart(polytomousKeyDetailSection);
-           addPart(polytomousKeyNodeDetailSection);
-//         addPart(geographicalScopeDetailSection);
-//         addPart(scopeRestrictionSection);
-           addPart(taxonomicScopeSection);
-
-       }
-       
-       /**
-        * create the UseRecordSection
-        * @param parent
-        */
-       private void createUseRecordSection(RootElement parent) {
-               destroySections();
-
-               UseRecordDetailSection descriptionUseRecordSection = (UseRecordDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.USE_RECORD,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-               
-               addPart(descriptionUseRecordSection);
-               
-               
-       }
-
-       /**
-        * createUserSection
-        * @param parent
-        */
-       private void createUserSection(RootElement parent) {
-               destroySections();
-
-               UserDetailSection userDetailSection = (UserDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.USER,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               GroupsByUserDetailSection groupByUserDetailSection = (GroupsByUserDetailSection) formFactory
-                               .createEntityDetailSection(EntityDetailType.GROUPS_BY_USER,
-                                               getConversationHolder(), parent, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               addPart(userDetailSection);
-               addPart(groupByUserDetailSection);
-       }
-
-       /**
-        * createTaxonRelationshipSection
-        * @param parent
-        */
-       private void createTaxonRelationshipSection(RootElement parent) {
-               destroySections();
-
-               TaxonRelationshipDetailSection taxonRelationshipDetailSection = (TaxonRelationshipDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.TAXON_RELATIONSHIP,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-
-               ReferencedEntityDetailSection referencedEntityBaseDetailSection = (ReferencedEntityDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.REFERENCED_ENTITY,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-               addPart(taxonRelationshipDetailSection);
-               addPart(referencedEntityBaseDetailSection);
-       }
-
-       /**
-        * @param rootElement
-        */
-       private void createTermVocabularySection(RootElement parent) {
-               destroySections();
-
-               TermVocabularyDetailSection termVocabularyDetailSection = (TermVocabularyDetailSection) formFactory
-                               .createCdmDetailSection(DetailType.TERM_VOCABULARY,
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-               addPart(termVocabularyDetailSection);
-       }
-
-       /**
-        * createDefinedTermSection
-        * @param parent
-        */
-       private void createDefinedTermSection(RootElement parent) {
-               destroySections();
-
-               AbstractFormSection definedTermDetailSection = formFactory
-                               .createDefinedTermDetailSection(getInput().getClass(),
-                                               getConversationHolder(), parent, this, Section.TWISTIE
-                                                               | Section.EXPANDED);
-               addPart(definedTermDetailSection);
-       }
+    private ISelection selection;
+
+    /**
+     * <p>
+     * Constructor for DetailsViewer.
+     * </p>
+     *
+     * @param parent
+     *            a {@link org.eclipse.swt.widgets.Composite} object.
+     * @param viewPart
+     *            a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
+     *            object.
+     */
+    public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
+        super(parent, viewPart);
+    }
+
+    // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
+    // since we are getting implementations of DerivedUnitBase from the bulk
+    // editor
+    // and not derived unit facade objects,
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
+     * .lang.Object)
+     */
+    @Override
+    public void setInput(Object input) {
+        if (input instanceof DerivedUnitBase) {
+            try {
+                input = DerivedUnitFacade.NewInstance((DerivedUnitBase) input,
+                        PreferencesUtil.getDerivedUnitConfigurator());
+            } catch (DerivedUnitFacadeNotSupportedException e) {
+                AbstractUtility.error(getClass(), e);
+            }
+        }
+        super.setInput(input);
+    }
+
+    @Override
+    protected void markViewPartDirty() {
+        if (getInput() instanceof DerivedUnitFacade) {
+            getViewPart().changed(((DerivedUnitFacade) getInput()).innerDerivedUnit());
+        }
+
+        super.markViewPartDirty();
+    }
+
+    // END HACK TO MAKE THE DERIVED UNIT FACADE WORK
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.jface.viewers.Viewer#refresh()
+     */
+    /** {@inheritDoc} */
+    @Override
+    protected void showParts() {
+        // FIXME (CM) : Need to clean out this code.
+        // Too much type checking to decide which detail view to display.
+        // Need to build in a mechanism where navigators / editors are 'aware'
+        // of the corresponding detail viewer.
+        Object input = getInput();
+        if (input instanceof TaxonBase) {
+            createTaxonSections(rootElement);
+
+        } else if (input instanceof NonViralName) {
+            createNameSections(rootElement);
+
+        } else if (input instanceof Reference) {
+            createReferenceSections(rootElement);
+
+        } else if (input instanceof Team) {
+            createTeamDetailSection(rootElement);
+
+        } else if (input instanceof Person) {
+            createPersonDetailSection(rootElement);
+
+        } else if (input instanceof TeamOrPersonBase) {
+            createTeamOrPersonBaseDetailSection(rootElement);
+
+        } else if (input instanceof DescriptionBase) {
+            Set<Marker> descriptionMarkers = ((DescriptionBase) input).getMarkers();
+            MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
+                    UsageTermCollection.uuidUseMarkerType);
+            Boolean isUseDescription = false;
+            for (Marker marker : descriptionMarkers) {
+                if (marker.getMarkerType().equals(useMarkertype)) {
+                    isUseDescription = true;
+                }
+            }
+            if (((DescriptionBase) input).isImageGallery()) {
+                createImageGallerySection(rootElement);
+
+            } else if (isUseDescription) {
+                createUseDescriptionSection(rootElement);
+            } else {
+                createDescriptionSection(rootElement);
+
+            }
+        } else if (input instanceof DescriptionElementBase) {
+            Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
+            MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(
+                    UsageTermCollection.uuidUseMarkerType);
+            Boolean isUseDescription = false;
+            for (Marker marker : descriptionMarkers) {
+                if (marker.getMarkerType().equals(useMarkertype)) {
+                    isUseDescription = true;
+                }
+            }
+
+            if (isUseDescription == true && input instanceof CategoricalData) {
+                createUseRecordSection(rootElement);
+            } else {
+                createDescriptionElementSection(rootElement);
+            }
+
+        } else if (input instanceof Media) {
+            createMediaElementSection(rootElement);
+
+        } else if (input instanceof DerivedUnitFacade) {
+            createDerivedUnitBaseElementSection(rootElement);
+
+        } else if (input instanceof FeatureNodeContainer) {
+            createFeatureDistributionSection(rootElement);
+
+        } else if (input instanceof PolytomousKey) {
+            // createPolytomousKeySection(rootElement);
+
+        } else if ((input instanceof PolytomousKeyNode) || (input instanceof PolytomousKeyRelationship)) {
+            createPolytomousKeyNodeSection(rootElement);
+        } else if (input instanceof User) {
+            createUserSection(rootElement);
+        } else if (input instanceof Group) {
+            createGroupSection(rootElement);
+        } else if (input instanceof TaxonRelationship) {
+            createTaxonRelationshipSection(rootElement);
+        } else if (input instanceof TermVocabulary) {
+            createTermVocabularySection(rootElement);
+        } else if (input instanceof DefinedTermBase) {
+            createDefinedTermSection(rootElement);
+        } else {
+            destroySections();
+        }
+        layout();
+    }
+
+    /**
+     * @param rootElement
+     */
+    private void createGroupSection(RootElement parent) {
+        destroySections();
+
+        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
+        MemberDetailSection memberDetailSection = (MemberDetailSection) formFactory.createEntityDetailSection(EntityDetailType.MEMBER, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        GrantedAuthorityDetailSection grantedAuthorityDetailSection = (GrantedAuthorityDetailSection) formFactory.createEntityDetailSection(EntityDetailType.GRANTED_AUTHORITY, getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(groupDetailSection);
+        addPart(memberDetailSection);
+        addPart(grantedAuthorityDetailSection);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.jface.viewers.Viewer#getSelection()
+     */
+    /** {@inheritDoc} */
+    @Override
+    public ISelection getSelection() {
+        return selection;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
+     * .ISelection, boolean)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public void setSelection(ISelection selection, boolean reveal) {
+        this.selection = selection;
+        SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
+        fireSelectionChanged(selectionChangedEvent);
+    }
+
+    /**
+     * createTaxonSections(RootElement parent)
+     *
+     * @param parent
+     */
+    private void createTaxonSections(RootElement parent) {
+        destroySections();
+
+        TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+                        | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent,ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
+
+        addPart(taxonBaseDetailSection);
+        addPart(nonViralNameSection);
+        addPart(nomenclaturalStatusSection);
+        addPart(protologSection);
+        addPart(referenceDetailSection);
+        addPart(typeDesignationSection);
+        addPart(nameRelationshipSection);
+        addPart(parsingMessagesSection);
+    }
+
+    /**
+     * createNameSections
+     *
+     * @param parent
+     */
+    private void createNameSections(RootElement parent) {
+        destroySections();
+        NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory.createEntityDetailSection(EntityDetailType.NOMENCLATURALSTATUS, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        ProtologueSection protologSection = (ProtologueSection) formFactory.createEntityDetailSection(EntityDetailType.PROTOLOG, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(nonViralNameSection);
+        addPart(nomenclaturalStatusSection);
+        addPart(protologSection);
+        addPart(referenceDetailSection);
+        addPart(typeDesignationSection);
+        addPart(nameRelationshipSection);
+    }
+
+    /**
+     * createReferenceSections
+     *
+     * @param parent
+     */
+    private void createReferenceSections(RootElement parent) {
+        destroySections();
+
+        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(referenceDetailSection);
+    }
+
+    /**
+     * createTeamOrPersonBaseDetailSection
+     *
+     * @param parent
+     */
+    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
+        destroySections();
+        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(teamOrPersonBaseDetailSection);
+    }
+
+    /**
+     * createTeamDetailSection
+     *
+     * @param parent
+     */
+    private void createTeamDetailSection(RootElement parent) {
+        destroySections();
+        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(teamDetailSection);
+    }
+
+    /**
+     * createPersonDetailSection
+     *
+     * @param parent
+     */
+    private void createPersonDetailSection(RootElement parent) {
+        destroySections();
+        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        addPart(personDetailSection);
+    }
+
+    /**
+     * createDescriptionElementSection
+     *
+     * @param parent
+     */
+    private void createDescriptionElementSection(RootElement parent) {
+        destroySections();
+
+        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONELEMENTMEDIA, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(descriptionElementDetailSection);
+        addPart(descriptionElementSourceSection);
+        addPart(descriptionElementMediaSection);
+    }
+
+    /**
+     * createDescriptionSection
+     *
+     * @param parent
+     */
+    private void createDescriptionSection(RootElement parent) {
+        destroySections();
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        ScopeSection scopeSection = (ScopeSection) formFactory.createEntityDetailSection(EntityDetailType.SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(descriptionDetailSection);
+        addPart(naturalLanguageSection);
+        addPart(describedSpecimenSection);
+        addPart(descriptionSourceSection);
+        addPart(scopeSection);
+    }
+
+    /**
+     * Creates the use Description section
+     *
+     * @param parent
+     */
+    private void createUseDescriptionSection(RootElement parent) {
+        destroySections();
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(descriptionDetailSection);
+        addPart(descriptionSourceSection);
+
+    }
+
+    /**
+     * @param rootElement
+     */
+    private void createImageGallerySection(RootElement parent) {
+        destroySections();
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(descriptionDetailSection);
+    }
+
+    /**
+     * createMediaElementSection
+     *
+     * @param parent
+     */
+
+    private void createMediaElementSection(RootElement parent) {
+        destroySections();
+        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(mediaDetailSection);
+    }
+
+    /**
+     * createDerivedUnitBaseElementSection
+     *
+     * @param parent
+     */
+    private void createDerivedUnitBaseElementSection(RootElement parent) {
+        destroySections();
+
+        GeneralDetailSection generalDetailSection = formFactory.createGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFieldObservationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        addPart(generalDetailSection);
+        addPart(gatheringEventDetailSection);
+        addPart(fieldObservationDetailSection);
+        addPart(derivedUnitBaseDetailSection);
+        addPart(determinationDetailSection);
+    }
+
+    /**
+     * @param rootElement
+     */
+    private void createFeatureDistributionSection(RootElement parent) {
+        destroySections();
+
+        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(featureDistributionSection);
+    }
+
+    /**
+     * createPolytomousKeyNodeSection
+     *
+     * @param parent
+     */
+    private void createPolytomousKeyNodeSection(RootElement parent) {
+        destroySections();
+
+        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory.createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
+
+        addPart(polytomousKeyDetailSection);
+        addPart(polytomousKeyNodeDetailSection);
+        addPart(taxonomicScopeSection);
+
+    }
+
+    /**
+     * create the UseRecordSection
+     *
+     * @param parent
+     */
+    private void createUseRecordSection(RootElement parent) {
+        destroySections();
+
+        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(descriptionUseRecordSection);
+
+    }
+
+    /**
+     * createUserSection
+     *
+     * @param parent
+     */
+    private void createUserSection(RootElement parent) {
+        destroySections();
+
+        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        GroupsByUserDetailSection groupByUserDetailSection = (GroupsByUserDetailSection) formFactory.createEntityDetailSection(EntityDetailType.GROUPS_BY_USER, getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        addPart(userDetailSection);
+        addPart(groupByUserDetailSection);
+    }
+
+    /**
+     * createTaxonRelationshipSection
+     *
+     * @param parent
+     */
+    private void createTaxonRelationshipSection(RootElement parent) {
+        destroySections();
+
+        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        addPart(taxonRelationshipDetailSection);
+        addPart(referencedEntityBaseDetailSection);
+    }
+
+    /**
+     * @param rootElement
+     */
+    private void createTermVocabularySection(RootElement parent) {
+        destroySections();
+
+        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        addPart(termVocabularyDetailSection);
+    }
+
+    /**
+     * createDefinedTermSection
+     *
+     * @param parent
+     */
+    private void createDefinedTermSection(RootElement parent) {
+        destroySections();
+
+        AbstractFormSection definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        addPart(definedTermDetailSection);
+    }
+
+    private void createFODetailsView(RootElement parent) {
+        destroySections();
+
+        GeneralDetailSection generalDetailSection = formFactory.createFOSection(getConversationHolder(), parent, this,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        FieldObservationDetailSection fieldObservationDetailSection = formFactory.createFODetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+
+        addPart(generalDetailSection);
+        addPart(gatheringEventDetailSection);
+        addPart(fieldObservationDetailSection);
+    }
 }
index 28ad2a86ccae86972e3b8c010b76d25c8c00c8a3..18e07cb06259da04554adc530ee428a345be4ce0 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -20,11 +20,10 @@ import org.eclipse.ui.part.EditorPart;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
-import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
-import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
 
 
 /**
@@ -40,7 +39,7 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
        public static final String ID = "eu.etaxonomy.taxeditor.view.supplementalData";
 
        private SupplementalDataViewer viewer;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
         */
@@ -52,36 +51,42 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
 
 
        /** {@inheritDoc} */
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-               if(StoreUtil.getActiveEditor() == null){
+       @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+               if(AbstractUtility.getActiveEditor() == null){
                        showEmptyPage();
                        return;
                }
-               
-               if(((part instanceof EditorPart) || (part instanceof AbstractCdmViewPart)) && selection instanceof IStructuredSelection) {
-                       IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+
+        if(!(selection instanceof IStructuredSelection)){
+            return;
+        }
+
+        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+
+               if((part instanceof EditorPart || part instanceof IPartContentHasSupplementalData)) {
                        if(structuredSelection.size() != 1){
                                showEmptyPage();
                                return;
                        }
-                       
+
                        // do not show supplemental data for feature nodes
                        if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
                                showEmptyPage();
                                return;
                        }
-                       if(structuredSelection.getFirstElement() instanceof DerivedUnitFacade){
+                       else if(structuredSelection.getFirstElement() instanceof DerivedUnitFacade){
                                return;
                        }
-                       if(structuredSelection.getFirstElement() instanceof PolytomousKeyNode){
+                       else if(structuredSelection.getFirstElement() instanceof PolytomousKeyNode){
                            structuredSelection = new StructuredSelection(((PolytomousKeyNode)structuredSelection.getFirstElement()).getKey());
             }
                        showViewer(part, structuredSelection);
                }else{
-                       showEmptyPage();                
+                       showEmptyPage();
                }
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void dispose() {
@@ -101,10 +106,11 @@ public class SupplementalDataViewPart extends AbstractCdmEditorViewPart {
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                // TODO Auto-generated method stub
                return false;
        }
-       
-       
+
+
 }