import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
/**
* @author n.hoffmann
* @created 21.04.2009
* @version 1.0
- *
- * @deprecated Seems to be unused
*/
public class CreateChildTaxonHandler extends AbstractHandler implements
IHandler {
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- logger.error("Not yet implemented");
+
+ IEditorInput input = HandlerUtil.getActiveEditor(event).getEditorInput();
+ if (input instanceof TaxonEditorInput) {
+ Taxon parentTaxon = ((TaxonEditorInput) input).getTaxon();
+ try {
+ EditorUtil.openEmpty(parentTaxon.getUuid());
+ } catch (PartInitException e) {
+ logger.error("Error opening the editor", e);
+ }
+ }
return null;
}
}