Commit | Line | Data |
---|---|---|
73005152 | 1 | /********************************************************************** |
11252342 | 2 | * Copyright (c) 2005, 2013 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 |
13 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; |
14 | ||
73005152 BH |
15 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
16 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget; | |
17 | ||
18 | /** | |
df0b8ff4 | 19 | * Action class implementation to move right in the sequence diagram view within a page. |
c8422608 | 20 | * |
df0b8ff4 | 21 | * @version 1.0 |
73005152 | 22 | * @author sveyrier |
c8422608 | 23 | * |
73005152 BH |
24 | */ |
25 | ||
cab6c8ff | 26 | public class MoveSDRight extends BaseSDAction { |
73005152 BH |
27 | |
28 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 29 | // Constants |
73005152 | 30 | // ------------------------------------------------------------------------ |
df0b8ff4 BH |
31 | /** |
32 | * The action ID. | |
33 | */ | |
34 | public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDRight"; //$NON-NLS-1$ | |
73005152 | 35 | |
73005152 BH |
36 | // ------------------------------------------------------------------------ |
37 | // Constructors | |
38 | // ------------------------------------------------------------------------ | |
df0b8ff4 BH |
39 | /** |
40 | * Default constructor | |
41 | */ | |
73005152 BH |
42 | public MoveSDRight() { |
43 | this(null); | |
44 | } | |
df0b8ff4 BH |
45 | |
46 | /** | |
47 | * Constructor | |
c8422608 | 48 | * |
df0b8ff4 BH |
49 | * @param view a sequence diagram view reference |
50 | */ | |
73005152 | 51 | public MoveSDRight(SDView view) { |
cab6c8ff | 52 | super(view); |
73005152 BH |
53 | setId(ID); |
54 | setActionDefinitionId(ID); | |
73005152 BH |
55 | } |
56 | ||
57 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 58 | // Methods |
73005152 | 59 | // ------------------------------------------------------------------------ |
11252342 | 60 | |
73005152 BH |
61 | @Override |
62 | public void run() { | |
c8422608 | 63 | |
cab6c8ff | 64 | if (getView() == null) { |
73005152 BH |
65 | return; |
66 | } | |
c8422608 | 67 | |
cab6c8ff | 68 | SDWidget viewer = getView().getSDWidget(); |
df0b8ff4 | 69 | if (viewer != null) { |
73005152 | 70 | viewer.scrollBy(+viewer.getVisibleWidth(), 0); |
df0b8ff4 | 71 | } |
73005152 | 72 | } |
73005152 | 73 | } |