Commit | Line | Data |
---|---|---|
cab6c8ff BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2013 Ericsson | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Bernd Hufmann - Initial API and implementation | |
10 | **********************************************************************/ | |
2bdf0193 | 11 | package org.eclipse.tracecompass.tmf.ui.views.uml2sd.handlers; |
cab6c8ff BH |
12 | |
13 | import org.eclipse.jface.action.Action; | |
2bdf0193 | 14 | import org.eclipse.tracecompass.tmf.ui.views.uml2sd.SDView; |
cab6c8ff BH |
15 | |
16 | /** | |
17 | * Base class for sequence diagram actions. | |
18 | * | |
19 | * @author Bernd Hufmann | |
20 | * @since 2.0 | |
21 | */ | |
22 | public class BaseSDAction extends Action { | |
23 | ||
24 | // ------------------------------------------------------------------------ | |
25 | // Attributes | |
26 | // ------------------------------------------------------------------------ | |
27 | /** | |
28 | * The sequence diagram view reference. | |
29 | */ | |
30 | private SDView fView = null; | |
31 | ||
32 | // ------------------------------------------------------------------------ | |
33 | // Constructors | |
34 | // ------------------------------------------------------------------------ | |
35 | /** | |
36 | * Default constructor | |
37 | */ | |
38 | public BaseSDAction() { | |
39 | this(null); | |
40 | } | |
41 | ||
42 | /** | |
43 | * Constructor | |
44 | * | |
45 | * @param view | |
46 | * a sequence diagram view reference | |
47 | */ | |
48 | public BaseSDAction(SDView view) { | |
49 | super(); | |
50 | fView = view; | |
51 | } | |
52 | ||
53 | /** | |
54 | * Constructor | |
55 | * @param view | |
56 | * a sequence diagram view reference | |
57 | * @param text | |
58 | * The action text | |
59 | * @param style | |
60 | * The style | |
61 | */ | |
62 | protected BaseSDAction(SDView view, String text, int style) { | |
63 | super(text, style); | |
64 | fView = view; | |
65 | } | |
66 | ||
67 | // ------------------------------------------------------------------------ | |
68 | // Operations | |
69 | // ------------------------------------------------------------------------ | |
70 | ||
71 | /** | |
72 | * Sets the active SD view. | |
73 | * | |
74 | * @param view The SD view. | |
75 | */ | |
76 | public void setView(SDView view) { | |
77 | fView = view; | |
78 | } | |
79 | ||
80 | /** | |
81 | * Gets the active SD view. | |
82 | * | |
83 | * @return view The SD view. | |
84 | * @since 2.0 | |
85 | */ | |
86 | public SDView getView() { | |
87 | return fView; | |
88 | } | |
89 | } |