public abstract class WindowThreadTask extends Task implements EventListener
Handle.ObjectDiscarder, Handle.WaitOnChange
Modifier and Type | Field and Description |
---|---|
Window |
window |
Aborted, Changed, DEFAULT_CHANGE_ACCEPT_TIME, DEFAULT_PROGRESS_RESOLUTION, doing, error, Failed, Failure, OPTION_STOP_IF_NOT_SET, OPTION_TIMEOUT_IF_NOT_SET, progress, progressResolution, returnCode, returnValue, Running, shouldStop, startTime, state, Stopped, stopReason, subHandle, Succeeded, Success, waitChangeAcceptedTime
Constructor and Description |
---|
WindowThreadTask() |
Modifier and Type | Method and Description |
---|---|
int |
execute(Control parent)
Execute the Task, wait until it is complete and return the state of the Task.
|
void |
onEvent(Event ev) |
void |
run(Control parent,
boolean alwaysInSeparateThread)
Start the Task running in a separate call of the Window thread by posting
an Event that will eventually cause the run() method to be called or possibly
run it in the current Thread if the current thread is the active Window thread
and alwaysInSeparateThread is false.
|
Handle |
start()
Start the Task running in a separate call of the Window thread by posting
an Event that will eventually cause the run() method to be called.
|
int |
tryExecute(Control parent)
Try to run execute(Control parent) but catch any Exception (not Error) that may
occur.
|
complete, doRun, getDaemon, getThread, interrupt, run, setDaemon, setThreadGroup, sleep, start
addParent, changeAccepted, changed, check, check, checkAbortFail, checkAny, checkChangeAccepted, checkFailure, convertError, doChangeTo, fail, getChangeState, getErrorText, getFinalReturnValue, getProperties, getReturnValue, getStoppableWaitOnSuccess, getUnwrappedReturnValue, hasStopped, newWaitOnChange, removeParent, resetProgress, set, setFlags, setProgress, setProgress, setResult, setReturnValue, startDoing, stop, succeed, succeeded, throwErrorIfNotStopped, throwRuntimeError, throwRuntimeError, throwRuntimeError, throwRuntimeError, timeout, timeout, waitChangeAccepted, waitForReturnValue, waitOn, waitOn, waitOn, waitOn, waitOnAny, waitOnAny, waitOnAny, waitOnAny, waitOnChange, waitOnResult, waitOnSuccess, waitOnSuccess, waitReturnValue, waitUntilCompletion, waitUntilCompletion, waitUntilStopped, waitUntilStopped, wasAborted, yield
public Window window
public Handle start()
public void run(Control parent, boolean alwaysInSeparateThread)
parent
- the Control in the Window.alwaysInSeparateThread
- if this is true the method always returns immediately
and requests the task to run in another call of the Window thread.public int execute(Control parent) throws IllegalStateException
parent
- a Control contained in the Window the Task should run in. getWindow()
is called on the Control to determine the Window. This parameter can be the Window
itself.IllegalStateException
- if the parent is not contained within a Window.public int tryExecute(Control parent)
parent
- a Control contained in the Window the Task should run in. getWindow()
is called on the Control to determine the Window. This parameter can be the Window
itself.public final void onEvent(Event ev)