Fix static analysis warnings for UML2SD
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / PrevPage.java
1 /**********************************************************************
2 * Copyright (c) 2005, 2008 IBM Corporation and others.
3 * Copyright (c) 2011, 2012 Ericsson.
4 *
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
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;
17 import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
18 import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
19 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
20 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
21
22 /**
23 * Action class implementation to move the focus to the previous page of the whole sequence diagram.
24 *
25 * @version 1.0
26 * @author sveyrier
27 *
28 */
29 public class PrevPage extends Action {
30
31 // ------------------------------------------------------------------------
32 // Constants
33 // ------------------------------------------------------------------------
34
35 /**
36 * The action ID.
37 */
38 public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$
39
40 // ------------------------------------------------------------------------
41 // Attributes
42 // ------------------------------------------------------------------------
43
44 /**
45 * The sequence diagram view reference.
46 */
47 protected SDView fView = null;
48
49 // ------------------------------------------------------------------------
50 // Constructors
51 // ------------------------------------------------------------------------
52
53 /**
54 * Default constructor
55 *
56 * @param view the view reference
57 */
58 public PrevPage(SDView view) {
59 super();
60 fView = view;
61 setText(SDMessages._35);
62 setToolTipText(SDMessages._37);
63 setId(ID);
64 setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_PAGE));
65 }
66
67 // ------------------------------------------------------------------------
68 // Methods
69 // ------------------------------------------------------------------------
70 /*
71 * (non-Javadoc)
72 * @see org.eclipse.jface.action.Action#run()
73 */
74 @Override
75 public void run() {
76 if ((fView == null) || (fView.getSDWidget()) == null) {
77 return;
78 }
79 if (fView.getSDPagingProvider() != null) {
80 fView.getSDPagingProvider().prevPage();
81 }
82 fView.updateCoolBar();
83 fView.getSDWidget().redraw();
84 }
85 }
This page took 0.035153 seconds and 5 git commands to generate.