Commit | Line | Data |
---|---|---|
73005152 | 1 | /********************************************************************** |
c8422608 | 2 | * Copyright (c) 2005, 2012 IBM Corporation, Ericsson |
73005152 BH |
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 | |
a55887ca AM |
7 | * |
8 | * Contributors: | |
c8422608 AM |
9 | * IBM - Initial API and implementation |
10 | * Bernd Hufmann - Updated for TMF | |
73005152 | 11 | **********************************************************************/ |
c8422608 | 12 | |
73005152 BH |
13 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers; |
14 | ||
15 | import org.eclipse.jface.action.Action; | |
8fd82db5 | 16 | import org.eclipse.linuxtools.internal.tmf.ui.Activator; |
a55887ca | 17 | import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants; |
73005152 | 18 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView; |
df0b8ff4 | 19 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.FilterListDialog; |
73005152 | 20 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDFilterProvider; |
73005152 BH |
21 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages; |
22 | ||
23 | /** | |
df0b8ff4 | 24 | * Action class implementation for 'Filtering' of messages/lifelines. |
a55887ca | 25 | * |
df0b8ff4 BH |
26 | * @version 1.0 |
27 | * @author sveyrier | |
73005152 BH |
28 | */ |
29 | public class OpenSDFiltersDialog extends Action { | |
30 | ||
31 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 32 | // Constants |
73005152 | 33 | // ------------------------------------------------------------------------ |
df0b8ff4 BH |
34 | /** |
35 | * The action ID. | |
36 | */ | |
73005152 | 37 | public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFilters"; //$NON-NLS-1$ |
df0b8ff4 BH |
38 | |
39 | // ------------------------------------------------------------------------ | |
40 | // Attributes | |
41 | // ------------------------------------------------------------------------ | |
42 | /** | |
43 | * The sequence diagram view reference | |
44 | */ | |
73005152 | 45 | protected SDView fView; |
a55887ca | 46 | |
df0b8ff4 BH |
47 | /** |
48 | * The filter provider reference | |
49 | */ | |
73005152 BH |
50 | protected ISDFilterProvider fProvider; |
51 | ||
52 | // ------------------------------------------------------------------------ | |
53 | // Constructors | |
54 | // ------------------------------------------------------------------------ | |
55 | /** | |
a55887ca AM |
56 | * Constructor |
57 | * | |
58 | * @param view | |
59 | * The view reference | |
60 | * @param provider | |
61 | * The provider | |
73005152 | 62 | */ |
eb63f5ff | 63 | public OpenSDFiltersDialog(SDView view, ISDFilterProvider provider) { |
73005152 | 64 | super(SDMessages._43); |
8fd82db5 | 65 | setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS)); |
73005152 BH |
66 | setId(ID); |
67 | setToolTipText(SDMessages._43); | |
eb63f5ff BH |
68 | fView = view; |
69 | fProvider = provider; | |
73005152 BH |
70 | } |
71 | ||
72 | // ------------------------------------------------------------------------ | |
df0b8ff4 | 73 | // Methods |
73005152 BH |
74 | // ------------------------------------------------------------------------ |
75 | /* | |
76 | * (non-Javadoc) | |
77 | * @see org.eclipse.jface.action.Action#run() | |
78 | */ | |
79 | @Override | |
80 | public void run() { | |
81 | if (fView == null) { | |
82 | return; | |
83 | } | |
84 | FilterListDialog dialog = new FilterListDialog(fView, fProvider); | |
85 | dialog.open(); | |
86 | } | |
87 | } |