Commit | Line | Data |
---|---|---|
73005152 | 1 | /********************************************************************** |
df0b8ff4 BH |
2 | * Copyright (c) 2005, 2008 IBM Corporation and others. |
3 | * Copyright (c) 2011, 2012 Ericsson. | |
4 | * | |
73005152 BH |
5 | * All rights reserved. This program and the accompanying materials |
6 | * are made available under the terms of the Eclipse Public License v1.0 | |
7 | * which accompanies this distribution, and is available at | |
8 | * http://www.eclipse.org/legal/epl-v10.html | |
73005152 BH |
9 | * |
10 | * Contributors: | |
11 | * IBM - Initial API and implementation | |
12 | * Bernd Hufmann - Updated for TMF | |
13 | **********************************************************************/ | |
14 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; | |
15 | ||
16 | import org.eclipse.jface.action.Action; | |
d34665f9 FC |
17 | import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants; |
18 | import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin; | |
73005152 BH |
19 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
20 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages; | |
21 | ||
22 | /** | |
df0b8ff4 BH |
23 | * Action class implementation to move the focus to the next page of the whole sequence diagram. |
24 | * | |
25 | * @version 1.0 | |
73005152 BH |
26 | * @author sveyrier |
27 | * | |
28 | */ | |
29 | public class NextPage extends Action { | |
30 | ||
31 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 32 | // Constants |
73005152 | 33 | // ------------------------------------------------------------------------ |
df0b8ff4 BH |
34 | /** |
35 | * The action ID. | |
36 | */ | |
73005152 BH |
37 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.nextpage"; //$NON-NLS-1$ |
38 | ||
df0b8ff4 BH |
39 | // ------------------------------------------------------------------------ |
40 | // Attributes | |
41 | // ------------------------------------------------------------------------ | |
42 | /** | |
43 | * The sequence diagram view reference. | |
44 | */ | |
73005152 BH |
45 | protected SDView fView = null; |
46 | ||
47 | // ------------------------------------------------------------------------ | |
48 | // Constructors | |
49 | // ------------------------------------------------------------------------ | |
df0b8ff4 BH |
50 | /** |
51 | * Default constructor | |
52 | * | |
53 | * @param theView the view reference | |
54 | */ | |
73005152 BH |
55 | public NextPage(SDView theView) { |
56 | super(); | |
57 | fView = theView; | |
58 | setText(SDMessages._36); | |
59 | setToolTipText(SDMessages._38); | |
60 | setId(ID); | |
61 | setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_PAGE)); | |
62 | } | |
63 | ||
64 | // ------------------------------------------------------------------------ | |
65 | // Operations | |
66 | // ------------------------------------------------------------------------ | |
67 | /* | |
68 | * (non-Javadoc) | |
69 | * @see org.eclipse.jface.action.Action#run() | |
70 | */ | |
71 | @Override | |
72 | public void run() { | |
73 | if ((fView == null) || (fView.getSDWidget()) == null) { | |
74 | return; | |
75 | } | |
76 | if (fView.getSDPagingProvider() != null) { | |
77 | fView.getSDPagingProvider().nextPage(); | |
78 | } | |
79 | fView.updateCoolBar(); | |
80 | fView.getSDWidget().redraw(); | |
81 | } | |
82 | } |