ref #9199: layout issues and code cleaning
authorKatja Luther <k.luther@bgbm.org>
Wed, 2 Dec 2020 17:28:21 +0000 (18:28 +0100)
committerKatja Luther <k.luther@bgbm.org>
Wed, 2 Dec 2020 17:28:21 +0000 (18:28 +0100)
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/AdvancedNomenclaturalSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/AdvancedSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceElement.java

index ab4e30c356e4f2b7915d8cc6f6e7f602e5ad9fb1..93441847fe0ffffead9639b52b6fb3bc873cecf5 100755 (executable)
@@ -141,11 +141,6 @@ public class ExternalLinksSection extends AbstractEntityCollectionSection<Origin
     }
 
 
-    public String getEmptySectionString() {
-        return emptySectionString;
-    }
-
-
     public void setEmptySectionString(String emptySectionString) {
         this.emptySectionString = emptySectionString;
     }
index 18494ff370ccbd1aca0e6d154f96eef853e06f38..bb08cef7b1d5ce81bd756c63fdb10cc86af94fb4 100755 (executable)
@@ -38,7 +38,10 @@ public class AdvancedNomenclaturalSourceElement extends AdvancedSourceElement {
     protected void createControls(ICdmFormElement formElement, OriginalSourceBase entity, int style) {
         Display display = Display.getCurrent();
         Color background = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+        text_originaleNameString = formFactory.createTextWithLabelElement(
+                formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
 
+        text_originaleNameString.setBackground(background);
 
         if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
             text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", entity != null?entity.getIdNamespace():null, style);
@@ -49,11 +52,6 @@ public class AdvancedNomenclaturalSourceElement extends AdvancedSourceElement {
             text_idInSource.setBackground(background);
 
         }
-
-        text_originaleNameString = formFactory.createTextWithLabelElement(
-                formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
-
-        text_originaleNameString.setBackground(background);
         Label label = formFactory.createEmptyCell(getLayoutComposite());
     }
 
index ae8dd82e09a8665f99388209fff1fe3aa4cef7af..7578a92e1590a25a57f6b4738e80640523a74cc6 100755 (executable)
@@ -45,6 +45,11 @@ public class AdvancedSourceElement extends AbstractCdmDetailElement<OriginalSour
     protected void createControls(ICdmFormElement formElement, OriginalSourceBase entity, int style) {
         Display display = Display.getCurrent();
         Color background = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+        text_originaleNameString = formFactory.createTextWithLabelElement(
+                formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
+
+        text_originaleNameString.setBackground(background);
+
         if (entity instanceof DescriptionElementSource){
             select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Name in Source", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.DELETABLE, style);
             select_nameUsedInSource.setBackground(background);
@@ -60,20 +65,6 @@ public class AdvancedSourceElement extends AbstractCdmDetailElement<OriginalSour
 
         }
 
-        text_originaleNameString = formFactory.createTextWithLabelElement(
-                formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
-
-        text_originaleNameString.setBackground(background);
-
-
-
-//        externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
-//        externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
-//        externalLinks.setEntity(entity);
-//
-//        externalLinks.setBackground(background);
-//        addControl(externalLinks);
-//        addElement(externalLinks);
     }
 
     @Override
index fa19bb626c8761d49b8c01e78bd8728352c0fb48..02c7345841a12a178ca3a32df26713c336a5a56d 100755 (executable)
@@ -24,7 +24,6 @@ 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.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElementWithAbbreviatedTitle;
@@ -36,19 +35,10 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElementWithAbbreviated
 public class NomenclaturalSourceElement extends OriginalSourceElement {
 
     private EntitySelectionElementWithAbbreviatedTitle<Reference> selection_NomRef;
-
-//    protected EntitySelectionElement<Reference> selection_Ref;
-//    protected TextWithLabelElement microReference;
-//    protected OriginalSourceAdvancedSection advancedSection;
     protected String label = "Source";
     protected CdmBase cdmEntity;
 
-    protected TextWithLabelElement text_idInSource;
-    protected TextWithLabelElement text_idNamespace;
-    protected TextWithLabelElement text_originaleNameString;
-    protected TextWithLabelElement text_cdmsource;
     protected EntitySelectionElement<TaxonName> select_nameUsedInSource;
-
     protected ExternalLinksSection externalLinks;
 
 
@@ -84,7 +74,6 @@ public class NomenclaturalSourceElement extends OriginalSourceElement {
         }
 
         microReference = formFactory.createTextWithLabelElement(formElement, "Details", entity != null? entity.getCitationMicroReference(): "", style);
-//        microReference.setIndent(15);
 
         Label sep = formFactory.createLabel(formElement.getLayoutComposite(), "");
         sep.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
@@ -92,10 +81,11 @@ public class NomenclaturalSourceElement extends OriginalSourceElement {
         select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original Spelling", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
 
         externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Protologue/Original Publication", StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
+        externalLinks.setEmptySectionString("No protologue yet.");
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
         externalLinks.setEntity(entity);
         externalLinks.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
-        externalLinks.setEmptySectionString("No protologue yet.");
+
 
         addControl(externalLinks);
         addElement(externalLinks);
@@ -109,8 +99,6 @@ public class NomenclaturalSourceElement extends OriginalSourceElement {
         advancedSection.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
         addControl(advancedSection);
         addElement(advancedSection);
-
-
         this.getLayoutComposite().layout();
 
     }