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