tmf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / views / uml2sd / handlers / FirstPage.java
1 /**********************************************************************
2 * Copyright (c) 2011, 2014 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.tracecompass.tmf.ui.views.uml2sd.handlers;
13
14 import org.eclipse.tracecompass.internal.tmf.ui.Activator;
15 import org.eclipse.tracecompass.internal.tmf.ui.ITmfImageConstants;
16 import org.eclipse.tracecompass.tmf.ui.views.uml2sd.SDView;
17 import org.eclipse.tracecompass.tmf.ui.views.uml2sd.util.Messages;
18
19 /**
20 * Action class implementation to move the focus to the first page of the whole sequence diagram.
21 *
22 * @version 1.0
23 * @author Bernd Hufmann
24 */
25 public class FirstPage extends BaseSDAction {
26
27 // ------------------------------------------------------------------------
28 // Constants
29 // ------------------------------------------------------------------------
30
31 /**
32 * The action ID.
33 */
34 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.firstpage"; //$NON-NLS-1$
35
36 // ------------------------------------------------------------------------
37 // Constructors
38 // ------------------------------------------------------------------------
39
40 /**
41 * Default constructor
42 *
43 * @param view the view reference
44 */
45 public FirstPage(SDView view) {
46 super(view);
47 setText(Messages.SequenceDiagram_FirstPage);
48 setToolTipText(Messages.SequenceDiagram_GoToFirstPage);
49 setId(ID);
50 setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FIRST_PAGE));
51 }
52
53 // ------------------------------------------------------------------------
54 // Methods
55 // ------------------------------------------------------------------------
56
57 @Override
58 public void run() {
59 if ((getView() == null) || (getView().getSDWidget()) == null) {
60 return;
61 }
62 if (getView().getSDPagingProvider() != null) {
63 getView().getSDPagingProvider().firstPage();
64 }
65 getView().updateCoolBar();
66 getView().getSDWidget().redraw();
67 }
68 }
This page took 0.035208 seconds and 5 git commands to generate.