4570a4e7f091077eb465d9cc3d0e817ab3093be8
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / MoveSDRight.java
1 /**********************************************************************
2 * Copyright (c) 2005, 2013 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.linuxtools.tmf.ui.views.uml2sd.handlers;
14
15 import org.eclipse.jface.action.Action;
16 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
17 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
18
19 /**
20 * Action class implementation to move right in the sequence diagram view within a page.
21 *
22 * @version 1.0
23 * @author sveyrier
24 *
25 */
26
27 public class MoveSDRight extends Action {
28
29 // ------------------------------------------------------------------------
30 // Constants
31 // ------------------------------------------------------------------------
32 /**
33 * The action ID.
34 */
35 public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDRight"; //$NON-NLS-1$
36
37 // ------------------------------------------------------------------------
38 // Attributes
39 // ------------------------------------------------------------------------
40 /**
41 * The sequence diagram view reference.
42 */
43 protected SDView fView = null;
44
45 // ------------------------------------------------------------------------
46 // Constructors
47 // ------------------------------------------------------------------------
48 /**
49 * Default constructor
50 */
51 public MoveSDRight() {
52 this(null);
53 }
54
55 /**
56 * Constructor
57 *
58 * @param view a sequence diagram view reference
59 */
60 public MoveSDRight(SDView view) {
61 super();
62 setId(ID);
63 setActionDefinitionId(ID);
64 fView = view;
65 }
66
67 // ------------------------------------------------------------------------
68 // Methods
69 // ------------------------------------------------------------------------
70
71 @Override
72 public void run() {
73
74 if (fView == null) {
75 return;
76 }
77
78 SDWidget viewer = fView.getSDWidget();
79 if (viewer != null) {
80 viewer.scrollBy(+viewer.getVisibleWidth(), 0);
81 }
82 }
83
84 /**
85 * Sets the active SD view.
86 *
87 * @param view The SD view.
88 */
89 public void setView(SDView view) {
90 fView = view;
91 }
92 }
This page took 0.05042 seconds and 4 git commands to generate.