Merge branch 'release/5.8.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / supplemental / IdentifiableSourceElement.java
index b140c9329e2ce95e4b51467ecc4432cd17924b41..803cb2861c17294d6de644a5ffe0f0a756e21e24 100644 (file)
@@ -4,13 +4,16 @@
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
 
 /**
  * @author n.hoffmann
@@ -28,7 +31,7 @@ public class IdentifiableSourceElement extends AbstractOriginalSourceElement<Ide
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
                super.createControls(formElement, style);
-               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, IdentifiableSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
        }
 
@@ -36,8 +39,12 @@ public class IdentifiableSourceElement extends AbstractOriginalSourceElement<Ide
        @Override
        public void setEntity(IdentifiableSource entity) {
                super.setEntity(entity);
-               text_idInSource.setText(entity.getIdInSource());
-               text_idNamespace.setText(entity.getIdNamespace());
+               if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
+                   text_idInSource.setText(entity.getIdInSource());
+               }
+               if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
+                   text_idNamespace.setText(entity.getIdNamespace());
+               }
 
                selection_reference.setEntity(entity.getCitation());
                text_referenceDetail.setText(entity.getCitationMicroReference());