|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.tool.SwingExamineTask
public abstract class SwingExamineTask
Allows the GUI thread to attempt to examine the database immediately. If that fails, then the GUI can pass this object to the Job queue via Job.invokeExamineLater() to have it run at a later time in the GUI thread. A standard usage is as follows:
SwingExamineTask task = new SwingExamineTask() {
protected boolean doIt() {
// do something that requires database examine and GUI modification
}
}
// try to run the task immediately, if not possible, run at a later time
if (!task.runImmediately()) {
Job.invokeExamineLater(task, null);
}
Note: it is not necessary to acquire an examine lock in doIt(), as the SwingExamineTask ensures that an examine lock already held in all cases.
Constructor Summary | |
---|---|
SwingExamineTask()
|
Method Summary | |
---|---|
protected abstract boolean |
doIt(boolean immediate)
This should contain the code that needs to examine the database while in the GUI thread |
void |
run()
This should only be called by the Job class. |
boolean |
runImmediately()
This tries to execute doIt() immediately by trying to acquire an examine lock for the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwingExamineTask()
Method Detail |
---|
public final void run()
run
in interface java.lang.Runnable
public final boolean runImmediately()
protected abstract boolean doIt(boolean immediate)
immediate
- true if run immediately using runImmediate(),
false if run through callback to run().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |