Class ExpandAllHandler

  • All Implemented Interfaces:
    IHandler, IHandler2

    public class ExpandAllHandler
    extends AbstractHandler
    Expand a tree viewer.

    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.

    Since:
    3.6
    • Constructor Detail

      • ExpandAllHandler

        public ExpandAllHandler​(AbstractTreeViewer viewer)
        Create the handler for this tree viewer.
        Parameters:
        viewer - The viewer to expand. Must not be null.
    • Method Detail

      • execute

        public Object execute​(ExecutionEvent event)
        Description copied from interface: IHandler
        Executes 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.
      • dispose

        public void dispose()
        Description copied from class: AbstractHandler
        The default implementation does nothing. Subclasses who attach listeners to other objects are encouraged to detach them in this method.
        Specified by:
        dispose in interface IHandler
        Overrides:
        dispose in class AbstractHandler