\r
import org.apache.log4j.Logger;\r
import org.eclipse.jface.action.Action;\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
import org.eclipse.jface.resource.ImageDescriptor;\r
import org.eclipse.ui.PartInitException;\r
\r
import eu.etaxonomy.taxeditor.ITaxEditorConstants;\r
import eu.etaxonomy.taxeditor.TaxEditorPlugin;\r
import eu.etaxonomy.taxeditor.UiUtil;\r
+import eu.etaxonomy.taxeditor.model.CdmUtil;\r
\r
/**\r
* Delete this taxon from the CDM\r
\r
public void run() {\r
\r
+ // If the taxon has children, cancel operation\r
+ // TODO add option to continue, and delete children\r
+ if (taxon.hasTaxonomicChildren()) {\r
+ MessageDialog.openInformation(UiUtil.getShell(), "Cannot delete taxon", \r
+ "'" + CdmUtil.getDisplayName(taxon) + "' has taxonomic children. " +\r
+ "These must be manually deleted before their parent.");\r
+ return;\r
+ }\r
+ \r
TaxEditorPlugin.getDefault().removeSessionTaxon(taxon);\r
\r
// Close taxon's editor, if any is active\r