From 211add74bff19d33490eaa2731d142709ba09736 Mon Sep 17 00:00:00 2001 From: Katja Luther Date: Tue, 8 Nov 2016 10:03:57 +0100 Subject: [PATCH] smaller changes to display taxon interactions --- .../detail/TaxonInteractionDetailElement.java | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java index 3a56e5c1f..972dd847b 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java @@ -1,18 +1,20 @@ // $Id$ /** * Copyright (C) 2007 EDIT - * European Distributed Institute of Taxonomy + * European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu - * + * * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ package eu.etaxonomy.taxeditor.ui.section.description.detail; -import org.eclipse.swt.SWT; +import java.util.Map; -import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; +import eu.etaxonomy.cdm.model.common.CdmBase; +import eu.etaxonomy.cdm.model.common.Language; +import eu.etaxonomy.cdm.model.common.LanguageString; import eu.etaxonomy.cdm.model.description.TaxonInteraction; import eu.etaxonomy.cdm.model.taxon.Taxon; import eu.etaxonomy.taxeditor.store.CdmStore; @@ -25,7 +27,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; *

* TaxonInteractionDetailElement class. *

- * + * * @author n.hoffmann * @created Jun 10, 2010 * @version 1.0 @@ -40,7 +42,7 @@ public class TaxonInteractionDetailElement extends *

* Constructor for TaxonInteractionDetailElement. *

- * + * * @param formFactory * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} * object. @@ -62,17 +64,21 @@ public class TaxonInteractionDetailElement extends @Override protected void createControls(ICdmFormElement formElement, TaxonInteraction entity, int style) { - taxonSelection = formFactory - .createSelectionElement(Taxon.class, - getConversationHolder(), this, "Taxon", - entity.getTaxon2(), EntitySelectionElement.NOTHING, - SWT.WRAP); - interactionDescription = formFactory.createMultiLineTextWithLabel(this, - "Relationship to the taxon:", 200, SWT.WRAP); - entity = HibernateProxyHelper.deproxy(entity, TaxonInteraction.class); - interactionDescription.setText(entity.getDescription(CdmStore - .getDefaultLanguage())); + taxonSelection = formFactory + .createSelectionElement(Taxon.class, + getConversationHolder(), formElement, "Taxon", + CdmBase.deproxy(entity.getTaxon2(),Taxon.class), + EntitySelectionElement.ALL, style); + + interactionDescription = formFactory.createMultiLineTextWithLabel( + formElement, "Relationship to the unit:", 200, style); + Map descriptions = entity.getDescription(); + + if (descriptions.get(CdmStore.getDefaultLanguage()) != null) { + interactionDescription.setText(descriptions.get( + CdmStore.getDefaultLanguage()).getText()); + } } /** {@inheritDoc} */ -- 2.34.1