4381defda52344eadef64e4d6563ad592e74a3a4
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / views / uml2sd / handlers / PrevPage.java
1 /**********************************************************************
2 * Copyright (c) 2005, 2014 IBM Corporation, 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 * IBM - Initial API and implementation
10 * Bernd Hufmann - Updated for TMF
11 **********************************************************************/
12
13 package org.eclipse.tracecompass.tmf.ui.views.uml2sd.handlers;
14
15 import org.eclipse.tracecompass.internal.tmf.ui.Activator;
16 import org.eclipse.tracecompass.internal.tmf.ui.ITmfImageConstants;
17 import org.eclipse.tracecompass.tmf.ui.views.uml2sd.SDView;
18 import org.eclipse.tracecompass.tmf.ui.views.uml2sd.util.Messages;
19
20 /**
21 * Action class implementation to move the focus to the previous page of the whole sequence diagram.
22 *
23 * @version 1.0
24 * @author sveyrier
25 *
26 */
27 public class PrevPage extends BaseSDAction {
28
29 // ------------------------------------------------------------------------
30 // Constants
31 // ------------------------------------------------------------------------
32
33 /**
34 * The action ID.
35 */
36 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$
37
38 // ------------------------------------------------------------------------
39 // Constructors
40 // ------------------------------------------------------------------------
41
42 /**
43 * Default constructor
44 *
45 * @param view the view reference
46 */
47 public PrevPage(SDView view) {
48 super(view);
49 setText(Messages.SequenceDiagram_PreviousPage);
50 setToolTipText(Messages.SequenceDiagram_GoToPreviousPage);
51 setId(ID);
52 setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_PAGE));
53 }
54
55 // ------------------------------------------------------------------------
56 // Methods
57 // ------------------------------------------------------------------------
58
59 @Override
60 public void run() {
61 if ((getView() == null) || (getView().getSDWidget()) == null) {
62 return;
63 }
64 if (getView().getSDPagingProvider() != null) {
65 getView().getSDPagingProvider().prevPage();
66 }
67 getView().updateCoolBar();
68 getView().getSDWidget().redraw();
69 }
70 }
This page took 0.041273 seconds and 4 git commands to generate.