import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
import eu.etaxonomy.taxeditor.store.StoreUtil;
-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.CdmPropertyChangeEvent;
-import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-import eu.etaxonomy.taxeditor.ui.selection.TaxonSelectionElement;
-import eu.etaxonomy.taxeditor.ui.term.TaxonRelationshipTypeComboElement;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* @author n.hoffmann
*/
public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<TaxonRelationship> {
- private TaxonRelationshipTypeComboElement combo_taxonRelationshipType;
+ private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType;
- private TaxonSelectionElement selection_relatedTaxon;
+ private EntitySelectionElement<Taxon> selection_relatedTaxon;
public TaxonRelationshipDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
@Override
protected void createControls(ICdmFormElement formElement,
TaxonRelationship entity, int style) {
- combo_taxonRelationshipType = (TaxonRelationshipTypeComboElement) formFactory.createTermComboElement(
- TermComboType.TAXON_RELATIONSHIP_TYPE_INVERSE_CONTAINER,
+ combo_taxonRelationshipType = formFactory.createTermComboElement(
+ TaxonRelationshipTypeInverseContainer.class,
formElement, "Relationship Type",
getTaxonRelationshipTypeInverseContainer(), style);
combo_taxonRelationshipType.setEnabled(false);
- selection_relatedTaxon = (TaxonSelectionElement) formFactory.createSelectionElement(
- SelectionType.TAXON, getConversationHolder(),
+ selection_relatedTaxon = formFactory.createSelectionElement(
+ Taxon.class, getConversationHolder(),
formElement, "Related Taxon", getRelatedTaxon(),
- TaxonSelectionElement.SELECTABLE, style);
+ EntitySelectionElement.SELECTABLE, style);
}
private Taxon getRelatedTaxon() {
}else{
getEntity().setToTaxon(relatedTaxon);
}
-
}
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
}