Interface IHandlerActivation

  • All Superinterfaces:

    public interface IHandlerActivation
    extends, Comparable

    A token representing the activation of a handler. This token can later be used to cancel that activation. Without this token, then handler will only become inactive if the component in which the handler was activated is destroyed.

    This interface is not intended to be implemented or extended by clients.

    See Also:
    ISources, ISourceProvider
    • Field Summary

      Modifier and Type Field Description
      static int ROOT_DEPTH
      The depth at which the root exists.
    • Field Detail

      • ROOT_DEPTH

        static final int ROOT_DEPTH
        The depth at which the root exists.
        See Also:
        Constant Field Values
    • Method Detail

      • clearActive

        void clearActive()
        Use IEvaluationResultCache.clearResult() instead.
        Clears the cached computation of the isActive method, if any. This method is only intended for internal use. It provides a mechanism by which ISourceProvider events can invalidate state on a IHandlerActivation instance.
      • getCommandId

        String getCommandId()
        Returns the identifier of the command whose handler is being activated.
        The command identifier; never null.
      • getDepth

        int getDepth()
        Returns the depth at which this activation was created within the services hierarchy. The root of the hierarchy is at a depth of 1. This is used as the final tie-breaker in the event that no other method can be used to determine a winner.
        The depth at which the handler was inserted into the services hierarchy; should be a positive integer.
      • getHandler

        IHandler getHandler()
        Returns the handler that should be activated.
        The handler; may be null.
      • getHandlerService

        IHandlerService getHandlerService()
        Returns the handler service from which this activation was requested. This is used to ensure that an activation can only be retracted from the same service which issued it.
        The handler service; never null.
      • isActive

        boolean isActive​(IEvaluationContext context)
        Use IEvaluationResultCache.evaluate(IEvaluationContext) instead.
        Returns whether this handler activation is currently active -- given the current state of the workbench. This method should cache its computation. The cache will be cleared by a call to clearActive.
        context - The context in which this state should be evaluated; must not be null.
        true if the activation is currently active; false otherwise.