fix #7715 Show sources for descriptions in DetailsView
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 3 Sep 2018 12:44:19 +0000 (14:44 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 3 Sep 2018 12:44:19 +0000 (14:44 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataViewerE4.java

index ffa132e574d5e6c2e0b43eaff20c26b3e2321a5e..0803a9748cda1adf39fecfb49212f47d9d349842 100755 (executable)
@@ -585,11 +585,10 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
         //
         //        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        //             DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
-        //                             .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
-        //                                             getConversationHolder(), parent, Section.TWISTIE);
-        //
-        //             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(
+                getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
@@ -598,7 +597,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
         addPart(descriptionDetailSection);
         addPart(naturalLanguageSection);
         //        addPart(describedSpecimenSection);
-        //             addPart(descriptionSourceSection);
+        addPart(descriptionSourceSection);
         addPart(scopeSection);
     }
 
index 693973d0341735a2accb5305b52bd40bde6f920b..cdd8fc1800d1582471eb500de96d022df87bd096 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.VersionableEntity;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -123,9 +124,12 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewerE4 {
 
     private void createIdentifiableSections(RootElement parent) {
 
-        SourceSection sourceSection = formFactory.createSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+        if(!(getInput() instanceof DescriptionBase)){
+            //sources are shown in DetailsView for Descriptions
+            SourceSection sourceSection = formFactory.createSourceSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            addPart(sourceSection);
+        }
 
         IdentifierSection identifierSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
 
@@ -143,7 +147,6 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewerE4 {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        addPart(sourceSection);
         addPart(identifierSection);
         addPart(extensionSection);
         addPart(creditSection);