3 * Copyright (C) 2013 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.campanula
.detailViews
.fieldObservation
;
12 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
13 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.NumberFieldController
;
14 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
.TextFieldController
;
15 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
24 public class FieldObservationDetailsElementController
extends AbstractCdmDetailElement
<DerivedUnitFacade
> {
26 private FieldObservationDetailsElement fieldObservationDetailsElement
;
28 private TextFieldController text_ecology
;
30 private TextFieldController text_plantDescription
;
32 private TextFieldController text_fieldObjectDefinition
;
34 private TextFieldController text_fieldNotes
;
36 private NumberFieldController number_individualCount
;
40 * Constructor for FieldObservationDetailElement.
44 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
47 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
50 public FieldObservationDetailsElementController(FieldObservationDetailsElement fieldObservationDetailsElement
, CdmFormFactory formFactory
, ICdmFormElement formElement
) {
51 super(formFactory
, formElement
);
52 this.fieldObservationDetailsElement
= fieldObservationDetailsElement
;
57 protected void createControls(ICdmFormElement formElement
, DerivedUnitFacade entity
, int style
) {
58 // text_ecology = new TextFieldController(fieldObservationDetailsElement.getText_ecology(), getFormFactory(), formElement, entity.getEcology(CdmStore.getDefaultLanguage()), null);
59 // text_plantDescription = new TextFieldController(fieldObservationDetailsElement.getText_plantDescription(), getFormFactory(), formElement, entity.getPlantDescription(CdmStore.getDefaultLanguage()), style);
61 // text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style);
62 text_fieldNotes
= new TextFieldController(fieldObservationDetailsElement
.getText_FieldNotes(), getFormFactory(), formElement
, entity
.getFieldNotes(), style
);
64 number_individualCount
= new NumberFieldController(fieldObservationDetailsElement
.getText_IndividualCount(), getFormFactory(), formElement
, entity
.getIndividualCount());
69 public void handleEvent(Object eventSource
) {
70 // if (eventSource == text_ecology) {
71 // getEntity().setEcology(text_ecology.getText());
72 // } else if (eventSource == text_plantDescription) {
73 // getEntity().setPlantDescription(text_plantDescription.getText());
74 // } else if (eventSource == text_fieldObjectDefinition) {
75 // getEntity().addFieldObjectDefinition(text_fieldObjectDefinition.getText(), CdmStore.getDefaultLanguage());
77 if (eventSource
== text_fieldNotes
) {
78 getEntity().setFieldNotes(text_fieldNotes
.getText());
79 } else if (eventSource
== number_individualCount
) {
80 getEntity().setIndividualCount(number_individualCount
.getInteger());