| 1 | package de.uka.ipd.sdq.sensorframework.visualisation.menu; |
| 2 | |
| 3 | import org.eclipse.jface.action.Action; |
| 4 | import org.eclipse.ui.IWorkbenchPage; |
| 5 | import org.eclipse.ui.PartInitException; |
| 6 | |
| 7 | import de.uka.ipd.sdq.sensorframework.visualisation.VisualisationPlugin; |
| 8 | import de.uka.ipd.sdq.sensorframework.visualisation.editor.ConfigEditorInput; |
| 9 | |
| 10 | /** @author roman */ |
| 11 | public class DoubleClickAction extends Action { |
| 12 | |
| 13 | private ConfigEditorInput editorInput; |
| 14 | private String editorID; |
| 15 | |
| 16 | public DoubleClickAction(ConfigEditorInput editorInput, String editorID) { |
| 17 | this.editorInput = editorInput; |
| 18 | this.editorID = editorID; |
| 19 | } |
| 20 | |
| 21 | /* (non-Javadoc) |
| 22 | * @see org.eclipse.jface.action.Action#run() |
| 23 | */ |
| 24 | @Override |
| 25 | public void run() { |
| 26 | IWorkbenchPage page = VisualisationPlugin.getDefault().getWorkbench() |
| 27 | .getActiveWorkbenchWindow().getActivePage(); |
| 28 | |
| 29 | try { |
| 30 | page.openEditor(editorInput, editorID); |
| 31 | } catch (PartInitException e) { |
| 32 | // TODO Auto-generated catch block |
| 33 | e.printStackTrace(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | } |