634678f89dc46966b1ff8542ce3573cc1a342b98
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / src / net / sourceforge / phpdt / internal / ui / viewsupport / MemberFilterAction.java
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.PlatformUI;
17
18 /**
19  * Action used to enable / disable method filter properties
20  */
21 public class MemberFilterAction extends Action {
22
23         private int fFilterProperty;
24
25         private MemberFilterActionGroup fFilterActionGroup;
26
27         public MemberFilterAction(MemberFilterActionGroup actionGroup,
28                         String title, int property, String contextHelpId, boolean initValue) {
29                 super(title);
30                 fFilterActionGroup = actionGroup;
31                 fFilterProperty = property;
32
33                 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, contextHelpId);
34
35                 setChecked(initValue);
36         }
37
38         /**
39          * Returns this action's filter property.
40          */
41         public int getFilterProperty() {
42                 return fFilterProperty;
43         }
44
45         /*
46          * @see Action#actionPerformed
47          */
48         public void run() {
49                 fFilterActionGroup.setMemberFilter(fFilterProperty, isChecked());
50         }
51
52 }