public abstract class GuiJob
extends java.lang.Object
GuiJob
or a GuiRequest
(if you need to get data from a GUI component) to perform thread-safe
tasks in the graphical user interface (in a safe way from a worker thread).GuiJob(boolean)
and set the flag to true
which means that the job waits for its completion.
EDT.execute(new GuiJob("setText") { protected void execute() throws Throwable { guiComponent.setText("Hello World!"); } });
EDT
Modifier and Type | Field and Description |
---|---|
protected boolean |
hasResult
flag that indicates whether this action has a result meaning that the execution must wait until the action is done
|
protected java.lang.String |
name
the name of the action or
null |
Constructor and Description |
---|
GuiJob()
Creates a new GUI job that is performed asynchronously in the EDT.
|
GuiJob(boolean waitForCompletion)
Creates a new GUI job.
|
GuiJob(java.lang.String name)
Creates a new GUI job that is performed asynchronously in the EDT.
|
GuiJob(java.lang.String name,
boolean waitForCompletion)
Creates a new GUI job.
|
protected final java.lang.String name
null
protected final boolean hasResult
public GuiJob()
public GuiJob(java.lang.String name)
name
- the name of the job or null
(the name is used to annotate exceptions that occur during the performance so it makes it a bit easier to allocate the point of failure)public GuiJob(boolean waitForCompletion)
waitForCompletion
- true
if the job should be performed synchronously in the EDT (meaning the job waits for its completion until all pending events in the EDT are processed) otherwise false
public GuiJob(java.lang.String name, boolean waitForCompletion)
name
- the name of the job or null
(the name is used to annotate exceptions that occur during the performance so it makes it a bit easier to allocate the point of failure)waitForCompletion
- true
if the job should be performed synchronously in the EDT (meaning the job waits for its completion until all pending events in the EDT are processed) otherwise false
protected final java.lang.Void perform() throws java.lang.Throwable
java.lang.Throwable
- RuntimeException
, AWTException
, ...) and errors (like AWTError
, ...) that are occurred during the performanceprotected abstract void execute() throws java.lang.Throwable
java.lang.Throwable
- public final void run()
run
in interface java.lang.Runnable