1 | package de.uka.ipd.sdq.pcm.gmf.toolbar; |
2 | |
3 | import org.eclipse.jface.action.IAction; |
4 | import org.eclipse.jface.viewers.ISelection; |
5 | import org.eclipse.ui.IWorkbenchWindow; |
6 | import org.eclipse.ui.IWorkbenchWindowActionDelegate; |
7 | |
8 | /** |
9 | * Baseclass for action delegates that require the window |
10 | * passed to the init method. |
11 | * |
12 | * @author Philipp Meier |
13 | */ |
14 | abstract class BaseDiagramAction |
15 | implements IWorkbenchWindowActionDelegate { |
16 | |
17 | private IWorkbenchWindow myWindow = null; |
18 | |
19 | public void init(final IWorkbenchWindow window) { |
20 | assert (myWindow != null); |
21 | myWindow = window; |
22 | } |
23 | |
24 | /** |
25 | * @return the window which was active when the action was activated |
26 | */ |
27 | protected IWorkbenchWindow getWindow() { |
28 | return myWindow; |
29 | } |
30 | |
31 | public void selectionChanged(final IAction action, final ISelection selection) { |
32 | // do nothing |
33 | } |
34 | |
35 | public void dispose() { |
36 | // do nothing |
37 | } |
38 | } |