Internalize some more TMF APIs
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / FirstPage.java
1 /**********************************************************************
2 * Copyright (c) 2011 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.linuxtools.tmf.ui.views.uml2sd.handlers;
13
14 import org.eclipse.jface.action.Action;
15 import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
16 import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
17 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
18 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
19
20 /**
21 * Moves the focus on the first page in the sequence diagram view.
22 */
23 public class FirstPage extends Action {
24
25 // ------------------------------------------------------------------------
26 // Attributes
27 // ------------------------------------------------------------------------
28 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.firstpage"; //$NON-NLS-1$
29
30 protected SDView fView = null;
31
32 // ------------------------------------------------------------------------
33 // Constructors
34 // ------------------------------------------------------------------------
35 public FirstPage(SDView theView) {
36 super();
37 fView = theView;
38 setText(SDMessages._139);
39 setToolTipText(SDMessages._140);
40 setId(ID);
41 setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FIRST_PAGE));
42 }
43
44 // ------------------------------------------------------------------------
45 // Operations
46 // ------------------------------------------------------------------------
47 /*
48 * (non-Javadoc)
49 * @see org.eclipse.jface.action.Action#run()
50 */
51 @Override
52 public void run() {
53 if ((fView == null) || (fView.getSDWidget()) == null) {
54 return;
55 }
56 if (fView.getSDPagingProvider() != null) {
57 fView.getSDPagingProvider().firstPage();
58 }
59 fView.updateCoolBar();
60 fView.getSDWidget().redraw();
61 }
62 }
This page took 0.030929 seconds and 5 git commands to generate.