public class ExpandAllHandler extends AbstractHandler
It can be used in a part's createPartControl(Composite) method:
IHandlerService handlerService = (IHandlerService) getSite().getService( IHandlerService.class); expandHandler = new ExpandAllHandler(myViewer); handlerService.activateHandler(ExpandAllHandler.COMMAND_ID, expandHandler);The part should dispose the handler in its own dispose() method. The part can provide its own expand 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 |
---|
ExpandAllHandler(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, setEnabled
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public static final String COMMAND_ID
public ExpandAllHandler(AbstractTreeViewer viewer)
viewer
- The viewer to expand. Must not be null
.public Object execute(ExecutionEvent event)
IHandler
event
- An event containing all the information about the current
state of the application; must not be null
.null
.public void dispose()
AbstractHandler
dispose
in interface IHandler
dispose
in class AbstractHandler
IHandler.dispose()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.