Package org.jdesktop.application
Class TaskListener.Adapter<T,V>
java.lang.Object
org.jdesktop.application.TaskListener.Adapter<T,V>
- Type Parameters:
T- the result type returned by thisSwingWorker'sdoInBackgroundandgetmethodsV- the type used for carrying out intermediate results by thisSwingWorker'spublishandprocessmethods
- All Implemented Interfaces:
TaskListener<T,V>
- Enclosing interface:
TaskListener<T,V>
Convenience class that stubs all of the TaskListener interface
methods. Using TaskListener.Adapter can simplify building
TaskListeners.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jdesktop.application.TaskListener
TaskListener.Adapter<T,V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after the Task'scancelledmethod is called.voiddoInBackground(TaskEvent<Void> event) Called just before the Task'sdoInBackgroundmethod is called, i.e.voidCalled after the Task'sfailedcompletion method is called.voidCalled after the Task'sfinishedmethod is called.voidinterrupted(TaskEvent<InterruptedException> event) Called after the Task'sinterruptedmethod is called.voidCalled each time the Task'sprocessmethod is called.voidCalled after the Task'ssucceededcompletion method is called.
-
Constructor Details
-
Adapter
public Adapter()
-
-
Method Details
-
doInBackground
Description copied from interface:TaskListenerCalled just before the Task'sdoInBackgroundmethod is called, i.e. just before the task begins running. Theevent'ssource is the Task and its value is null.- Specified by:
doInBackgroundin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject, value is null- See Also:
-
process
Description copied from interface:TaskListenerCalled each time the Task'sprocessmethod is called. The value of the event is the list of values passed to the process method.- Specified by:
processin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject and whose value is a list of the values passed to theTask.process()method- See Also:
-
succeeded
Description copied from interface:TaskListenerCalled after the Task'ssucceededcompletion method is called. The event's value is the value returned by the Task'sgetmethod, i.e. the value that is computed bySwingWorker.doInBackground().- Specified by:
succeededin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject, and whose value is the value returned byTask.get().- See Also:
-
failed
Description copied from interface:TaskListenerCalled after the Task'sfailedcompletion method is called. The event's value is the Throwable passed toTask.failed().- Specified by:
failedin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject, and whose value is the Throwable passed toTask.failed().- See Also:
-
cancelled
Description copied from interface:TaskListenerCalled after the Task'scancelledmethod is called. Theevent'ssource is the Task and its value is null.- Specified by:
cancelledin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject, value is null- See Also:
-
interrupted
Description copied from interface:TaskListenerCalled after the Task'sinterruptedmethod is called. Theevent'ssource is the Task and its value is the InterruptedException passed toTask.interrupted().- Specified by:
interruptedin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject, and whose value is the InterruptedException passed toTask.interrupted().- See Also:
-
finished
Description copied from interface:TaskListenerCalled after the Task'sfinishedmethod is called. Theevent'ssource is the Task and its value is null.- Specified by:
finishedin interfaceTaskListener<T,V> - Parameters:
event- a TaskEvent whose source is theTaskobject, value is null.- See Also:
-