ref #9836: show name in source only for taxa
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / reference / SecundumSourceElement.java
index 844e7ff5bb77909fc8dd7dcb35d2e40b07d4cea6..79fdc1842e61eadbdf41a281f215bb21c3f83f1e 100755 (executable)
@@ -17,6 +17,7 @@ import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.SecundumSource;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -53,11 +54,8 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
 
         setEntityWithoutUpdate(HibernateProxyHelper.deproxy(entity));
 
-        this.selection_Ref = formFactory.createSelectionElement(Reference.class, formElement, "Secundum", null, EntitySelectionElement.ALL, style);
+        this.selection_Ref = formFactory.createSelectionElement(Reference.class, formElement, "Secundum", getEntity()!= null? getEntity().getCitation(): null, EntitySelectionElement.ALL, style);
 
-        if (getEntity() != null){
-            selection_Ref.setEntity(getEntity().getCitation());
-        }
         selection_Ref.setBackground(this.getPersistentBackground());
         for (ICdmFormElement element: selection_Ref.getElements()){
             element.setBackground(getPersistentBackground());
@@ -68,29 +66,17 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
         Label sep = formFactory.createLabel(formElement.getLayoutComposite(), "");
         sep.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         
-        select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Name in Source", entity != null? ((NamedSourceBase)entity).getNameUsedInSource(): null, EntitySelectionElement.DELETABLE, style);
-//        select_nameUsedInSource.setBackground(background);
-
+        
         externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Links", false, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setEmptySectionString("No links yet.");
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
         externalLinks.setEntity(getEntity());
         externalLinks.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
-
-
+        
         addControl(externalLinks);
         addElement(externalLinks);
-
-//        advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
-//        TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
-//
-//        advancedSection.setLayoutData(layoutData);
-//        advancedSection.setBackground(this.getPersistentBackground());
-//        advancedSection.setEntity(entity);
-//        advancedSection.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
-//        addControl(advancedSection);
-//        addElement(advancedSection);
         this.getLayoutComposite().layout();
+        
     }
     @Override
     public void handleEvent(Object eventSource) {