1 package eu
.etaxonomy
.taxeditor
.prototype2
.controller
;
3 import org
.eclipse
.jface
.action
.Action
;
5 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
6 import eu
.etaxonomy
.taxeditor
.prototype2
.Activator
;
9 * Moves taxon in the taxonomic tree by assigning it a new parent
10 * and triggering observable tree list update
15 public class ActionMoveTaxon
extends Action
{
19 public ActionMoveTaxon(Taxon taxon
, Taxon newParentTaxon
) {
21 this.newParentTaxon
= newParentTaxon
;
26 // TODO Taxon.setParentTaxon(newParentTaxon)
27 taxon
.setTaxonomicParent(newParentTaxon
, null, null);
29 // Trigger re-draw in list by removing then adding taxon
30 Activator
.getDefault().getObservableTaxonTreeList().remove(taxon
);
31 Activator
.getDefault().getObservableTaxonTreeList().add(taxon
);
33 // Save the taxon to the CDM
34 Activator
.getDefault().getCdmApp().getTaxonService().saveTaxon(taxon
);