com.dlsc.flexgantt.swing
Interface ICommandInterceptor


public interface ICommandInterceptor

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
Author:
Dirk Lemmermann

Method Summary
 boolean intercept(AbstractGanttChart 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(AbstractGanttChart 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)