public class CollapseAllHandler extends AbstractHandler
It can be used in a part's createPartControl(Composite) method:
IHandlerService handlerService = (IHandlerService) getSite().getService(
IHandlerService.class);
collapseHandler = new CollapseAllHandler(myViewer);
handlerService.activateHandler(CollapseAllHandler.COMMAND_ID, collapseHandler);
The part should dispose the handler in its own dispose() method. The part
can provide its own collapse all handler if desired, or if it needs to
delegate to multiple tree viewers.
Note: This class can be instantiated. It should not be subclasses.
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMAND_ID
The command id for collapse all.
|
| Constructor and Description |
|---|
CollapseAllHandler(AbstractTreeViewer viewer)
Create the handler for this tree viewer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
The default implementation does nothing.
|
Object |
execute(ExecutionEvent event)
Executes with the map of parameter values by name.
|
addHandlerListener, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabledaddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectpublic static final String COMMAND_ID
public CollapseAllHandler(AbstractTreeViewer viewer)
viewer - The viewer to collapse. Must not be null.public Object execute(ExecutionEvent event)
IHandlerevent - An event containing all the information about the current
state of the application; must not be null.null.public void dispose()
AbstractHandlerdispose in interface IHandlerdispose in class AbstractHandlerIHandler.dispose()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.