tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / MoveSDLeft.java
CommitLineData
73005152 1/**********************************************************************
c8422608 2 * Copyright (c) 2005, 2012 IBM Corporation, Ericsson
73005152
BH
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
c8422608
AM
7 *
8 * Contributors:
9 * IBM - Initial API and implementation
10 * Bernd Hufmann - Updated for TMF
73005152 11 **********************************************************************/
c8422608 12
73005152
BH
13package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
14
15import org.eclipse.jface.action.Action;
16import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
17import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
18
19/**
df0b8ff4 20 * Action class implementation to move left in the sequence diagram view within a page.
c8422608 21 *
df0b8ff4 22 * @version 1.0
73005152 23 * @author sveyrier
c8422608 24 *
73005152
BH
25 */
26public class MoveSDLeft extends Action {
27
28 // ------------------------------------------------------------------------
df0b8ff4 29 // Constants
73005152 30 // ------------------------------------------------------------------------
df0b8ff4
BH
31 /**
32 * The action ID.
33 */
73005152 34 public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDLeft"; //$NON-NLS-1$
c8422608 35
df0b8ff4
BH
36 // ------------------------------------------------------------------------
37 // Attributes
38 // ------------------------------------------------------------------------
39 /**
40 * The sequence diagram view reference.
41 */
73005152
BH
42 protected SDView fView = null;
43
44 // ------------------------------------------------------------------------
45 // Constructors
46 // ------------------------------------------------------------------------
df0b8ff4
BH
47 /**
48 * Default constructor
49 */
73005152
BH
50 public MoveSDLeft(){
51 this(null);
52 }
53
df0b8ff4
BH
54 /**
55 * Constructor
c8422608 56 *
df0b8ff4
BH
57 * @param view a sequence diagram view reference
58 */
73005152
BH
59 public MoveSDLeft(SDView view) {
60 super();
61 setId(ID);
62 setActionDefinitionId(ID);
63 fView = view;
64 }
65
66 // ------------------------------------------------------------------------
67 // Operations
68 // ------------------------------------------------------------------------
69 /*
70 * (non-Javadoc)
71 * @see org.eclipse.jface.action.Action#run()
c8422608 72 */
df0b8ff4 73 @Override
73005152 74 public void run() {
c8422608 75
73005152
BH
76 if (fView == null) {
77 return;
78 }
c8422608 79
73005152
BH
80 SDWidget viewer = fView.getSDWidget();
81 if (viewer != null) {
82 viewer.scrollBy(-viewer.getVisibleWidth(), 0);
83 }
84 }
c8422608 85
73005152
BH
86 /**
87 * Sets the active SD view.
c8422608 88 *
73005152
BH
89 * @param view The SD view.
90 */
91 public void setView(SDView view) {
92 fView = view;
93 }
94}
This page took 0.036297 seconds and 5 git commands to generate.