Package org.jdesktop.application
Class TaskListener.Adapter<T,V>
java.lang.Object
org.jdesktop.application.TaskListener.Adapter<T,V>
- 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 TypeMethodDescriptionvoid
Called after the Task'scancelled
method is called.void
doInBackground
(TaskEvent<Void> event) Called just before the Task'sdoInBackground
method is called, i.e.void
Called after the Task'sfailed
completion method is called.void
Called after the Task'sfinished
method is called.void
interrupted
(TaskEvent<InterruptedException> event) Called after the Task'sinterrupted
method is called.void
Called each time the Task'sprocess
method is called.void
Called after the Task'ssucceeded
completion method is called.
-
Constructor Details
-
Adapter
public Adapter()
-
-
Method Details
-
doInBackground
Description copied from interface:TaskListener
Called just before the Task'sdoInBackground
method is called, i.e. just before the task begins running. Theevent's
source is the Task and its value is null.- Specified by:
doInBackground
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object, value is null- See Also:
-
process
Description copied from interface:TaskListener
Called each time the Task'sprocess
method is called. The value of the event is the list of values passed to the process method.- Specified by:
process
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object and whose value is a list of the values passed to theTask.process()
method- See Also:
-
succeeded
Description copied from interface:TaskListener
Called after the Task'ssucceeded
completion method is called. The event's value is the value returned by the Task'sget
method, i.e. the value that is computed bySwingWorker.doInBackground()
.- Specified by:
succeeded
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object, and whose value is the value returned byTask.get()
.- See Also:
-
failed
Description copied from interface:TaskListener
Called after the Task'sfailed
completion method is called. The event's value is the Throwable passed toTask.failed()
.- Specified by:
failed
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object, and whose value is the Throwable passed toTask.failed()
.- See Also:
-
cancelled
Description copied from interface:TaskListener
Called after the Task'scancelled
method is called. Theevent's
source is the Task and its value is null.- Specified by:
cancelled
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object, value is null- See Also:
-
interrupted
Description copied from interface:TaskListener
Called after the Task'sinterrupted
method is called. Theevent's
source is the Task and its value is the InterruptedException passed toTask.interrupted()
.- Specified by:
interrupted
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object, and whose value is the InterruptedException passed toTask.interrupted()
.- See Also:
-
finished
Description copied from interface:TaskListener
Called after the Task'sfinished
method is called. Theevent's
source is the Task and its value is null.- Specified by:
finished
in interfaceTaskListener<T,
V> - Parameters:
event
- a TaskEvent whose source is theTask
object, value is null.- See Also:
-