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