KickJava   Java API By Example, From Geeks To Geeks.

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


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

18 /*package*/class CategoriesAction extends PropertySheetAction {
19     /**
20      * Creates the Categories action. This action is used to show
21      * or hide categories properties.
22      * @param viewer the viewer
23      * @param name the name
24      */

25     public CategoriesAction(PropertySheetViewer viewer, String JavaDoc name) {
26         super(viewer, name);
27         PlatformUI.getWorkbench().getHelpSystem()
28                 .setHelp(this, IPropertiesHelpContextIds.CATEGORIES_ACTION);
29     }
30
31     /**
32      * Toggles the display of categories for the properties.
33      */

34     public void run() {
35         PropertySheetViewer ps = getPropertySheet();
36         ps.deactivateCellEditor();
37         if (isChecked()) {
38             ps.showCategories();
39         } else {
40             ps.hideCategories();
41         }
42     }
43 }
44
Popular Tags