com.dlsc.flexgantt.swing

## Interface ICommandInterceptor<T extends AbstractGanttChart>

- Type Parameters:
    `T` - the type of the Gantt chart for which the interceptor will be used

      public interface ICommandInterceptor<T extends AbstractGanttChart>

  A command interceptor gets invoked if a certain type of command is about to be executed. The interceptor can decide whether it wants to perform some additional actions before the command gets send to the command stack for its execution. Interceptors are commonly used whenever an application wants to prompt the user first for confirmation before continuing execution. An example for a typical confirmation message would look like this: "Are you sure you want to move the activity XYZ to resource ABC?".
  Since:
    1.0
  Version:
    $Revision: 1.3 $
  Author:
    Dirk Lemmermann
  See Also:
    `AbstractGanttChart.setCommandInterceptor(Class, ICommandInterceptor)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `intercept(T gc, ICommand cmd)` Callback method that gets invoked after a command gets send to the Gantt chart for execution but before is gets passed to the command stack.

- - ### Method Detail

    - #### intercept

          boolean intercept(T gc,
                            ICommand cmd)

      Callback method that gets invoked after a command gets send to the Gantt chart for execution but before is gets passed to the command stack. The interceptor can choose to cancel the command (this is usually the case after the user has answered NO or CANCEL to some confirmation dialog).
      Parameters:
        `gc` - the Gantt chart for which the command will be executed
        `cmd` - the command that is about to be executed
      Returns:
        TRUE or FALSE depending on whether the command execution shall progress
      Since:
        1.0
      See Also:
        `AbstractGanttChart.commandExecute(ICommand)`, `ICommandStack.execute(ICommand, IProgressMonitor)`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.