3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.name
;
13 import org
.eclipse
.swt
.events
.SelectionListener
;
15 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
16 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatusType
;
17 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.IEntityElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.ISelectableElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.SelectionArbitrator
;
23 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
24 import eu
.etaxonomy
.taxeditor
.ui
.section
.campanula
.compatibility
.ICdmFormElement
;
25 import eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
.AbstractReferencedEntityElement
;
28 * <p>NomenclaturalStatusElement class.</p>
31 * @created Nov 5, 2009
34 public class NomenclaturalStatusElement
extends AbstractReferencedEntityElement
<NomenclaturalStatus
> implements IEntityElement
<NomenclaturalStatus
>, ISelectableElement
{
36 private TermComboElement
<NomenclaturalStatusType
> nomenclaturalStatusTypeCombo
;
38 private TextWithLabelElement ruleConsideredText
;
40 private SelectionArbitrator selectionArbitrator
;
43 * <p>Constructor for NomenclaturalStatusElement.</p>
45 * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
46 * @param element a {@link eu.etaxonomy.cdm.model.name.NomenclaturalStatus} object.
47 * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
49 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
51 public NomenclaturalStatusElement(CdmFormFactory cdmFormFactory
, AbstractFormSection formElement
,
52 NomenclaturalStatus element
, SelectionListener removeListener
, int style
) {
53 super(cdmFormFactory
, formElement
, element
, removeListener
, style
);
54 selectionArbitrator
= cdmFormFactory
.createSelectionArbitrator(this);
58 * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
62 public void createControls(ICdmFormElement element
, int style
) {
63 nomenclaturalStatusTypeCombo
= formFactory
.createTermComboElement(NomenclaturalStatusType
.class, this, "Nomenclatural Status Type", null, style
);
64 ruleConsideredText
= formFactory
.createTextWithLabelElement(this, "Rule Considered", "", style
);
66 super.createControls(element
, style
);
70 * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
74 public void setEntity(NomenclaturalStatus entity
) {
75 super.setEntity(entity
);
76 nomenclaturalStatusTypeCombo
.setSelection(entity
.getType());
77 ruleConsideredText
.setText(entity
.getRuleConsidered());
81 * <p>Getter for the field <code>selectionArbitrator</code>.</p>
83 * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} object.
85 public SelectionArbitrator
getSelectionArbitrator() {
86 return selectionArbitrator
;
91 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
95 public void handleEvent(Object eventSource
) {
96 if(eventSource
== nomenclaturalStatusTypeCombo
){
97 getEntity().setType(nomenclaturalStatusTypeCombo
.getSelection());
99 else if(eventSource
== ruleConsideredText
){
100 getEntity().setRuleConsidered(ruleConsideredText
.getText());
102 else if(eventSource
== selection_reference
){
103 getEntity().setCitation(selection_reference
.getSelection());
105 else if(eventSource
== text_referenceDetail
){
106 getEntity().setCitationMicroReference(text_referenceDetail
.getText());
108 else if(eventSource
== text_originaleNameString
){
109 getEntity().setOriginalNameString(text_originaleNameString
.getText());