Project

General

Profile

« Previous | Next » 

Revision 23783f7a

Added by Niels Hoffmann about 12 years ago

Refactoring of selection elements. Additional minor refactoring. Fixed a bug with Translation Editor (#2752)

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/IndividualsAssociationDetailElement.java
12 12

  
13 13
import java.util.Map;
14 14

  
15
import org.apache.log4j.Logger;
16

  
17 15
import eu.etaxonomy.cdm.model.common.Language;
18 16
import eu.etaxonomy.cdm.model.common.LanguageString;
19 17
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
18
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
20 19
import eu.etaxonomy.taxeditor.store.CdmStore;
21 20
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
22 21
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
23 22
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
24
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.SelectionType;
25
import eu.etaxonomy.taxeditor.ui.selection.DerivedUnitBaseSelectionElement;
23
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
26 24

  
27 25
/**
28 26
 * <p>
......
36 34
public class IndividualsAssociationDetailElement extends
37 35
		AbstractDetailedDescriptionDetailElement<IndividualsAssociation> {
38 36

  
39
	private static final Logger logger = Logger
40
			.getLogger(IndividualsAssociationDetailElement.class);
41 37
	private TextWithLabelElement text_description;
42
	private DerivedUnitBaseSelectionElement selection_derivedUnit;
38
	private EntitySelectionElement<DerivedUnitBase> selection_derivedUnit;
43 39

  
44 40
	/**
45 41
	 * <p>
......
69 65
	@Override
70 66
	protected void createControls(ICdmFormElement formElement,
71 67
			IndividualsAssociation entity, int style) {
72
		selection_derivedUnit = (DerivedUnitBaseSelectionElement) formFactory
73
				.createSelectionElement(SelectionType.DERIVED_UNIT,
68
		selection_derivedUnit = formFactory
69
				.createSelectionElement(DerivedUnitBase.class,
74 70
						getConversationHolder(), formElement, "Unit",
75
						entity.getAssociatedSpecimenOrObservation(),
76
						DerivedUnitBaseSelectionElement.DEFAULT, style);
71
						(DerivedUnitBase) entity.getAssociatedSpecimenOrObservation(),
72
						EntitySelectionElement.ALL, style);
77 73

  
78 74
		text_description = formFactory.createMultilineTextWithLabel(
79 75
				formElement, "Description", 200, style);
......
92 88
			getEntity().setAssociatedSpecimenOrObservation(
93 89
					selection_derivedUnit.getEntity());
94 90
		} else if (eventSource == text_description) {
95
			getEntity().addDescription(text_description.getText(),
96
					CdmStore.getDefaultLanguage());
91
			getEntity().putDescription(CdmStore.getDefaultLanguage(), text_description.getText());
97 92
		}
98 93

  
99 94
	}

Also available in: Unified diff