Revision 381bdda4
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/OpenBulkEditorHandler.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
11 | 11 |
import org.eclipse.core.commands.AbstractHandler; |
12 | 12 |
import org.eclipse.core.commands.ExecutionEvent; |
13 | 13 |
import org.eclipse.core.commands.ExecutionException; |
14 |
import org.eclipse.ui.PartInitException; |
|
15 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
16 | 14 |
|
17 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
|
18 | 15 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; |
19 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
|
20 | 16 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType; |
21 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
22 | 17 |
|
23 | 18 |
/** |
24 | 19 |
* <p>OpenBulkEditorHandler class.</p> |
... | ... | |
28 | 23 |
* @version 1.0 |
29 | 24 |
*/ |
30 | 25 |
public class OpenBulkEditorHandler extends AbstractHandler { |
31 |
private static final Logger logger = Logger.getLogger(OpenBulkEditorHandler.class);
|
|
32 |
|
|
26 |
private static final Logger logger = Logger.getLogger(OpenBulkEditorHandler.class); |
|
27 |
|
|
33 | 28 |
/* (non-Javadoc) |
34 | 29 |
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
35 | 30 |
*/ |
36 | 31 |
/** {@inheritDoc} */ |
37 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
32 |
@Override |
|
33 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
38 | 34 |
String inputTypeId = event.getParameter(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID); |
39 | 35 |
BulkEditorInputType inputType = BulkEditorInputType.getById(inputTypeId); |
40 |
try { |
|
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); |
|
46 |
} |
|
36 |
// try {
|
|
37 |
// HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().
|
|
38 |
// openEditor(AbstractBulkEditorInput.NewInstance(inputType), BulkEditor.ID);
|
|
39 |
// } catch (PartInitException e) {
|
|
40 |
// new RuntimeException(e);
|
|
41 |
// logger.error("Error opening bulk editor", e);
|
|
42 |
// }
|
|
47 | 43 |
return null; |
48 | 44 |
} |
49 | 45 |
} |
Also available in: Unified diff
ref #6913 Remove IEditorInput dependency from bulk editor input