Package org.eclipse.ui.handlers
Class CollapseAllHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
org.eclipse.ui.handlers.CollapseAllHandler
Collapse a tree viewer.
 
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.
- Since:
- 3.4
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionCollapseAllHandler(AbstractTreeViewer viewer) Create the handler for this tree viewer.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()The default implementation does nothing.execute(ExecutionEvent event) Executes with the map of parameter values by name.Methods inherited from class org.eclipse.core.commands.AbstractHandleraddHandlerListener, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabledMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.commands.IHandlergetHandlerLabel
- 
Field Details- 
COMMAND_IDThe command id for collapse all.- See Also:
 
 
- 
- 
Constructor Details- 
CollapseAllHandlerCreate the handler for this tree viewer.- Parameters:
- viewer- The viewer to collapse. Must not be- null.
 
 
- 
- 
Method Details- 
executeDescription copied from interface:IHandlerExecutes with the map of parameter values by name.- Parameters:
- event- An event containing all the information about the current state of the application; must not be- null.
- Returns:
- the result of the execution. Reserved for future use, must be
         null.
 
- 
disposepublic void dispose()Description copied from class:AbstractHandlerThe default implementation does nothing. Subclasses who attach listeners to other objects are encouraged to detach them in this method.- Specified by:
- disposein interface- IHandler
- Overrides:
- disposein class- AbstractHandler
 
 
-