KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > properties > FilterAction


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
12 package org.eclipse.ui.views.properties;
13
14 import org.eclipse.ui.PlatformUI;
15
16 /**
17  * This action hides or shows expert properties in the <code>PropertySheetViewer</code>.
18  */

19 /*package*/class FilterAction extends PropertySheetAction {
20     /**
21      * Create the Filter action. This action is used to show
22      * or hide expert properties.
23      *
24      * @param viewer the viewer
25      * @param name the name
26      */

27     public FilterAction(PropertySheetViewer viewer, String JavaDoc name) {
28         super(viewer, name);
29         PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
30                 IPropertiesHelpContextIds.FILTER_ACTION);
31     }
32
33     /**
34      * Toggle the display of expert properties.
35      */

36
37     public void run() {
38         PropertySheetViewer ps = getPropertySheet();
39         ps.deactivateCellEditor();
40         if (isChecked()) {
41             ps.showExpert();
42         } else {
43             ps.hideExpert();
44         }
45     }
46 }
47
Popular Tags