Show DescriptionType message instead of toString()
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 14 Nov 2019 15:56:56 +0000 (16:56 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 14 Nov 2019 15:57:05 +0000 (16:57 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailElement.java

index fe4c3f3cc5fd15aec3e70abb221236ac9abab9bc..4e31b96d2002ee7363c50f7d03dca1fa5f8d1ecf 100644 (file)
@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
 import org.eclipse.jface.util.PropertyChangeEvent;
 
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.DescriptionType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
@@ -45,7 +46,11 @@ public class DescriptionDetailElement extends AbstractIdentifiableEntityDetailEl
                // it is similar to a FeatureTree (you can get this information from a feature tree) but not the same.
                // Please correct this once it is clear what descriptive system will be used for in CDM
 //             selection_featureTree = formFactory.createSelectionElement(FeatureTree.class, getConversationHolder(), formElement, "Feature Tree", null, EntitySelectionElement.ALL, style);
-        txtDescriptionTypes = formFactory.createTextWithLabelElement(formElement, "Types", entity.getTypes().stream().map(type->type.toString()).collect(Collectors.joining(",")), style);
+
+        Object typesString = entity.getTypes().stream().filter(type->type instanceof DescriptionType)
+        .map(type->((DescriptionType)type).getMessage())
+        .collect(Collectors.joining(","));
+        txtDescriptionTypes = formFactory.createTextWithLabelElement(formElement, "Types", typesString, style);
         txtDescriptionTypes.setEnabled(false);
        }