upload tizen1.0 source
[sdk/ide/product.git] / org.eclipse.cdt.ui / src / org / eclipse / cdt / internal / ui / cview / CollapseAllAction.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2008 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.cdt.internal.ui.cview;
12
13 import org.eclipse.cdt.internal.ui.ICHelpContextIds;
14 import org.eclipse.cdt.internal.ui.CPluginImages;
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 CView cview;
24         
25         CollapseAllAction(CView part) {
26                 super(CViewMessages.CollapseAllAction_label); 
27                 setDescription(CViewMessages.CollapseAllAction_description); 
28                 setToolTipText(CViewMessages.CollapseAllAction_tooltip); 
29                 CPluginImages.setImageDescriptors(this, CPluginImages.T_LCL, CPluginImages.IMG_MENU_COLLAPSE_ALL);
30                 cview = part;
31                 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.COLLAPSE_ALL_ACTION);
32         }
33  
34         @Override
35         public void run() { 
36                 cview.collapseAll();
37         }
38 }