1 package eu
.etaxonomy
.taxeditor
.editor
.handler
;
2 import org
.eclipse
.core
.commands
.AbstractHandler
;
3 import org
.eclipse
.core
.commands
.ExecutionEvent
;
4 import org
.eclipse
.core
.commands
.ExecutionException
;
5 import org
.eclipse
.core
.commands
.ParameterType
;
6 import org
.eclipse
.core
.commands
.common
.NotDefinedException
;
7 import org
.eclipse
.ui
.PartInitException
;
9 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
10 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
13 public class OpenTaxonEditorHandler
extends AbstractHandler
{
16 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
17 Object object
= event
.getObjectParameterForExecution("eu.etaxonomy.taxeditor.editor.taxonParameter");
20 ParameterType parameterType
= event
.getCommand().getParameterType("eu.etaxonomy.taxeditor.editor.taxonParameter");
21 if(parameterType
.isCompatible(object
)){
22 EditorUtil
.openTaxonEditor(object
);
24 } catch (NotDefinedException e
) {
25 MessagingUtils
.error(this.getClass(), "Parameter type not defined", e
);
26 } catch (PartInitException e
) {
27 MessagingUtils
.error(OpenTaxonEditorHandler
.class, "Error opening the editor", e
);