// $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;
* <p>
* TaxonInteractionDetailElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Jun 10, 2010
* @version 1.0
* <p>
* Constructor for TaxonInteractionDetailElement.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
@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<Language, LanguageString> descriptions = entity.getDescription();
+
+ if (descriptions.get(CdmStore.getDefaultLanguage()) != null) {
+ interactionDescription.setText(descriptions.get(
+ CdmStore.getDefaultLanguage()).getText());
+ }
}
/** {@inheritDoc} */