KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > packageview > 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  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.packageview;
12
13 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
14 import org.eclipse.jdt.internal.ui.JavaPluginImages;
15 import org.eclipse.jface.action.Action;
16 import org.eclipse.ui.PlatformUI;
17
18 /**
19  * Collapse all nodes.
20  */

21 class CollapseAllAction extends Action {
22     
23     private PackageExplorerPart fPackageExplorer;
24     
25     CollapseAllAction(PackageExplorerPart part) {
26         super(PackagesMessages.CollapseAllAction_label);
27         setDescription(PackagesMessages.CollapseAllAction_description);
28         setToolTipText(PackagesMessages.CollapseAllAction_tooltip);
29         JavaPluginImages.setLocalImageDescriptors(this, "collapseall.gif"); //$NON-NLS-1$
30

31         fPackageExplorer= part;
32         PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.COLLAPSE_ALL_ACTION);
33     }
34  
35     public void run() {
36         fPackageExplorer.collapseAll();
37     }
38 }
39
Popular Tags