ref #9266: remove more section in nomenclatural source and keep protologue label
authorKatja Luther <k.luther@bgbm.org>
Tue, 24 Nov 2020 07:54:37 +0000 (08:54 +0100)
committerKatja Luther <k.luther@bgbm.org>
Tue, 24 Nov 2020 07:54:37 +0000 (08:54 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ExternalLinksSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceElement.java

index b2a0c79802b9710c12631ca8e188ee1819e903d4..2794a2afa2e3dfae6c1df61640357c79158fdd47 100644 (file)
@@ -2760,6 +2760,12 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, String label, int style){
+        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, label, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
     public RightsSection createRightsSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         RightsSection section = new RightsSection(this, conversation, parentElement, style);
 
index c90f2333c25afeb548da9ee074cbbc6f2ba725b1..f1aa09edb464d0fec832c9bceb8996082cc983f7 100755 (executable)
@@ -40,6 +40,20 @@ public class ExternalLinksSection extends AbstractEntityCollectionSection<Origin
     }
 
 
+    /**
+     * @param cdmFormFactory
+     * @param conversation
+     * @param parentElement
+     * @param string
+     * @param style
+     */
+    public ExternalLinksSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+            ICdmFormElement parentElement, String string, int style) {
+        super(cdmFormFactory, conversation, parentElement, string, style);
+
+    }
+
+
     @Override
     public Comparator<ExternalLink> getComparator() {
         return new Comparator<ExternalLink>(){
index 41532d66cb822211bcf316896802072bfb879c02..9c1cac5eca955e7562bf2a7e939b34b5da4280e7 100755 (executable)
@@ -9,13 +9,11 @@
 package eu.etaxonomy.taxeditor.ui.section.reference;
 
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.widgets.TableWrapData;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.name.TaxonName;
-import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -83,26 +81,26 @@ public class NomenclaturalSourceElement extends OriginalSourceElement {
         Label sep = formFactory.createLabel(formElement.getLayoutComposite(), "");
         sep.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 
-        select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original spelling", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
+        select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original Spelling", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
 
-        externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
+        externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Protologue/Original Publication", StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
         externalLinks.setEntity(entity);
-        externalLinks.setText("Protologue/original publication");
         externalLinks.setEmptySectionString("No protologue yet.");
 
         addControl(externalLinks);
         addElement(externalLinks);
 
-        advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
-        TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
-        layoutData.indent = 10;
+//        advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
+//        TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
+//        layoutData.indent = 10;
+//
+//        advancedSection.setLayoutData(layoutData);
+//        advancedSection.setBackground(this.getPersistentBackground());
+//        advancedSection.setEntity(entity);
+//        addControl(advancedSection);
+//        addElement(advancedSection);
 
-        advancedSection.setLayoutData(layoutData);
-        advancedSection.setBackground(this.getPersistentBackground());
-        advancedSection.setEntity(entity);
-        addControl(advancedSection);
-        addElement(advancedSection);
 
         this.getLayoutComposite().layout();
 
@@ -122,4 +120,5 @@ public class NomenclaturalSourceElement extends OriginalSourceElement {
     }
 
 
+
 }