|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ProgressMonitor
Typical use case is:
monitor.beginTask() try { .. do some work monitor.worked() monitor.subTask()/monitor.intermediateTask() .. do some work monitor.worked() } finally { monitor.finishTask(); }
subTask(String)
and indeterminateSubTask(String)
has nothing to do with logical
structure of the work, they just show task title to the user.
If task consists of multiple tasks then createSubTaskMonitor(int, boolean)
may be used. It
will create new ProgressMonitor, then can be passed to the subtask. Subtask doesn't know whether
it runs standalone or as a part of other task. Progressbar will be updated so that total progress is
shown, not just progress of the subtask
All ProgressMonitor implementations should be thread safe.
Nested Class Summary | |
---|---|
static interface |
ProgressMonitor.CancelListener
|
Field Summary | |
---|---|
static int |
ALL_TICKS
Can be used with worked(int) and createSubTaskMonitor(int, boolean) to
express that the task should use all remaining ticks |
static int |
DEFAULT_TICKS
|
Method Summary | |
---|---|
void |
addCancelListener(ProgressMonitor.CancelListener listener)
|
void |
appendLogMessage(java.lang.String message)
Appends a message to the log managed by the progress monitor. |
void |
beginTask(java.lang.String title)
|
void |
beginTask(java.lang.String title,
int ticks)
Starts this progress monitor. |
void |
cancel()
|
ProgressMonitor |
createSubTaskMonitor(int ticks,
boolean internal)
Creates subtasks monitor. |
void |
finishTask()
Finish this progress monitor, close the dialog or inform the parent progress monitor that it can continue with other tasks. |
ProgressTaskId |
getProgressTaskId()
Should be used only by PleaseWaitRunnable |
int |
getTicks()
|
int |
getTicksCount()
|
java.awt.Component |
getWindowParent()
|
void |
indeterminateSubTask(java.lang.String title)
Subtask that will show progress running back and forth |
void |
invalidate()
Can be used if method receive ProgressMonitor but it's not interested progress monitoring. |
boolean |
isCanceled()
|
void |
removeCancelListener(ProgressMonitor.CancelListener listener)
|
void |
setCustomText(java.lang.String text)
Shows additional text |
void |
setExtraText(java.lang.String text)
Show extra text after normal task title. |
void |
setProgressTaskId(ProgressTaskId taskId)
Should be used only by PleaseWaitRunnable. |
void |
setTicks(int ticks)
|
void |
setTicksCount(int ticks)
|
void |
subTask(java.lang.String title)
Normal subtask |
void |
worked(int ticks)
Increase number of already done work units by ticks |
Field Detail |
---|
static final int DEFAULT_TICKS
static final int ALL_TICKS
worked(int)
and createSubTaskMonitor(int, boolean)
to
express that the task should use all remaining ticks
Method Detail |
---|
void beginTask(java.lang.String title)
void beginTask(java.lang.String title, int ticks)
title
- ticks
- void finishTask()
void invalidate()
beginTask(String)
and finishTask()
This method can be also used in finally section if method expects that some exception
might prevent it from passing progressMonitor away. If beginTask(String)
was
already called then this method does nothing.
void setTicksCount(int ticks)
ticks
- Number of total work unitsvoid setTicks(int ticks)
ticks
- Number of work units already doneint getTicks()
int getTicksCount()
void worked(int ticks)
ticks
- void indeterminateSubTask(java.lang.String title)
title
- Can be null, in that case task title is not changedvoid subTask(java.lang.String title)
title
- Can be null, in that case task title is not changedvoid setCustomText(java.lang.String text)
void setExtraText(java.lang.String text)
text
- ProgressMonitor createSubTaskMonitor(int ticks, boolean internal)
ticks
- Number of work units that should be done when subtask finishesinternal
- If true then subtask can't modify task title/custom text
boolean isCanceled()
void cancel()
void addCancelListener(ProgressMonitor.CancelListener listener)
void removeCancelListener(ProgressMonitor.CancelListener listener)
void appendLogMessage(java.lang.String message)
message
- the log message. Ignored if null or white space only.void setProgressTaskId(ProgressTaskId taskId)
taskId
- ProgressTaskId getProgressTaskId()
taskId
- java.awt.Component getWindowParent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |