Contribution for Bug352466: [TMF] Implement UML2 Sequence Diagram
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / MoveSDDown.java
1 /**********************************************************************
2 * Copyright (c) 2005, 2006, 2011 IBM Corporation and others.
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 * $Id: MoveSDDown.java,v 1.2 2006/09/20 20:56:26 ewchan Exp $
8 *
9 * Contributors:
10 * IBM - Initial API and implementation
11 * Bernd Hufmann - Updated for TMF
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 * @author sveyrier
21 *
22 */
23 public class MoveSDDown extends Action {
24
25 // ------------------------------------------------------------------------
26 // Attributes
27 // ------------------------------------------------------------------------
28 public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDDown"; //$NON-NLS-1$
29
30 protected SDView fView = null;
31
32 // ------------------------------------------------------------------------
33 // Constructors
34 // ------------------------------------------------------------------------
35 public MoveSDDown() {
36 this(null);
37 }
38
39 public MoveSDDown(SDView view) {
40 super();
41 setId(ID);
42 setActionDefinitionId(ID);
43 fView = view;
44 }
45
46 // ------------------------------------------------------------------------
47 // Operations
48 // ------------------------------------------------------------------------
49 /*
50 * (non-Javadoc)
51 * @see org.eclipse.jface.action.Action#run()
52 */
53 @Override
54 public void run() {
55 if (fView == null) {
56 return;
57 }
58 SDWidget viewer = fView.getSDWidget();
59 if (viewer != null) {
60 viewer.scrollBy(0, +viewer.getVisibleHeight());
61 }
62 }
63
64 /**
65 * Sets the active SD view.
66 * @param view The SD view.
67 */
68 public void setView(SDView view) {
69 fView = view;
70 }
71 }
This page took 0.031151 seconds and 5 git commands to generate.