*/
package eu.etaxonomy.taxeditor.ui.section.key;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
-import eu.etaxonomy.taxeditor.ui.forms.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.forms.KeyStatementElement;
-import eu.etaxonomy.taxeditor.ui.forms.NumberWithLabelElement;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.KeyStatementElement;
+import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.selection.FeatureSelectionElement;
-import eu.etaxonomy.taxeditor.ui.selection.PolytomousKeyNodeSelectionElement;
-import eu.etaxonomy.taxeditor.ui.selection.PolytomousKeySelectionElement;
-import eu.etaxonomy.taxeditor.ui.selection.TaxonSelectionElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* @author n.hoffmann
private KeyStatementElement element_statement;
- private FeatureSelectionElement selection_feature;
+ private EntitySelectionElement<Feature> selection_feature;
- private TaxonSelectionElement selection_taxon;
+ private EntitySelectionElement<Taxon> selection_taxon;
- private PolytomousKeySelectionElement selection_subkey;
+ private EntitySelectionElement<PolytomousKey> selection_subkey;
- private PolytomousKeyNodeSelectionElement selection_otherNode;
+ private EntitySelectionElement<PolytomousKeyNode> selection_otherNode;
private KeyStatementElement element_question;
PolytomousKeyNode entity, int style) {
if (!entity.isLeaf()) {
NumberWithLabelElement number_nodeNumber = formFactory
- .createIntegerTextWithLabelElement(formElement,
+ .createNumberTextWithLabelElement(formElement,
"Node Number", entity.getNodeNumber(), style);
number_nodeNumber.setEnabled(false);
}
element_question = formFactory.createKeyStatementElement(
formElement, "Question", parent.getQuestion(), 50, style);
+
+ selection_feature = formFactory
+ .createSelectionElement(Feature.class,
+ getConversationHolder(), formElement, "Character",
+ parent.getFeature(),
+ EntitySelectionElement.EDITABLE | EntitySelectionElement.DELETABLE, style);
}
element_statement = formFactory.createKeyStatementElement(formElement,
- "Statement", entity.getStatement(), 50, style);
-
- selection_feature = (FeatureSelectionElement) formFactory
- .createSelectionElement(SelectionType.FEATURE,
- getConversationHolder(), formElement, "Feature",
- entity.getFeature(), FeatureSelectionElement.DEFAULT,
- style);
+ "State(ment)", entity.getStatement(), 50, style);
- if (entity.isLeaf()) {
- selection_taxon = (TaxonSelectionElement) formFactory
- .createSelectionElement(SelectionType.TAXON,
+ //if (entity.isLeaf()) {
+ selection_taxon = formFactory
+ .createSelectionElement(Taxon.class,
getConversationHolder(), formElement, "Taxon",
- entity.getTaxon(), TaxonSelectionElement.DELETABLE,
+ entity.getTaxon(), EntitySelectionElement.NOTHING,
style);
- }
+ //}
- selection_subkey = (PolytomousKeySelectionElement) formFactory
- .createSelectionElement(SelectionType.POLYTOMOUS_KEY,
+ selection_subkey = formFactory
+ .createSelectionElement(PolytomousKey.class,
getConversationHolder(), formElement, "Subkey",
entity.getSubkey(),
- PolytomousKeySelectionElement.DEFAULT, style);
+ EntitySelectionElement.EDITABLE | EntitySelectionElement.DELETABLE, style);
- selection_otherNode = (PolytomousKeyNodeSelectionElement) formFactory
- .createSelectionElement(SelectionType.POLYTOMOUS_KEY_NODE,
+ selection_otherNode = formFactory
+ .createSelectionElement(PolytomousKeyNode.class,
getConversationHolder(), formElement, "Other Node",
entity.getOtherNode(),
- PolytomousKeyNodeSelectionElement.DEFAULT, style);
+ EntitySelectionElement.DELETABLE, style);
formFactory.createMultiLanguageTextElement(formElement,
"Modifying Text", entity.getModifyingText(), 50, style);
} else if (eventSource == element_statement) {
getEntity().setStatement(element_statement.getKeyStatement());
} else if (eventSource == selection_feature) {
- getEntity().setFeature(selection_feature.getEntity());
+ getEntity().getParent().setFeature(selection_feature.getEntity());
} else if (eventSource == selection_taxon) {
getEntity().setTaxon(selection_taxon.getEntity());
} else if (eventSource == selection_subkey) {
} else if (eventSource == selection_otherNode) {
getEntity().setOtherNode(selection_otherNode.getEntity());
}
-
- firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}
}