Contribution for Bug352466: [TMF] Implement UML2 Sequence Diagram
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / handlers / LastPage.java
CommitLineData
73005152
BH
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 **********************************************************************/
12package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
13
14import org.eclipse.jface.action.Action;
15import org.eclipse.linuxtools.tmf.ui.ITmfImageConstants;
16import org.eclipse.linuxtools.tmf.ui.TmfUiPlugin;
17import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
18import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
19
20/**
21 * Moves the focus on the last page in the sequence diagram view.
22 */
23public class LastPage extends Action {
24
25 // ------------------------------------------------------------------------
26 // Attributes
27 // ------------------------------------------------------------------------
28 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.lastpage"; //$NON-NLS-1$
29
30 protected SDView fView = null;
31
32 // ------------------------------------------------------------------------
33 // Constructors
34 // ------------------------------------------------------------------------
35 public LastPage(SDView theView) {
36 super();
37 fView = theView;
38 setText(SDMessages._141);
39 setToolTipText(SDMessages._142);
40 setId(ID);
41 setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_LAST_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().lastPage();
58 }
59 fView.updateCoolBar();
60 fView.getSDWidget().redraw();
61 }
62}
This page took 0.030335 seconds and 5 git commands to generate.