KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > navigator > CollapseAllAction


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  * Sebastian Davids <sdavids@gmx.de> - Collapse all action (25826)
11  *******************************************************************************/

12 package org.eclipse.ui.views.navigator;
13
14 import org.eclipse.ui.PlatformUI;
15
16 /**
17  * Collapse all project nodes.
18  */

19 public class CollapseAllAction extends ResourceNavigatorAction {
20
21     /**
22      * Creates the action.
23      *
24      * @param navigator the resource navigator
25      * @param label the label for the action
26      */

27     public CollapseAllAction(IResourceNavigator navigator, String JavaDoc label) {
28         super(navigator, label);
29         PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
30                 INavigatorHelpContextIds.COLLAPSE_ALL_ACTION);
31         setEnabled(true);
32     }
33
34     /*
35      * Implementation of method defined on <code>IAction</code>.
36      */

37     public void run() {
38         getNavigator().getViewer().collapseAll();
39     }
40 }
41
Popular Tags