ref #10318: adapt termnode suppl. data to changes in dto
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / feature / TermNodeDetailElement.java
index d92b4ad1a3687609924635caee03d54e72ee8f0d..ed5833d2cd157a9980424de553b60b8230febf8b 100644 (file)
@@ -10,6 +10,8 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -38,17 +40,17 @@ public class TermNodeDetailElement extends AbstractCdmDetailElement<TermNodeDto>
 
        @Override
        protected void createControls(ICdmFormElement formElement, TermNodeDto entity, int style) {
-
-
-           sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(
-                    formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
-           sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionInapplicableIf.setEntity(getEntity());
-           sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(
-                   formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
-           sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionOnlyApplicableIf.setEntity(getEntity());
-
+               
+               if (entity.getType().equals(TermType.Feature)) {
+                   sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(
+                           formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
+                   sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+                   sectionInapplicableIf.setEntity(getEntity());
+                   sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(
+                           formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
+                   sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+                   sectionOnlyApplicableIf.setEntity(getEntity());
+               }
 
            DefinedTermBase term = CdmStore.getService(ITermService.class).load(getEntity().getTerm().getUuid());
            AbstractCdmDetailElement termDetailElement = formFactory.createDefinedTermDetailElement(term.getClass(), formElement, style);