KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > actions > CollapseAllAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.debug.internal.ui.actions;
12
13 import org.eclipse.debug.internal.ui.DebugPluginImages;
14 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
15 import org.eclipse.jface.action.Action;
16 import org.eclipse.jface.viewers.TreeViewer;
17
18 /**
19  * CollapseAllAction
20  */

21 public class CollapseAllAction extends Action {
22     
23     private TreeViewer fViewer;
24     
25     public CollapseAllAction(TreeViewer viewer) {
26         super(ActionMessages.CollapseAllAction_0, DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL));
27         setToolTipText(ActionMessages.CollapseAllAction_0);
28         setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_COLLAPSE_ALL));
29         setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_COLLAPSE_ALL));
30         fViewer = viewer;
31     }
32     
33     /* (non-Javadoc)
34      * @see org.eclipse.jface.action.IAction#run()
35      */

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