30080afd0a0074c8c36fd3c29e421344a01114a9
[phpeclipse.git] /
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.viewsupport;
12
13 import net.sourceforge.phpdt.ui.actions.MemberFilterActionGroup;
14
15 import org.eclipse.jface.action.Action;
16 import org.eclipse.ui.help.WorkbenchHelp;
17
18 /**
19  * Action used to enable / disable method filter properties
20  */
21 public class MemberFilterAction extends Action {
22
23         private int fFilterProperty;
24         private MemberFilterActionGroup fFilterActionGroup;
25         
26         public MemberFilterAction(MemberFilterActionGroup actionGroup, String title, int property, String contextHelpId, boolean initValue) {
27                 super(title);
28                 fFilterActionGroup= actionGroup;
29                 fFilterProperty= property;
30                 
31                 WorkbenchHelp.setHelp(this, contextHelpId);
32
33                 setChecked(initValue);
34         }
35         
36         /**
37          * Returns this action's filter property.
38          */
39         public int getFilterProperty() {
40                 return fFilterProperty;
41         }
42         
43         /*
44          * @see Action#actionPerformed
45          */
46         public void run() {     
47                 fFilterActionGroup.setMemberFilter(fFilterProperty, isChecked());
48         }
49                 
50 }