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: OpenSDFiltersDialog.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; | |
d34665f9 FC |
16 | import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants; |
17 | import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin; | |
73005152 BH |
18 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
19 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDFilterProvider; | |
20 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.widgets.FilterListDialog; | |
21 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages; | |
22 | ||
23 | /** | |
24 | * Action delegate for 'Filter' on a message | |
25 | */ | |
26 | public class OpenSDFiltersDialog extends Action { | |
27 | ||
28 | // ------------------------------------------------------------------------ | |
29 | // Attributes | |
30 | // ------------------------------------------------------------------------ | |
31 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFilters"; //$NON-NLS-1$ | |
32 | ||
33 | protected SDView fView; | |
34 | protected ISDFilterProvider fProvider; | |
35 | ||
36 | // ------------------------------------------------------------------------ | |
37 | // Constructors | |
38 | // ------------------------------------------------------------------------ | |
39 | /** | |
40 | * @param view_ | |
41 | */ | |
42 | public OpenSDFiltersDialog(SDView view_, ISDFilterProvider provider_) { | |
43 | super(SDMessages._43); | |
44 | setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS)); | |
45 | setId(ID); | |
46 | setToolTipText(SDMessages._43); | |
47 | fView = view_; | |
48 | fProvider = provider_; | |
49 | } | |
50 | ||
51 | // ------------------------------------------------------------------------ | |
52 | // Operations | |
53 | // ------------------------------------------------------------------------ | |
54 | /* | |
55 | * (non-Javadoc) | |
56 | * @see org.eclipse.jface.action.Action#run() | |
57 | */ | |
58 | @Override | |
59 | public void run() { | |
60 | if (fView == null) { | |
61 | return; | |
62 | } | |
63 | FilterListDialog dialog = new FilterListDialog(fView, fProvider); | |
64 | dialog.open(); | |
65 | } | |
66 | } |