Commit | Line | Data |
---|---|---|
73005152 | 1 | /********************************************************************** |
11252342 AM |
2 | * Copyright (c) 2011, 2013 Ericsson |
3 | * | |
73005152 BH |
4 | * All rights reserved. This program and the accompanying materials are |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
11252342 AM |
8 | * |
9 | * Contributors: | |
73005152 BH |
10 | * Bernd Hufmann - Initial API and implementation |
11 | **********************************************************************/ | |
12 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; | |
13 | ||
8fd82db5 | 14 | import org.eclipse.linuxtools.internal.tmf.ui.Activator; |
cab6c8ff | 15 | import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants; |
73005152 | 16 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
92330441 | 17 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages; |
73005152 BH |
18 | |
19 | /** | |
df0b8ff4 | 20 | * Action class implementation to move the focus to the last page of the whole sequence diagram. |
11252342 | 21 | * |
df0b8ff4 BH |
22 | * @version 1.0 |
23 | * @author Bernd Hufmann | |
73005152 | 24 | */ |
cab6c8ff | 25 | public class LastPage extends BaseSDAction { |
73005152 BH |
26 | |
27 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 28 | // Constants |
73005152 | 29 | // ------------------------------------------------------------------------ |
11252342 | 30 | |
df0b8ff4 BH |
31 | /** |
32 | * The action ID. | |
33 | */ | |
73005152 | 34 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.lastpage"; //$NON-NLS-1$ |
df0b8ff4 | 35 | |
73005152 BH |
36 | // ------------------------------------------------------------------------ |
37 | // Constructors | |
38 | // ------------------------------------------------------------------------ | |
11252342 | 39 | |
df0b8ff4 BH |
40 | /** |
41 | * Standard constructor | |
11252342 | 42 | * |
eb63f5ff | 43 | * @param view the view reference |
df0b8ff4 | 44 | */ |
eb63f5ff | 45 | public LastPage(SDView view) { |
cab6c8ff | 46 | super(view); |
92330441 AM |
47 | setText(Messages.SequenceDiagram_LastPage); |
48 | setToolTipText(Messages.SequenceDiagram_GoToLastPage); | |
73005152 | 49 | setId(ID); |
8fd82db5 | 50 | setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_LAST_PAGE)); |
73005152 BH |
51 | } |
52 | ||
53 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 54 | // Methods |
73005152 | 55 | // ------------------------------------------------------------------------ |
11252342 | 56 | |
73005152 BH |
57 | @Override |
58 | public void run() { | |
cab6c8ff | 59 | if ((getView() == null) || (getView().getSDWidget()) == null) { |
73005152 BH |
60 | return; |
61 | } | |
cab6c8ff BH |
62 | if (getView().getSDPagingProvider() != null) { |
63 | getView().getSDPagingProvider().lastPage(); | |
73005152 | 64 | } |
cab6c8ff BH |
65 | getView().updateCoolBar(); |
66 | getView().getSDWidget().redraw(); | |
73005152 BH |
67 | } |
68 | } |