Commit | Line | Data |
---|---|---|
73005152 BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2005, 2008, 2011 IBM Corporation and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * $Id: PrevPage.java,v 1.3 2008/01/24 02:28:52 apnan Exp $ | |
8 | * | |
9 | * Contributors: | |
10 | * IBM - Initial API and implementation | |
11 | * Bernd Hufmann - Updated for TMF | |
12 | **********************************************************************/ | |
13 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; | |
14 | ||
15 | import org.eclipse.jface.action.Action; | |
16 | import org.eclipse.linuxtools.tmf.ui.ITmfImageConstants; | |
17 | import org.eclipse.linuxtools.tmf.ui.TmfUiPlugin; | |
18 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; | |
19 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages; | |
20 | ||
21 | /** | |
22 | * @author sveyrier | |
23 | * | |
24 | */ | |
25 | public class PrevPage extends Action { | |
26 | ||
27 | // ------------------------------------------------------------------------ | |
28 | // Attributes | |
29 | // ------------------------------------------------------------------------ | |
30 | public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$ | |
31 | ||
32 | protected SDView view = null; | |
33 | ||
34 | // ------------------------------------------------------------------------ | |
35 | // Constructors | |
36 | // ------------------------------------------------------------------------ | |
37 | public PrevPage(SDView theView) { | |
38 | super(); | |
39 | view = theView; | |
40 | setText(SDMessages._35); | |
41 | setToolTipText(SDMessages._37); | |
42 | setId(ID); | |
43 | setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_PAGE)); | |
44 | } | |
45 | ||
46 | // ------------------------------------------------------------------------ | |
47 | // Operations | |
48 | // ------------------------------------------------------------------------ | |
49 | /* | |
50 | * (non-Javadoc) | |
51 | * @see org.eclipse.jface.action.Action#run() | |
52 | */ | |
53 | @Override | |
54 | public void run() { | |
55 | if ((view == null) || (view.getSDWidget()) == null) { | |
56 | return; | |
57 | } | |
58 | if (view.getSDPagingProvider() != null) { | |
59 | view.getSDPagingProvider().prevPage(); | |
60 | } | |
61 | view.updateCoolBar(); | |
62 | view.getSDWidget().redraw(); | |
63 | } | |
64 | } |