|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.cmd.swing.WorkerCommand
public abstract class WorkerCommand
Implementation of the ViewCommand interface that will first run as a background command and then redispatch itself as a foreground command. Each mode has a different abstract method that can be overridden. This command is useful in cases where a background job needs to be done and then subsequently update a UI component.
Constructor Summary | |
---|---|
protected |
WorkerCommand()
|
Method Summary | |
---|---|
Result |
execute(Environment env)
Overridden to call the executeBackground() method when running in the background and executeForeground() when running in the foregroung. |
protected abstract Result |
executeBackground(Environment env)
Called when running the background. |
protected abstract Result |
executeForeground(Environment env)
Called when running the foreground on the AWT/Swing thread. |
boolean |
isForeground()
Returns true if the command should be run on the swing event dispatcher thread. |
void |
reset()
Resets the command to its background status so that it can be executed again. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected WorkerCommand()
Method Detail |
---|
public void reset()
public boolean isForeground()
isForeground
in interface ViewCommand
protected abstract Result executeForeground(Environment env)
protected abstract Result executeBackground(Environment env)
public Result execute(Environment env)
execute
in interface Command
env
- The environment within which the command is running.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |