KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > launchConfigurations > CollapseAllLaunchConfigurationAction


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.launchConfigurations;
12
13 import org.eclipse.debug.internal.ui.DebugUIPlugin;
14 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
15 import org.eclipse.debug.ui.DebugUITools;
16 import org.eclipse.jface.action.Action;
17 import org.eclipse.jface.resource.ImageDescriptor;
18 import org.eclipse.jface.viewers.TreeViewer;
19
20 /**
21  * Provides a collapse all button for the launch configuration viewer toolbar
22  * @since 3.2
23  */

24 public class CollapseAllLaunchConfigurationAction extends Action {
25
26     /**
27      * Action identifier for IDebugView#getAction(String)
28      */

29     public static final String JavaDoc ID_COLLAPSEALL_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_COLLAPSEALL_ACTION"; //$NON-NLS-1$
30

31     /**
32      * the viewer to perform the collapse all on
33      */

34     private TreeViewer fViewer = null;
35     
36     /**
37      * Constructor
38      * @param viewer the viewer to perform the collapse all on
39      */

40     public CollapseAllLaunchConfigurationAction(TreeViewer viewer) {
41         fViewer = viewer;
42     }
43
44     /* (non-Javadoc)
45      * @see org.eclipse.jface.action.Action#getImageDescriptor()
46      */

47     public ImageDescriptor getImageDescriptor() {
48         return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL);
49     }
50
51     /* (non-Javadoc)
52      * @see org.eclipse.jface.action.Action#getText()
53      */

54     public String JavaDoc getText() {
55         return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_0;
56     }
57
58     /* (non-Javadoc)
59      * @see org.eclipse.jface.action.Action#getToolTipText()
60      */

61     public String JavaDoc getToolTipText() {
62         return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_1;
63     }
64
65     /* (non-Javadoc)
66      * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
67      */

68     public ImageDescriptor getDisabledImageDescriptor() {
69         return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_COLLAPSE_ALL);
70     }
71
72     /* (non-Javadoc)
73      * @see org.eclipse.jface.action.Action#run()
74      */

75     public void run() {
76         fViewer.collapseAll();
77     }
78
79     /* (non-Javadoc)
80      * @see org.eclipse.jface.action.Action#getDescription()
81      */

82     public String JavaDoc getDescription() {
83         return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_2;
84     }
85 }
86
Popular Tags