ref #8239: disable details for missing rights
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / element / CdmFormFactory.java
index 30bb0b74c03e69e6044cf9499950990994b2e584..fb5f7b6b803fc576952555d5efcf0a2b72ddeca3 100644 (file)
@@ -2490,12 +2490,16 @@ public class CdmFormFactory extends FormToolkit {
         addAndAdaptSection(parentElement, section);
         return section;
     }
-
     public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
+    public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, Reference defaultSource, int style){
+        DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, defaultSource, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
 
     public ExtensionSection createExtensionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
         ExtensionSection section = new ExtensionSection(this, conversation, parentElement, style);
@@ -2785,10 +2789,20 @@ public class CdmFormFactory extends FormToolkit {
         } else if (entity instanceof DescriptionElementSource && parentElement.getEntity() instanceof CommonTaxonName) {
             element = new CommonNameSourceElement(this, parentElement, (DescriptionElementSource) entity,
                     removeListener, style);
+        } else if (entity instanceof DescriptionElementSource  && parentElement.getEntity() instanceof Distribution) {
+            Composite parent = null;
+            if (parentElement instanceof DescriptionElementSourceSection){
+               parent = ((DescriptionElementSourceSection)parentElement).getParent();
+            }
+            if(parent != null){
+                Composite grandParent = parent.getParent();
+            }
+            element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
+                    removeListener, style, false);
         } else if (entity instanceof DescriptionElementSource) {
             element = new DescriptionElementSourceElement(this, parentElement, (DescriptionElementSource) entity,
                     removeListener, style, false);
-        } else if (entity instanceof TaxonNodeAgentRelation) {
+        }else if (entity instanceof TaxonNodeAgentRelation) {
             element = new TaxonNodeAgentRelationCollectionElement(this, parentElement, (TaxonNodeAgentRelation) entity,
                     removeListener,backgroundColor, style);
         }