3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.bulkeditor
.handler
;
11 import org
.apache
.log4j
.Logger
;
12 import org
.eclipse
.core
.commands
.AbstractHandler
;
13 import org
.eclipse
.core
.commands
.ExecutionEvent
;
14 import org
.eclipse
.core
.commands
.ExecutionException
;
15 import org
.eclipse
.ui
.PartInitException
;
16 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
18 import eu
.etaxonomy
.taxeditor
.bulkeditor
.BulkEditor
;
19 import eu
.etaxonomy
.taxeditor
.bulkeditor
.IBulkEditorConstants
;
20 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.AbstractBulkEditorInput
;
21 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.BulkEditorInputType
;
24 * <p>OpenBulkEditorHandler class.</p>
30 public class OpenBulkEditorHandler
extends AbstractHandler
{
31 private static final Logger logger
= Logger
.getLogger(OpenBulkEditorHandler
.class);
34 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
37 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
38 String inputTypeId
= event
.getParameter(IBulkEditorConstants
.INPUT_TYPE_PARAMETER_ID
);
39 BulkEditorInputType inputType
= BulkEditorInputType
.getById(inputTypeId
);
41 HandlerUtil
.getActiveWorkbenchWindow(event
).getActivePage().
42 openEditor(AbstractBulkEditorInput
.NewInstance(inputType
), BulkEditor
.ID
);
43 } catch (PartInitException e
) {
44 new RuntimeException(e
);
45 logger
.error("Error opening bulk editor", e
);