1 | /* |
2 | * Copyright 2007, SDQ, IPD, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.usage.part; |
5 | |
6 | import org.eclipse.core.commands.AbstractHandler; |
7 | import org.eclipse.core.commands.ExecutionEvent; |
8 | import org.eclipse.core.commands.ExecutionException; |
9 | import org.eclipse.emf.transaction.TransactionalEditingDomain; |
10 | import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; |
11 | import org.eclipse.swt.widgets.Shell; |
12 | import org.eclipse.ui.IEditorPart; |
13 | import org.eclipse.ui.handlers.HandlerUtil; |
14 | |
15 | /** |
16 | * @generated |
17 | */ |
18 | public class LoadResourceAction extends AbstractHandler { |
19 | /** |
20 | * @generated |
21 | */ |
22 | public Object execute(ExecutionEvent event) throws ExecutionException { |
23 | IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event); |
24 | Shell shell = diagramEditor.getEditorSite().getShell(); |
25 | assert diagramEditor instanceof DiagramEditor; |
26 | TransactionalEditingDomain editingDomain = ((DiagramEditor) diagramEditor) |
27 | .getEditingDomain(); |
28 | org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog( |
29 | shell, editingDomain); |
30 | loadResourceDialog.open(); |
31 | return null; |
32 | } |
33 | |
34 | } |