Commit | Line | Data |
---|---|---|
73005152 | 1 | /********************************************************************** |
ed902a2b | 2 | * Copyright (c) 2005, 2014 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 | |
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.ui.views.uml2sd.handlers; |
73005152 | 14 | |
2bdf0193 AM |
15 | import org.eclipse.tracecompass.internal.tmf.ui.Activator; |
16 | import org.eclipse.tracecompass.internal.tmf.ui.ITmfImageConstants; | |
17 | import org.eclipse.tracecompass.tmf.ui.views.uml2sd.SDView; | |
18 | import org.eclipse.tracecompass.tmf.ui.views.uml2sd.util.Messages; | |
73005152 BH |
19 | |
20 | /** | |
df0b8ff4 | 21 | * Action class implementation to move the focus to the previous page of the whole sequence diagram. |
c8422608 | 22 | * |
df0b8ff4 | 23 | * @version 1.0 |
73005152 | 24 | * @author sveyrier |
c8422608 | 25 | * |
73005152 | 26 | */ |
cab6c8ff | 27 | public class PrevPage extends BaseSDAction { |
73005152 BH |
28 | |
29 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 30 | // Constants |
73005152 | 31 | // ------------------------------------------------------------------------ |
df0b8ff4 BH |
32 | |
33 | /** | |
34 | * The action ID. | |
35 | */ | |
f26e290b | 36 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$ |
c8422608 | 37 | |
73005152 BH |
38 | // ------------------------------------------------------------------------ |
39 | // Constructors | |
40 | // ------------------------------------------------------------------------ | |
df0b8ff4 BH |
41 | |
42 | /** | |
c8422608 AM |
43 | * Default constructor |
44 | * | |
eb63f5ff | 45 | * @param view the view reference |
df0b8ff4 | 46 | */ |
eb63f5ff | 47 | public PrevPage(SDView view) { |
cab6c8ff | 48 | super(view); |
92330441 AM |
49 | setText(Messages.SequenceDiagram_PreviousPage); |
50 | setToolTipText(Messages.SequenceDiagram_GoToPreviousPage); | |
c8422608 | 51 | setId(ID); |
8fd82db5 | 52 | setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_PAGE)); |
73005152 BH |
53 | } |
54 | ||
55 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 56 | // Methods |
73005152 | 57 | // ------------------------------------------------------------------------ |
11252342 | 58 | |
73005152 BH |
59 | @Override |
60 | public void run() { | |
cab6c8ff | 61 | if ((getView() == null) || (getView().getSDWidget()) == null) { |
73005152 BH |
62 | return; |
63 | } | |
cab6c8ff BH |
64 | if (getView().getSDPagingProvider() != null) { |
65 | getView().getSDPagingProvider().prevPage(); | |
73005152 | 66 | } |
cab6c8ff BH |
67 | getView().updateCoolBar(); |
68 | getView().getSDWidget().redraw(); | |
73005152 BH |
69 | } |
70 | } |