Class HandlerServiceImpl

java.lang.Object
org.eclipse.e4.core.commands.internal.HandlerServiceImpl
All Implemented Interfaces:
EHandlerService

public class HandlerServiceImpl extends Object implements EHandlerService
  • Field Details

  • Constructor Details

    • HandlerServiceImpl

      public HandlerServiceImpl()
  • Method Details

    • getHandler

      public static IHandler getHandler(String commandId)
    • push

      public static void push(IEclipseContext ctx, IEclipseContext staticCtx)
    • pop

      public static org.eclipse.e4.core.commands.internal.HandlerServiceImpl.ExecutionContexts pop()
    • lookUpHandler

      public static Object lookUpHandler(IEclipseContext context, String commandId)
      Parameters:
      context - the context to start the lookup process
      Returns:
      a handler, or null
    • activateHandler

      public void activateHandler(String commandId, Object handler)
      Description copied from interface: EHandlerService
      Makes the passed handler active for the command with the passed commandId.
      Specified by:
      activateHandler in interface EHandlerService
      Parameters:
      commandId - Must not be null
      handler - Must not be null
    • canExecute

      public boolean canExecute(ParameterizedCommand command)
      Description copied from interface: EHandlerService
      Tests if the active handler associated with the passed command can be executed.
      Specified by:
      canExecute in interface EHandlerService
      Parameters:
      command - Must not be null
      Returns:
      true of the handler can be executed, false if it cannot be executed or if no handler is active for the passed command.
    • canExecute

      public boolean canExecute(ParameterizedCommand command, IEclipseContext staticContext)
      Description copied from interface: EHandlerService
      Check if a command can be executed.
      Specified by:
      canExecute in interface EHandlerService
      Parameters:
      command - Must not be null.
      staticContext - Must not be null. You must dispose your context when you are done.
      Returns:
      true if the command can be executed.
    • deactivateHandler

      public void deactivateHandler(String commandId, Object handler)
      Description copied from interface: EHandlerService
      Deactivates the passed handler from the command with the passed id.
      Specified by:
      deactivateHandler in interface EHandlerService
      Parameters:
      commandId - Must not be null
      handler - Must not be null
    • executeHandler

      public Object executeHandler(ParameterizedCommand command)
      Description copied from interface: EHandlerService
      Executes the active handler of the passed command.
      Specified by:
      executeHandler in interface EHandlerService
      Parameters:
      command - Must not be null
      Returns:
      the return value of the handler, could be null
    • executeHandler

      public Object executeHandler(ParameterizedCommand command, IEclipseContext staticContext)
      Description copied from interface: EHandlerService
      Execute a handler for the command.
      Specified by:
      executeHandler in interface EHandlerService
      Parameters:
      command - Must not be null
      staticContext - Must not be null. You must dispose your context when you are done.
      Returns:
      the command return value.
    • setContext

      @Inject public void setContext(IEclipseContext c)
    • getContext

      public IEclipseContext getContext()
    • getExecutionContext

      public IEclipseContext getExecutionContext()