Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 225036
Collapse All | Expand All

(-)plugin.properties (+2 lines)
Lines 336-341 Link Here
336
336
337
command.collapseAll.description = Collapse the current tree
337
command.collapseAll.description = Collapse the current tree
338
command.collapseAll.name = Collapse All
338
command.collapseAll.name = Collapse All
339
command.expandAll.description = Expand the current tree
340
command.expandAll.name = Expand All
339
command.quickMenu.name = Open Quick Menu
341
command.quickMenu.name = Open Quick Menu
340
command.quickMenu.uri.name = Location URI
342
command.quickMenu.uri.name = Location URI
341
command.showIn.name = Show In
343
command.showIn.name = Show In
(-)plugin.xml (+17 lines)
Lines 636-641 Link Here
636
            sequence="M1+M2+NUMPAD_DIVIDE">
636
            sequence="M1+M2+NUMPAD_DIVIDE">
637
      </key>
637
      </key>
638
      <key
638
      <key
639
            commandId="org.eclipse.ui.navigate.expandAll"
640
            contextId="org.eclipse.ui.contexts.window"
641
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
642
            sequence="M1+M2+NUMPAD_MULTIPLY">
643
      </key>
644
      <key
639
            commandId="org.eclipse.ui.navigate.nextSubTab"
645
            commandId="org.eclipse.ui.navigate.nextSubTab"
640
            contextId="org.eclipse.ui.contexts.dialogAndWindow"
646
            contextId="org.eclipse.ui.contexts.dialogAndWindow"
641
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
647
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
Lines 1205-1210 Link Here
1205
               values="org.eclipse.ui.internal.registry.ViewParameterValues">
1211
               values="org.eclipse.ui.internal.registry.ViewParameterValues">
1206
         </commandParameter>
1212
         </commandParameter>
1207
      </command>
1213
      </command>
1214
      <command
1215
            categoryId="org.eclipse.ui.category.navigate"
1216
            description="%command.expandAll.description"
1217
            id="org.eclipse.ui.navigate.expandAll"
1218
            name="%command.expandAll.name">
1219
      </command>
1208
   </extension>
1220
   </extension>
1209
   
1221
   
1210
   <extension
1222
   <extension
Lines 1269-1274 Link Here
1269
            icon="$nl$/icons/full/elcl16/collapseall.gif">
1281
            icon="$nl$/icons/full/elcl16/collapseall.gif">
1270
      </image>
1282
      </image>
1271
      <image
1283
      <image
1284
            commandId="org.eclipse.ui.navigate.expandAll"
1285
            disabledIcon="$nl$/icons/full/dlcl16/expandall.gif"
1286
            icon="$nl$/icons/full/elcl16/expandall.gif">
1287
      </image>
1288
      <image
1272
            commandId="org.eclipse.ui.newWizard"
1289
            commandId="org.eclipse.ui.newWizard"
1273
            disabledIcon="$nl$/icons/full/dtool16/new_wiz.gif"
1290
            disabledIcon="$nl$/icons/full/dtool16/new_wiz.gif"
1274
            icon="$nl$/icons/full/etool16/new_wiz.gif">
1291
            icon="$nl$/icons/full/etool16/new_wiz.gif">
(-)Eclipse UI/org/eclipse/ui/IWorkbenchCommandConstants.java (-4 / +12 lines)
Lines 272-281 Link Here
272
     */
272
     */
273
    public static final String NAVIGATE_COLLAPSE_ALL = "org.eclipse.ui.navigate.collapseAll"; //$NON-NLS-1$
273
    public static final String NAVIGATE_COLLAPSE_ALL = "org.eclipse.ui.navigate.collapseAll"; //$NON-NLS-1$
274
274
275
    /**
275
	/**
276
     * Id for command "Show In" in category "Navigate"
276
	 * Id for command "Expand All" in category "Navigate" (value is
277
     * (value is <code>"org.eclipse.ui.navigate.showIn"</code>).
277
	 * <code>"org.eclipse.ui.navigate.expandAll"</code>).
278
     */
278
	 * 
279
	 * @since 3.6
280
	 */
281
	public static final String NAVIGATE_EXPAND_ALL = "org.eclipse.ui.navigate.expandAll"; //$NON-NLS-1$
282
283
	/**
284
	 * Id for command "Show In" in category "Navigate" (value is
285
	 * <code>"org.eclipse.ui.navigate.showIn"</code>).
286
	 */
279
    public static final String NAVIGATE_SHOW_IN = "org.eclipse.ui.navigate.showIn"; //$NON-NLS-1$
287
    public static final String NAVIGATE_SHOW_IN = "org.eclipse.ui.navigate.showIn"; //$NON-NLS-1$
280
288
281
    /**
289
    /**
(-)Eclipse (+80 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2009 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
 *     @author Prakash G. R. 
12
 ******************************************************************************/
13
14
package org.eclipse.ui.handlers;
15
import org.eclipse.core.commands.AbstractHandler;
16
import org.eclipse.core.commands.ExecutionEvent;
17
import org.eclipse.core.runtime.Assert;
18
import org.eclipse.jface.viewers.AbstractTreeViewer;
19
import org.eclipse.ui.IWorkbenchCommandConstants;
20
21
/**
22
 * Expand a tree viewer.
23
 * <p>
24
 * It can be used in a part's createPartControl(Composite) method:
25
 * 
26
 * <pre>
27
 * IHandlerService handlerService = (IHandlerService) getSite().getService(
28
 * 		IHandlerService.class);
29
 * expandHandler = new ExpandAllHandler(myViewer);
30
 * handlerService.activateHandler(ExpandAllHandler.COMMAND_ID, expandHandler);
31
 * </pre>
32
 * 
33
 * The part should dispose the handler in its own dispose() method. The part can
34
 * provide its own expand all handler if desired, or if it needs to delegate to
35
 * multiple tree viewers.
36
 * </p>
37
 * <p>
38
 * <b>Note</b>: This class can be instantiated. It should not be subclasses.
39
 * </p>
40
 * 
41
 * @since 3.6
42
 */
43
public class ExpandAllHandler extends AbstractHandler {
44
	/**
45
	 * The command id for collapse all.
46
	 */
47
	public static final String COMMAND_ID = IWorkbenchCommandConstants.NAVIGATE_EXPAND_ALL;
48
49
	private AbstractTreeViewer treeViewer;
50
51
	/**
52
	 * Create the handler for this tree viewer.
53
	 * 
54
	 * @param viewer
55
	 *            The viewer to expand. Must not be <code>null</code>.
56
	 */
57
	public ExpandAllHandler(AbstractTreeViewer viewer) {
58
		Assert.isNotNull(viewer);
59
		treeViewer = viewer;
60
	}
61
62
	/*
63
	 * (non-Javadoc)
64
	 * 
65
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
66
	 */
67
	public Object execute(ExecutionEvent event) {
68
		treeViewer.expandAll();
69
		return null;
70
	}
71
72
	/*
73
	 * (non-Javadoc)
74
	 * 
75
	 * @see org.eclipse.core.commands.AbstractHandler#dispose()
76
	 */
77
	public void dispose() {
78
		treeViewer = null;
79
	}
80
}

Return to bug 225036