Project

General

Profile

Revision 211add74

ID211add74bff19d33490eaa2731d142709ba09736
Parent 935960dc
Child 49bb0781

Added by Katja Luther almost 4 years ago

smaller changes to display taxon interactions

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java
1 1
// $Id$
2 2
/**
3 3
 * Copyright (C) 2007 EDIT
4
 * European Distributed Institute of Taxonomy 
4
 * European Distributed Institute of Taxonomy
5 5
 * http://www.e-taxonomy.eu
6
 * 
6
 *
7 7
 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
 * See LICENSE.TXT at the top of this package for the full license terms.
9 9
 */
10 10

  
11 11
package eu.etaxonomy.taxeditor.ui.section.description.detail;
12 12

  
13
import org.eclipse.swt.SWT;
13
import java.util.Map;
14 14

  
15
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
15
import eu.etaxonomy.cdm.model.common.CdmBase;
16
import eu.etaxonomy.cdm.model.common.Language;
17
import eu.etaxonomy.cdm.model.common.LanguageString;
16 18
import eu.etaxonomy.cdm.model.description.TaxonInteraction;
17 19
import eu.etaxonomy.cdm.model.taxon.Taxon;
18 20
import eu.etaxonomy.taxeditor.store.CdmStore;
......
25 27
 * <p>
26 28
 * TaxonInteractionDetailElement class.
27 29
 * </p>
28
 * 
30
 *
29 31
 * @author n.hoffmann
30 32
 * @created Jun 10, 2010
31 33
 * @version 1.0
......
40 42
	 * <p>
41 43
	 * Constructor for TaxonInteractionDetailElement.
42 44
	 * </p>
43
	 * 
45
	 *
44 46
	 * @param formFactory
45 47
	 *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
46 48
	 *            object.
......
62 64
	@Override
63 65
	protected void createControls(ICdmFormElement formElement,
64 66
			TaxonInteraction entity, int style) {
65
		taxonSelection = formFactory
66
				.createSelectionElement(Taxon.class,
67
						getConversationHolder(), this, "Taxon",
68
						entity.getTaxon2(), EntitySelectionElement.NOTHING,
69
						SWT.WRAP);
70 67

  
71
		interactionDescription = formFactory.createMultiLineTextWithLabel(this,
72
				"Relationship to the taxon:", 200, SWT.WRAP);
73
		entity = HibernateProxyHelper.deproxy(entity, TaxonInteraction.class);
74
		interactionDescription.setText(entity.getDescription(CdmStore
75
				.getDefaultLanguage()));
68
	    taxonSelection = formFactory
69
                .createSelectionElement(Taxon.class,
70
                        getConversationHolder(), formElement, "Taxon",
71
                        CdmBase.deproxy(entity.getTaxon2(),Taxon.class),
72
                        EntitySelectionElement.ALL, style);
73

  
74
	    interactionDescription = formFactory.createMultiLineTextWithLabel(
75
                formElement, "Relationship to the unit:", 200, style);
76
        Map<Language, LanguageString> descriptions = entity.getDescription();
77

  
78
        if (descriptions.get(CdmStore.getDefaultLanguage()) != null) {
79
            interactionDescription.setText(descriptions.get(
80
                    CdmStore.getDefaultLanguage()).getText());
81
        }
76 82
	}
77 83

  
78 84
	/** {@inheritDoc} */

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)