import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
-import eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.TermComboType;
-import eu.etaxonomy.taxeditor.ui.forms.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.selection.TaxonSelectionElement;
-import eu.etaxonomy.taxeditor.ui.term.DeterminationModifierComboElement;
+import eu.etaxonomy.cdm.model.occurrence.DeterminationModifier;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+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.CheckboxElement;
+import eu.etaxonomy.taxeditor.ui.section.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* <p>
public class DeterminationEventDetailElement extends
AbstractEventDetailElement<DeterminationEvent> {
- private DeterminationModifierComboElement combo_determinationModifier;
+ private TermComboElement<DeterminationModifier> combo_determinationModifier;
private CheckboxElement checkbox_preferredFlag;
- private TaxonSelectionElement selection_taxon;
+ private EntitySelectionElement<TaxonBase> selection_taxonBase;
// private TODO a set of references
* </p>
*
* @param formFactory
- * a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory}
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
* @param section
- * a {@link eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection}
+ * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
* object.
* @param entity
* a {@link eu.etaxonomy.cdm.model.occurrence.DeterminationEvent}
@Override
public void setEntity(DeterminationEvent entity) {
this.entity = entity;
+ combo_determinationModifier.setSelection(entity.getModifier());
+ selection_taxonBase.setEntity(entity.getTaxon());
super.setEntity(entity);
}
/** {@inheritDoc} */
@Override
public void createControls(ICdmFormElement element, int style) {
-
- combo_determinationModifier = (DeterminationModifierComboElement) formFactory
- .createTermComboElement(TermComboType.DETERMINATION_MODIFIER,
- element, "Determination Modifier", null, style);
-// checkbox_preferredFlag = formFactory.createCheckbox(element,
-// "Current", false, style);
- selection_taxon = (TaxonSelectionElement) formFactory
- .createSelectionElement(SelectionType.TAXON,
+ selection_taxonBase = formFactory
+ .createSelectionElement(TaxonBase.class,
getConversationHolder(), element, "Taxon", null,
- TaxonSelectionElement.DEFAULT, style);
+ EntitySelectionElement.NOTHING, style);
+
// TODO set of references
super.createControls(element, style);
+
+ element_timePeriod.setLabel("Determined When");
selection_agent.setLabel("Determined by");
+
+
+ combo_determinationModifier = formFactory.createTermComboElement(DeterminationModifier.class,
+ element, "Modifier", null, style);
}
/*
getEntity().setModifier(combo_determinationModifier.getSelection());
} else if (eventSource == checkbox_preferredFlag) {
getEntity().setPreferredFlag(checkbox_preferredFlag.getSelection());
- } else if (eventSource == selection_taxon) {
- getEntity().setTaxon(selection_taxon.getSelection());
+ } else if (eventSource == selection_taxonBase) {
+ getEntity().setTaxon(selection_taxonBase.getSelection());
}
// else if(eventSource == TODO set of references){
//