Interface IncrementalCommand

public interface IncrementalCommand
An IncrementalCommand is a command that is broken into one or more substeps, each substep brings the whole command nearer to completion. The command is complete when execute() returns false.
public class IncrementalCommandExample implements EntryPoint {

  public void onModuleLoad() {
    final Label label = new Label();
    
    DeferredCommand.addCommand(new IncrementalCommand() {
      private int index = 0;
      
      protected static final int COUNT = 10;
      
      public boolean execute() {
        label.setText("IncrementalCommand - index " + Integer.toString(index));
        
        return ++index < COUNT;
      }
    });
  }
}

Methods

execute()Causes the IncrementalCommand to execute its encapsulated behavior.

Method Detail

execute

public boolean execute()
Causes the IncrementalCommand to execute its encapsulated behavior.

Return Value

true if the command has more work to do, false otherwise