58a6216e69cf250f95d209bb530b7b7a9bd2dc54
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / NextPage.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.Activator;
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 next page of the whole sequence diagram.
24 *
25 * @version 1.0
26 * @author sveyrier
27 *
28 */
29 public class NextPage extends Action {
30
31 // ------------------------------------------------------------------------
32 // Constants
33 // ------------------------------------------------------------------------
34 /**
35 * The action ID.
36 */
37 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.nextpage"; //$NON-NLS-1$
38
39 // ------------------------------------------------------------------------
40 // Attributes
41 // ------------------------------------------------------------------------
42 /**
43 * The sequence diagram view reference.
44 */
45 protected SDView fView = null;
46
47 // ------------------------------------------------------------------------
48 // Constructors
49 // ------------------------------------------------------------------------
50 /**
51 * Default constructor
52 *
53 * @param view the view reference
54 */
55 public NextPage(SDView view) {
56 super();
57 fView = view;
58 setText(SDMessages._36);
59 setToolTipText(SDMessages._38);
60 setId(ID);
61 setImageDescriptor(Activator.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 }
This page took 0.032203 seconds and 5 git commands to generate.