From c9c903d7036616d2e78dcb415c9be22f85c85f53 Mon Sep 17 00:00:00 2001 From: "n.hoffmann" Date: Mon, 19 Jan 2009 10:50:15 +0000 Subject: [PATCH] refactoring actions in the treeviewer --- .gitattributes | 2 + .../src/eu/etaxonomy/taxeditor/UiUtil.java | 83 +++++++++++- .../actions/cdm/DeleteTaxonAction.java | 119 ++++++++++------- .../ui/OpenNewChildNameEditorAction.java | 11 +- .../actions/ui/OpenTaxonEditorAction.java | 27 ---- .../operations/DeleteTaxonOperation.java | 125 ++++++++++++++++++ .../operations/MoveTaxonOperation.java | 77 +++++++++++ 7 files changed, 367 insertions(+), 77 deletions(-) create mode 100644 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/DeleteTaxonOperation.java create mode 100644 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/MoveTaxonOperation.java diff --git a/.gitattributes b/.gitattributes index 0645dbc4d..98c98bdd8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -513,6 +513,8 @@ eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/navigation/Tax eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/navigation/TaxonomicTreeView.java -text eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/navigation/TaxonomicTreeViewer.java -text eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/AbstractEditorOperation.java -text +eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/DeleteTaxonOperation.java -text +eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/MoveTaxonOperation.java -text eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/name/ChangeHomotypicGroupOperation.java -text eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/name/ChangeMisappliedNameToSynonymOperation.java -text eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/name/ChangeSynonymToMisappliedNameOperation.java -text diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/UiUtil.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/UiUtil.java index 702558104..993e531d2 100644 --- a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/UiUtil.java +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/UiUtil.java @@ -42,11 +42,16 @@ import org.eclipse.ui.views.properties.PropertySheetPage; import eu.etaxonomy.cdm.model.description.Feature; import eu.etaxonomy.cdm.model.name.NameRelationshipType; import eu.etaxonomy.cdm.model.name.Rank; +import eu.etaxonomy.cdm.model.name.TaxonNameBase; import eu.etaxonomy.cdm.model.taxon.Taxon; +import eu.etaxonomy.taxeditor.actions.cdm.SaveTaxonAction; +import eu.etaxonomy.taxeditor.datasource.CdmTransactionController; import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor; +import eu.etaxonomy.taxeditor.editor.name.CdmParserController; import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor; import eu.etaxonomy.taxeditor.model.CdmSessionDataRepository; import eu.etaxonomy.taxeditor.model.NameEditorInput; +import eu.etaxonomy.taxeditor.navigation.RecentNamesView; import eu.etaxonomy.taxeditor.navigation.TaxonomicTreeView; import eu.etaxonomy.taxeditor.navigation.TaxonomicTreeViewer; import eu.etaxonomy.taxeditor.propertysheet.CustomSortPropertySheetEntry; @@ -103,6 +108,45 @@ public class UiUtil { // ps.addPropertyListener(l) } + public static void saveAll(){ + setIsSaving(true); + + // Get all open windows + for (IEditorPart taxonEditor : getOpenTaxonEditors()) { + + // Save the dirty ones + if (taxonEditor.isDirty()) { + + + IEditorInput input = taxonEditor.getEditorInput(); + if (input.getAdapter(Taxon.class) != null) { + Taxon taxon = (Taxon) input.getAdapter(Taxon.class); + CdmSessionDataRepository.getDefault().saveTaxon(taxon); + if (taxonEditor instanceof MultiPageTaxonEditor) { + ((MultiPageTaxonEditor) taxonEditor).setDirtyExtern(false); + } + } + } + } + + // Commit the transaction + CdmTransactionController.commitTransaction(); + + // Force library objects to be associated with new transaction + CdmSessionDataRepository.getDefault().clearNonTaxonData(); + + // Start a new transaction + CdmTransactionController.startTransaction(); + + // Put all open taxa in the new transaction + CdmTransactionController.addSessionTaxaToTransaction(); + + setIsSaving(false); + // TODO: delete undoHistory + } + + //public void deleteTaxon() + /** * @param input * @return @@ -180,8 +224,43 @@ public class UiUtil { return getActivePage().openEditor(input, editorId); } + /** + * Open an emtpy taxon editor + * + * @return + * @throws PartInitException + */ + public static IEditorPart openTaxonEditor() + throws PartInitException{ + return openTaxonEditor(null); + } + + /** + * Open a taxon editor for the given taxon + * + * @param taxon + * @return + * @throws PartInitException + */ public static IEditorPart openTaxonEditor(Taxon taxon) throws PartInitException{ + if(taxon == null){ + TaxonNameBase name = CdmParserController.parseFullReference("", null, null); + name.setFullTitleCache("", false); + name.setTitleCache("", false); + taxon = Taxon.NewInstance(name, + CdmSessionDataRepository.getDefault().getDefaultSec()); + }else{ + // If this taxon is not visible in the tree, open node + TaxonomicTreeViewer treeViewer = getTreeViewer(); + if (treeViewer != null) { + treeViewer.revealTaxon(taxon); + } + + // Add to recent names list + RecentNamesView.addRecentName(taxon); + } + IEditorInput input = new NameEditorInput(taxon); return openEditor(input, MultiPageTaxonEditor.ID); } @@ -285,7 +364,9 @@ public class UiUtil { } public static IUndoContext getWorkbenchUndoContext() { - return getOperationSupport().getUndoContext(); + // TODO make this more specific than GLOBAL_UNDO_CONTEXT +// return getOperationSupport().getUndoContext(); + return IOperationHistory.GLOBAL_UNDO_CONTEXT; } public static void doEditorSave(Taxon taxon, boolean confirm) { diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/cdm/DeleteTaxonAction.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/cdm/DeleteTaxonAction.java index 3b8a251ef..fabf90a7d 100644 --- a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/cdm/DeleteTaxonAction.java +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/cdm/DeleteTaxonAction.java @@ -15,19 +15,20 @@ package eu.etaxonomy.taxeditor.actions.cdm; * @version 1.0 */ import org.apache.log4j.Logger; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.IOperationHistory; +import org.eclipse.core.commands.operations.IUndoContext; +import org.eclipse.core.commands.operations.IUndoableOperation; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.PartInitException; import eu.etaxonomy.cdm.model.taxon.Taxon; import eu.etaxonomy.taxeditor.ITaxEditorConstants; import eu.etaxonomy.taxeditor.TaxEditorPlugin; import eu.etaxonomy.taxeditor.UiUtil; -import eu.etaxonomy.taxeditor.actions.SaveAllAction; -import eu.etaxonomy.taxeditor.model.CdmSessionDataRepository; -import eu.etaxonomy.taxeditor.model.CdmUtil; +import eu.etaxonomy.taxeditor.operations.DeleteTaxonOperation; /** * Delete this taxon from the CDM @@ -43,11 +44,17 @@ public class DeleteTaxonAction extends Action { private ImageDescriptor image = TaxEditorPlugin.getDefault() .getImageDescriptor(ITaxEditorConstants.ACTIVE_DELETE_ICON); + private IOperationHistory operationHistory; + private IUndoContext undoContext; + Taxon taxon; public DeleteTaxonAction() { super(text); setImageDescriptor(image); + + operationHistory = UiUtil.getOperationHistory(); + undoContext = UiUtil.getWorkbenchUndoContext(); } public DeleteTaxonAction(Taxon taxon) { @@ -57,53 +64,69 @@ public class DeleteTaxonAction extends Action { } public void run() { - - // Get taxon name for progress monitor - String taxonName = CdmUtil.getDisplayName(taxon); - - // Get and start progress monitor + IUndoableOperation operation = new DeleteTaxonOperation + (this.getText(), undoContext, taxon); + IProgressMonitor monitor = UiUtil.getStatusLineProgressMonitor(); - monitor.beginTask("Deleting taxon '" + taxonName + "'.", 10); - // Call save all action - new SaveAllAction().run(null); - monitor.worked(2); - - // If the taxon has children, cancel operation - // TODO add option to continue, and delete children - if (taxon.hasTaxonomicChildren()) { - MessageDialog.openInformation(UiUtil.getShell(), "Cannot delete taxon", - "'" + CdmUtil.getDisplayName(taxon) + "' has taxonomic children. " + - "These must be manually deleted before their parent."); - monitor.done(); - return; - } - monitor.worked(1); - - // Close taxon's editor, if any is active try { - UiUtil.closeEditor(taxon, true); - } catch (PartInitException e) { - e.printStackTrace(); - } - monitor.worked(1); - - // Delete taxon from CDM layer - CdmSessionDataRepository.getDefault().deleteTaxon(taxon); - monitor.worked(4); - - // Call save all action - new SaveAllAction().run(null); - monitor.worked(2); - - // Close the progress monitor - monitor.done(); + IStatus status = operationHistory.execute(operation, monitor, null); + } catch (ExecutionException e) { + logger.error("Error deleting taxon", e); + } - // Announce taxon was deleted on status line - UiUtil.setStatusLine("Deleted taxon '" + taxonName + "'."); + // Handle this in an operation so we are able to undo it -// Status status = new Status(IStatus.INFO, TaxEditorPlugin.PLUGIN_ID, -// "Deleted.", null); -// StatusManager.getManager().handle(status, StatusManager.SHOW); +// +// // Get taxon name for progress monitor +// String taxonName = CdmUtil.getDisplayName(taxon); +// +// // Get and start progress monitor +// IProgressMonitor monitor = UiUtil.getStatusLineProgressMonitor(); +// monitor.beginTask("Deleting taxon '" + taxonName + "'.", 10); +// +// // Call save all action +// new SaveAllAction().run(null); +// monitor.worked(2); +// +// // If the taxon has children, cancel operation +// // TODO add option to continue, and delete children +// if (taxon.hasTaxonomicChildren()) { +// MessageDialog.openInformation(UiUtil.getShell(), "Cannot delete taxon", +// "'" + CdmUtil.getDisplayName(taxon) + "' has taxonomic children. " + +// "These must be manually deleted before their parent."); +// monitor.done(); +// return; +// } +// monitor.worked(1); +// +// +// // Close taxon's editor, if any is active +// try { +// UiUtil.closeEditor(taxon, true); +// } catch (PartInitException e) { +// e.printStackTrace(); +// } +// monitor.worked(1); +// +// // Delete taxon from CDM layer +// CdmSessionDataRepository.getDefault().deleteTaxon(taxon); +// monitor.worked(4); +// +// +// +// // Call save all action +// new SaveAllAction().run(null); +// monitor.worked(2); +// +// // Close the progress monitor +// monitor.done(); +// +// // Announce taxon was deleted on status line +// UiUtil.setStatusLine("Deleted taxon '" + taxonName + "'."); +// +//// Status status = new Status(IStatus.INFO, TaxEditorPlugin.PLUGIN_ID, +//// "Deleted.", null); +//// StatusManager.getManager().handle(status, StatusManager.SHOW); } } \ No newline at end of file diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenNewChildNameEditorAction.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenNewChildNameEditorAction.java index f27ec8ad6..55523882d 100644 --- a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenNewChildNameEditorAction.java +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenNewChildNameEditorAction.java @@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.actions.ui; import org.apache.log4j.Logger; import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.PartInitException; import eu.etaxonomy.cdm.model.name.BotanicalName; import eu.etaxonomy.cdm.model.name.NonViralName; @@ -21,6 +22,7 @@ import eu.etaxonomy.cdm.model.reference.ReferenceBase; import eu.etaxonomy.cdm.model.taxon.Taxon; import eu.etaxonomy.taxeditor.ITaxEditorConstants; import eu.etaxonomy.taxeditor.TaxEditorPlugin; +import eu.etaxonomy.taxeditor.UiUtil; import eu.etaxonomy.taxeditor.preference.PreferencesUtil; /** @@ -62,6 +64,13 @@ public class OpenNewChildNameEditorAction extends Action { parentTaxon.addTaxonomicChild(taxon, null, null); - new OpenTaxonEditorAction(taxon).run(); + // Open editor for new taxon + try { + UiUtil.openTaxonEditor(taxon); + } catch (PartInitException e) { + e.printStackTrace(); + } + + //new OpenTaxonEditorAction(taxon).run(); } } \ No newline at end of file diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenTaxonEditorAction.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenTaxonEditorAction.java index 445bae36b..d0d194339 100644 --- a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenTaxonEditorAction.java +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/actions/ui/OpenTaxonEditorAction.java @@ -64,39 +64,12 @@ public class OpenTaxonEditorAction extends Action implements IWorkbenchWindowAct public OpenTaxonEditorAction() { super(newTaxonText); setImageDescriptor(image); -// setActionDefinitionId(ID); setId(ID); } @Override public void run() { - // Initialize taxon - if (taxon == null) { - - // Passing the parser an empty string will return a new - // new name object with the name class specified in the - // preference store, i.e. BotanicalName - TaxonNameBase name = CdmParserController.parseFullReference("", null, null); - name.setFullTitleCache("", false); - name.setTitleCache("", false); - this.taxon = Taxon.NewInstance(name, - CdmSessionDataRepository.getDefault().getDefaultSec()); - - // Note: don't add taxon to repository - it's not yet valid - - } else { - - // If this taxon is not visible in the tree, open node - TaxonomicTreeViewer treeViewer = UiUtil.getTreeViewer(); - if (treeViewer != null) { - treeViewer.revealTaxon(taxon); - } - - // Add to recent names list - RecentNamesView.addRecentName(taxon); - } - try { UiUtil.openTaxonEditor(taxon); } catch (PartInitException e) { diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/DeleteTaxonOperation.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/DeleteTaxonOperation.java new file mode 100644 index 000000000..e815ad14b --- /dev/null +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/DeleteTaxonOperation.java @@ -0,0 +1,125 @@ +/** +* Copyright (C) 2007 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ + +package eu.etaxonomy.taxeditor.operations; + +import org.apache.log4j.Logger; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.AbstractOperation; +import org.eclipse.core.commands.operations.IUndoContext; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.ui.PartInitException; + +import eu.etaxonomy.cdm.model.taxon.Taxon; +import eu.etaxonomy.taxeditor.UiUtil; +import eu.etaxonomy.taxeditor.model.CdmSessionDataRepository; + +/** + * @author n.hoffmann + * @created 16.01.2009 + * @version 1.0 + */ +public class DeleteTaxonOperation extends AbstractEditorOperation { + private static Logger logger = Logger.getLogger(DeleteTaxonOperation.class); + + private Taxon parentTaxon; + public DeleteTaxonOperation(String text, IUndoContext undoContext, + Taxon taxon) { + super(text, undoContext, taxon); + + parentTaxon = taxon.getTaxonomicParent(); + } + + /* (non-Javadoc) + * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) + */ + @Override + public IStatus execute(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + + // TODO move this logic to another place + + // Get taxon name + String taxonName = taxon.getName().getTitleCache(); + + // Prompt user for confirmation + if(! MessageDialog.openConfirm(UiUtil.getShell(), "Confirm Deletion", "Are you sure you want to delete taxon '" + taxonName + "'?")){ + monitor.done(); + return Status.CANCEL_STATUS; + } + + // Get and start progress monitor + monitor.beginTask("Deleting taxon '" + taxonName + "'.", 10); + + // Call save all + UiUtil.saveAll(); + monitor.worked(2); + + // If the taxon has children, cancel operation + // TODO add option to continue, and delete children + if (taxon.hasTaxonomicChildren()) { + MessageDialog.openInformation(UiUtil.getShell(), "Cannot delete taxon", + "'" + taxonName + "' has taxonomic children. " + + "These must be manually deleted before their parent."); + monitor.done(); + return Status.CANCEL_STATUS; + } + monitor.worked(1); + + + // Close taxon's editor, if any is active + try { + UiUtil.closeEditor(taxon, true); + } catch (PartInitException e) { + e.printStackTrace(); + } + monitor.worked(1); + + // Delete taxon from CDM layer + CdmSessionDataRepository.getDefault().removeTaxon(taxon); + monitor.worked(4); + + // Call save all + UiUtil.saveAll(); + monitor.worked(2); + + // Close the progress monitor + monitor.done(); + + // Announce taxon was deleted on status line + UiUtil.setStatusLine("Deleted taxon '" + taxonName + "'."); + + return Status.OK_STATUS; + } + + /* (non-Javadoc) + * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) + */ + @Override + public IStatus redo(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + return execute(monitor, info); + } + + /* (non-Javadoc) + * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) + */ + @Override + public IStatus undo(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + // FIXME we have to add old citation + parentTaxon.addTaxonomicChild(taxon, null, null); + CdmSessionDataRepository.getDefault().addTaxon(taxon); + return Status.OK_STATUS; + } +} diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/MoveTaxonOperation.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/MoveTaxonOperation.java new file mode 100644 index 000000000..9117a8a09 --- /dev/null +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/operations/MoveTaxonOperation.java @@ -0,0 +1,77 @@ +/** +* Copyright (C) 2007 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ + +package eu.etaxonomy.taxeditor.operations; + +import org.apache.log4j.Logger; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.IUndoContext; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; + +import eu.etaxonomy.cdm.model.taxon.Taxon; +import eu.etaxonomy.taxeditor.model.CdmSessionDataRepository; + +/** + * @author n.hoffmann + * @created 16.01.2009 + * @version 1.0 + */ +public class MoveTaxonOperation extends AbstractEditorOperation { + + + private static Logger logger = Logger.getLogger(MoveTaxonOperation.class); + private Taxon newParentTaxon; + private Taxon oldParentTaxon; + + public MoveTaxonOperation(String label, IUndoContext undoContext, + Taxon taxon, Taxon newParentTaxon) { + super(label, undoContext, taxon); + + this.newParentTaxon = newParentTaxon; + + // Save old parent taxon for undo + this.oldParentTaxon = taxon.getTaxonomicParent(); + } + + /* (non-Javadoc) + * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) + */ + @Override + public IStatus execute(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + CdmSessionDataRepository.getDefault().setTaxonomicParent(taxon, newParentTaxon); + CdmSessionDataRepository.getDefault().saveTaxon(taxon); + + return Status.OK_STATUS; + } + + /* (non-Javadoc) + * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) + */ + @Override + public IStatus redo(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + return execute(monitor, info); + } + + /* (non-Javadoc) + * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) + */ + @Override + public IStatus undo(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + CdmSessionDataRepository.getDefault().setTaxonomicParent(taxon, oldParentTaxon); + CdmSessionDataRepository.getDefault().saveTaxon(taxon); + + return Status.OK_STATUS; + } +} -- 2.34.1