0
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
package com.nokia.s60tools.appdep.ui.actions;
|
|
20 |
|
|
21 |
import com.nokia.s60tools.appdep.resources.ImageKeys;
|
|
22 |
import com.nokia.s60tools.appdep.resources.ImageResourceManager;
|
|
23 |
import com.nokia.s60tools.appdep.resources.Messages;
|
|
24 |
import com.nokia.s60tools.appdep.ui.views.main.MainView;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* Collapses all subtrees in main view's component tree.
|
|
28 |
*/
|
|
29 |
public class CollapseAllMainViewAction extends AbstractMainViewAction {
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Constructor.
|
|
33 |
* @param view Reference to the view.
|
|
34 |
*/
|
|
35 |
public CollapseAllMainViewAction(MainView view){
|
|
36 |
super(view);
|
|
37 |
|
|
38 |
setText(Messages.getString("CollapseAllMainViewAction.CollapseAll_Action_Text")); //$NON-NLS-1$
|
|
39 |
setToolTipText(Messages.getString("CollapseAllMainViewAction.CollapseAll_Action_Tooltip")); //$NON-NLS-1$
|
|
40 |
|
|
41 |
|
|
42 |
/*******************************************************************************
|
|
43 |
* This piece of the graphic is taken/modified from a graphic that is made
|
|
44 |
* available under the terms of the Eclipse Public License v1.0.
|
|
45 |
*
|
|
46 |
* See 'com.nokia.s60tools.appdep.resources.ImageResourceManager'
|
|
47 |
* for detailed information about the original graphic.
|
|
48 |
*
|
|
49 |
*******************************************************************************/
|
|
50 |
setImageDescriptor(ImageResourceManager.
|
|
51 |
getImageDescriptor(ImageKeys.COLLAPSE_ALL_ACTION));
|
|
52 |
}
|
|
53 |
|
|
54 |
/* (non-Javadoc)
|
|
55 |
* @see org.eclipse.jface.action.IAction#run()
|
|
56 |
*/
|
|
57 |
public void run() {
|
|
58 |
view.getComponentTreeViewer().collapseAll();
|
|
59 |
view.getComponentTreeViewer().refresh();
|
|
60 |
// Remember to always call AbstractMainViewAction
|
|
61 |
// base class implementation
|
|
62 |
super.run();
|
|
63 |
}
|
|
64 |
}
|