tmf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / FirstPage.java
CommitLineData
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 **********************************************************************/
12package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
13
8fd82db5 14import org.eclipse.linuxtools.internal.tmf.ui.Activator;
cab6c8ff 15import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
73005152 16import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
92330441 17import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
73005152
BH
18
19/**
df0b8ff4 20 * Action class implementation to move the focus to the first page of the whole sequence diagram.
11252342 21 *
df0b8ff4
BH
22 * @version 1.0
23 * @author Bernd Hufmann
73005152 24 */
cab6c8ff 25public class FirstPage 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.firstpage"; //$NON-NLS-1$
df0b8ff4 35
73005152
BH
36 // ------------------------------------------------------------------------
37 // Constructors
38 // ------------------------------------------------------------------------
11252342 39
df0b8ff4 40 /**
11252342
AM
41 * Default constructor
42 *
eb63f5ff 43 * @param view the view reference
df0b8ff4 44 */
eb63f5ff 45 public FirstPage(SDView view) {
cab6c8ff 46 super(view);
92330441
AM
47 setText(Messages.SequenceDiagram_FirstPage);
48 setToolTipText(Messages.SequenceDiagram_GoToFirstPage);
73005152 49 setId(ID);
8fd82db5 50 setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FIRST_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().firstPage();
73005152 64 }
cab6c8ff
BH
65 getView().updateCoolBar();
66 getView().getSDWidget().redraw();
73005152
BH
67 }
68}
This page took 0.062091 seconds and 5 git commands to generate.