|
Side of Software Wizard Library 1.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A Runnable object that can consist of any number of sub-tasks,
can notify listeners of its progress, and can be paused, resumed, and
interrupted.
If an implementation of Task wishes to be interruptible, it should
periodically check if its thread has been interrupted. If the thread
has been interrupted, then it should undo any changes it has made
and return, ensuring that it leaves its thread's interrupted flag
set.
| Method Summary | |
void |
addProgressListener(ProgressListener listener)
Registers the specified listener to get notified when this task's progress changes. |
java.lang.String |
getName()
Returns the (localized) name of this task. |
double |
getProgress()
Returns a number between 0 and 100 that estimates this task's percentage complete. |
boolean |
isInterruptible()
Returns true if this task can be interrupted. |
boolean |
isPaused()
Returns true is this task is paused. |
void |
pause()
Pauses this task. |
void |
removeProgressListener(ProgressListener listener)
Unregisters the specified listener for getting notified when this task's progress changes. |
void |
resume()
Resumes this task if it is paused. |
void |
run()
Executes this task. |
| Methods inherited from interface javax.swing.ComboBoxModel |
getSelectedItem, setSelectedItem |
| Methods inherited from interface javax.swing.ListModel |
addListDataListener, getElementAt, getSize, removeListDataListener |
| Methods inherited from interface sos.wizard.Model |
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
| Method Detail |
public void addProgressListener(ProgressListener listener)
listener - object wishing to get notifiedpublic boolean isInterruptible()
true if this task can be interrupted.
true if this task can be interruptedpublic double getProgress()
public boolean isPaused()
true is this task is paused.
true is this task is paused.public void pause()
java.lang.UnsupportedOperationException - if this task is
not interruptibleresume(),
isInterruptible()public void resume()
java.lang.UnsupportedOperationException - if this task is
not interruptiblepause(),
isInterruptible()public void run()
run in interface java.lang.Runnablepublic java.lang.String getName()
public void removeProgressListener(ProgressListener listener)
listener - object that no longer wishes to be notified
|
Side of Software Wizard Library 1.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||