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
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>OpenBulkEditorHandler class.</p>
31 public class OpenBulkEditorHandler
extends AbstractHandler
{
32 private static final Logger logger
= Logger
.getLogger(OpenBulkEditorHandler
.class);
35 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
38 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
39 String inputTypeId
= event
.getParameter(IBulkEditorConstants
.INPUT_TYPE_PARAMETER_ID
);
40 BulkEditorInputType inputType
= BulkEditorInputType
.getById(inputTypeId
);
42 HandlerUtil
.getActiveWorkbenchWindow(event
).getActivePage().
43 openEditor(AbstractBulkEditorInput
.NewInstance(inputType
), BulkEditor
.ID
);
44 } catch (PartInitException e
) {
45 new RuntimeException(e
);
46 logger
.error("Error opening bulk editor", e
);