a172c2275bb573b92f6bb55213331590f297c061
[taxeditor.git] / taxeditor-bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / handler / OpenBulkEditorHandler.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10 package eu.etaxonomy.taxeditor.bulkeditor.handler;
11 import org.eclipse.core.commands.AbstractHandler;
12 import org.eclipse.core.commands.ExecutionEvent;
13 import org.eclipse.core.commands.ExecutionException;
14 import org.eclipse.ui.PartInitException;
15 import org.eclipse.ui.handlers.HandlerUtil;
16
17 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
18 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
19 import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput;
20
21 /**
22 * @author p.ciardelli
23 * @created 25.06.2009
24 * @version 1.0
25 */
26 public class OpenBulkEditorHandler extends AbstractHandler {
27
28 /* (non-Javadoc)
29 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
30 */
31 public Object execute(ExecutionEvent event) throws ExecutionException {
32 String inputType = event.getParameter(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID);
33 try {
34 HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().
35 openEditor(BulkEditorInput.NewInstance(inputType), BulkEditor.ID);
36 } catch (PartInitException e) {
37 // TODO catch
38 e.printStackTrace();
39 }
40 return null;
41 }
42 }