KickJava   Java API By Example, From Geeks To Geeks.

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


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 resets the <code>PropertySheetViewer</code> values back
18  * to the default values.
19  *
20  * [Issue: should listen for selection changes in the viewer and set enablement]
21  */

22 /*package*/class DefaultsAction extends PropertySheetAction {
23     /**
24      * Create the Defaults action. This action is used to set
25      * the properties back to their default values.
26      *
27      * @param viewer the viewer
28      * @param name the name
29      */

30     public DefaultsAction(PropertySheetViewer viewer, String JavaDoc name) {
31         super(viewer, name);
32         PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
33                 IPropertiesHelpContextIds.DEFAULTS_ACTION);
34     }
35
36     /**
37      * Reset the properties to their default values.
38      */

39     public void run() {
40         getPropertySheet().deactivateCellEditor();
41         getPropertySheet().resetProperties();
42     }
43 }
44
Popular Tags