Commit | Line | Data |
---|---|---|
73005152 | 1 | /********************************************************************** |
df0b8ff4 BH |
2 | * Copyright (c) 2005, 2008 IBM Corporation and others. |
3 | * Copyright (c) 2011, 2012 Ericsson. | |
4 | * | |
73005152 BH |
5 | * All rights reserved. This program and the accompanying materials |
6 | * are made available under the terms of the Eclipse Public License v1.0 | |
7 | * which accompanies this distribution, and is available at | |
8 | * http://www.eclipse.org/legal/epl-v10.html | |
73005152 BH |
9 | * |
10 | * Contributors: | |
11 | * IBM - Initial API and implementation | |
12 | * Bernd Hufmann - Updated for TMF | |
13 | **********************************************************************/ | |
14 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; | |
15 | ||
16 | import org.eclipse.jface.action.Action; | |
d34665f9 FC |
17 | import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants; |
18 | import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin; | |
73005152 | 19 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
df0b8ff4 | 20 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.PagesDialog; |
73005152 | 21 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDAdvancedPagingProvider; |
73005152 BH |
22 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages; |
23 | ||
24 | /** | |
df0b8ff4 | 25 | * Action class implementation for paging. |
73005152 BH |
26 | */ |
27 | public class OpenSDPagesDialog extends Action { | |
28 | ||
29 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 30 | // Constants |
73005152 | 31 | // ------------------------------------------------------------------------ |
df0b8ff4 BH |
32 | /** |
33 | * The action ID. | |
34 | */ | |
73005152 | 35 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdPaging"; //$NON-NLS-1$ |
df0b8ff4 BH |
36 | |
37 | // ------------------------------------------------------------------------ | |
38 | // Attributes | |
39 | // ------------------------------------------------------------------------ | |
40 | /** | |
41 | * The sequence diagram view reference | |
42 | */ | |
73005152 | 43 | protected SDView fView; |
df0b8ff4 BH |
44 | /** |
45 | * The advanced paging provider reference. | |
46 | */ | |
73005152 BH |
47 | protected ISDAdvancedPagingProvider fProvider; |
48 | ||
49 | // ------------------------------------------------------------------------ | |
50 | // Constructors | |
51 | // ------------------------------------------------------------------------ | |
52 | /** | |
df0b8ff4 BH |
53 | * Constructor |
54 | * | |
eb63f5ff | 55 | * @param view The view reference |
73005152 | 56 | */ |
eb63f5ff | 57 | public OpenSDPagesDialog(SDView view, ISDAdvancedPagingProvider provider) { |
73005152 BH |
58 | super(SDMessages._44); |
59 | setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_GOTO_PAGE)); | |
60 | setId(ID); | |
eb63f5ff BH |
61 | fView = view; |
62 | fProvider = provider; | |
73005152 BH |
63 | } |
64 | ||
65 | // ------------------------------------------------------------------------ | |
66 | // Operations | |
67 | // ------------------------------------------------------------------------ | |
68 | /* | |
69 | * (non-Javadoc) | |
70 | * @see org.eclipse.jface.action.Action#run() | |
71 | */ | |
72 | @Override | |
73 | public void run() { | |
74 | if (fView == null) { | |
75 | return; | |
76 | } | |
77 | PagesDialog dialog = new PagesDialog(fView, fProvider); | |
78 | dialog.open(); | |
79 | } | |
80 | } |