KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > viewsupport > MemberFilterAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.*;
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 JavaDoc title, int property, String JavaDoc 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      */

40     public int getFilterProperty() {
41         return fFilterProperty;
42     }
43     
44     /*
45      * @see Action#actionPerformed
46      */

47     public void run() {
48         fFilterActionGroup.setMemberFilter(fFilterProperty, isChecked());
49     }
50         
51 }
52
Popular Tags