2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.actions
.cdm
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.jface
.action
.Action
;
14 import org
.eclipse
.jface
.viewers
.ISelection
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
17 import eu
.etaxonomy
.taxeditor
.TaxEditorPlugin
;
18 import eu
.etaxonomy
.taxeditor
.controller
.GlobalController
;
19 import eu
.etaxonomy
.taxeditor
.model
.CdmSessionDataRepository
;
20 import eu
.etaxonomy
.taxeditor
.navigation
.TaxonomicTreeViewer
;
23 * Moves taxon in the taxonomic tree by assigning it a new parent
24 * and triggering observable tree list update
30 public class MoveTaxonAction
extends Action
{
31 private static final Logger logger
= Logger
32 .getLogger(MoveTaxonAction
.class);
38 public MoveTaxonAction(Taxon taxon
, Taxon newParentTaxon
) {
41 this.newParentTaxon
= newParentTaxon
;
43 // Save old parent taxon for undo
44 this.oldParentTaxon
= taxon
.getTaxonomicParent();
49 CdmSessionDataRepository
.getDefault().
50 setTaxonomicParent(taxon
, newParentTaxon
);
51 new SaveTaxonAction(taxon
).run();