]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2000, 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 | * | |
8 | * Contributors: | |
9 | * IBM Corporation - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.jdt.internal.ui.viewsupport; | |
12 | ||
13 | import org.eclipse.jface.action.Action; | |
14 | ||
15 | import org.eclipse.ui.PlatformUI; | |
16 | ||
17 | import org.eclipse.jdt.ui.actions.MemberFilterActionGroup; | |
18 | ||
19 | /** | |
20 | * Action used to enable / disable method filter properties | |
21 | */ | |
22 | public class MemberFilterAction extends Action { | |
23 | ||
24 | private int fFilterProperty; | |
25 | private MemberFilterActionGroup fFilterActionGroup; | |
26 | ||
27 | public MemberFilterAction(MemberFilterActionGroup actionGroup, String title, int property, String contextHelpId, boolean initValue) { | |
28 | super(title); | |
29 | fFilterActionGroup= actionGroup; | |
30 | fFilterProperty= property; | |
31 | ||
32 | PlatformUI.getWorkbench().getHelpSystem().setHelp(this, contextHelpId); | |
33 | ||
34 | setChecked(initValue); | |
35 | } | |
36 | ||
37 | /** | |
38 | * Returns this action's filter property. | |
39 | * @return returns the property | |
40 | */ | |
41 | public int getFilterProperty() { | |
42 | return fFilterProperty; | |
43 | } | |
44 | ||
45 | /* | |
46 | * @see Action#actionPerformed | |
47 | */ | |
48 | @Override | |
49 | public void run() { | |
50 | fFilterActionGroup.setMemberFilter(fFilterProperty, isChecked()); | |
51 | } | |
52 | ||
53 | } |