01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: * Sebastian Davids <sdavids@gmx.de> - Collapse all action (25826)
11: *******************************************************************************/package org.eclipse.ui.views.navigator;
12:
13: import org.eclipse.ui.PlatformUI;
14:
15: /**
16: * Collapse all project nodes.
17: */
18: public class CollapseAllAction extends ResourceNavigatorAction {
19:
20: /**
21: * Creates the action.
22: *
23: * @param navigator the resource navigator
24: * @param label the label for the action
25: */
26: public CollapseAllAction(IResourceNavigator navigator, String label) {
27: super (navigator, label);
28: PlatformUI.getWorkbench().getHelpSystem().setHelp(this ,
29: INavigatorHelpContextIds.COLLAPSE_ALL_ACTION);
30: setEnabled(true);
31: }
32:
33: /*
34: * Implementation of method defined on <code>IAction</code>.
35: */
36: public void run() {
37: getNavigator().getViewer().collapseAll();
38: }
39: }
|