-// $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.
*/
import org.eclipse.swt.events.SelectionListener;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.cdm.model.common.VocabularyEnum;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractReferencedEntityElement;
/**
- * <p>NomenclaturalStatusElement class.</p>
- *
* @author n.hoffmann
* @created Nov 5, 2009
* @version 1.0
public class NomenclaturalStatusElement extends AbstractReferencedEntityElement<NomenclaturalStatus> implements IEntityElement<NomenclaturalStatus>, ISelectableElement{
private TermComboElement<NomenclaturalStatusType> nomenclaturalStatusTypeCombo;
-
+
private TextWithLabelElement ruleConsideredText;
-
- private SelectionArbitrator selectionArbitrator;
- /**
- * <p>Constructor for NomenclaturalStatusElement.</p>
- *
- * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
- * @param element a {@link eu.etaxonomy.cdm.model.name.NomenclaturalStatus} object.
- * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
- * @param style a int.
- * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
- */
+ private final SelectionArbitrator selectionArbitrator;
+
public NomenclaturalStatusElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement,
NomenclaturalStatus element, SelectionListener removeListener, int style) {
super(cdmFormFactory, formElement, element, removeListener, style);
selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
- */
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
- nomenclaturalStatusTypeCombo = formFactory.createTermComboElement(NomenclaturalStatusType.class, this, "Nomenclatural Status Type", null, style);
+ TermVocabulary vocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.NomenclaturalStatusType.getUuid());
+ nomenclaturalStatusTypeCombo = formFactory.createDefinedTermComboElement(vocabulary, this, "Nomenclatural Status Type", null,false, style, true);
ruleConsideredText = formFactory.createTextWithLabelElement(this, "Rule Considered", "", style);
-
+
super.createControls(element, style);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#setElement(eu.etaxonomy.cdm.model.common.VersionableEntity)
- */
/** {@inheritDoc} */
@Override
public void setEntity(NomenclaturalStatus entity) {
*
* @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} object.
*/
- public SelectionArbitrator getSelectionArbitrator() {
+ @Override
+ public SelectionArbitrator getSelectionArbitrator() {
return selectionArbitrator;
}
-
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
- */
+
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
else if(eventSource == text_referenceDetail){
getEntity().setCitationMicroReference(text_referenceDetail.getText());
}
- else if(eventSource == text_originaleNameString){
- getEntity().setOriginalNameString(text_originaleNameString.getText());
- }
}
}