public class AbstractProgressMonitor extends java.lang.Object implements ProgressMonitor
SIZE_INDETERMINATE| Constructor and Description |
|---|
AbstractProgressMonitor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeCancelled()
return true if the process appears to support cancel.
|
void |
cancel()
Notifies the
ProgressMonitor that the task
being monitored should be canceled. |
void |
finished()
Notifies the
ProgressMonitor that the task
being monitored has finished. |
java.lang.String |
getLabel()
Return the label string displayed, which is a concise string that
describes the task being performed.
|
java.lang.String |
getProgressMessage()
provide access to the last progress message setting.
|
ProgressMonitor |
getSubtaskMonitor(int start,
int end,
java.lang.String label)
return a monitor to use for a subtask.
|
ProgressMonitor |
getSubtaskMonitor(java.lang.String label)
get the subtask monitor when the current task length is indeterminate.
|
long |
getTaskProgress()
Returns the current progress of the monitored task.
|
long |
getTaskSize()
Return the size of the task.
|
boolean |
isCancelled()
Returns
true if the operation being tracked
should be cancelled. |
boolean |
isFinished()
true if the process has indicated that it is finished
|
boolean |
isStarted()
true if the process has indicated that it has started.
|
void |
setAdditionalInfo(java.lang.String s)
Deprecated.
|
void |
setLabel(java.lang.String s)
Set a concise string that describes the task being performed.
|
void |
setProgressMessage(java.lang.String message)
Provides additional feedback as to what's going on in the process.
|
void |
setTaskProgress(long position)
Notifies the ProgressMonitor of a change in the progress
of the task.
|
void |
setTaskSize(long taskSize)
Sets the maximum value for the task progress of this
ProgressMonitor. |
void |
started()
Notifies the
ProgressMonitor that the task
being monitored has started. |
java.lang.String |
toString()
return a human-readable representation of the monitor, which is
currently position + "of" + taskSize.
|
public void setTaskSize(long taskSize)
ProgressMonitorProgressMonitor.setTaskSize in interface ProgressMonitortaskSize - maximum value for the task progress. A taskSize of -1 indicates the taskSize is indeterminate.public long getTaskSize()
ProgressMonitorgetTaskSize in interface ProgressMonitorpublic void setProgressMessage(java.lang.String message)
ProgressMonitorsetProgressMessage in interface ProgressMonitormessage - the message describing the state of progress.public java.lang.String getProgressMessage()
public void setTaskProgress(long position)
throws java.lang.IllegalArgumentException
ProgressMonitorsetTaskProgress in interface ProgressMonitorposition - the current task positionjava.lang.IllegalArgumentException - if ProgressMonitor.isCancelled() returns true or,
possibly if started() has not been called or
finished() has been called.public long getTaskProgress()
ProgressMonitorgetTaskProgress in interface ProgressMonitorpublic void started()
ProgressMonitorProgressMonitor that the task
being monitored has started. If the ProgressMonitor
is in a cancelled state when this method is called, that
ProgressMonitor should be 'uncancelled'.started in interface ProgressMonitorpublic boolean isStarted()
ProgressMonitorisStarted in interface ProgressMonitorpublic void finished()
ProgressMonitorProgressMonitor that the task
being monitored has finished. This must only be called once, and note that isFinished() must return
the state of this monitor.finished in interface ProgressMonitorpublic boolean isFinished()
ProgressMonitorisFinished in interface ProgressMonitorpublic void cancel()
ProgressMonitorProgressMonitor that the task
being monitored should be canceled. After this method is
called, implementations should return true on
any subsequent calls to ProgressMonitor.isCancelled() and should
throw an IllegalStateException on any subsequent calls to
ProgressMonitor.setTaskProgress(long).cancel in interface ProgressMonitorpublic boolean isCancelled()
ProgressMonitortrue if the operation being tracked
should be cancelled. For example, the human operator has pressed
the cancel button indicating that the process should be stopped. Note
that if the process is not checking the cancel status, the cancel button
should be disabled.isCancelled in interface ProgressMonitortrue if the operation being tracked
should be cancelled.@Deprecated public void setAdditionalInfo(java.lang.String s)
ProgressMonitorsetAdditionalInfo in interface ProgressMonitors - the message, such as (50KB/s)public void setLabel(java.lang.String s)
ProgressMonitorsetLabel in interface ProgressMonitors - the label describing the task.public java.lang.String getLabel()
ProgressMonitorgetLabel in interface ProgressMonitorpublic java.lang.String toString()
toString in class java.lang.Objectpublic ProgressMonitor getSubtaskMonitor(int start, int end, java.lang.String label)
ProgressMonitorgetSubtaskMonitor in interface ProgressMonitorstart - start position on this monitor.end - end position on this monitor (exclusive).label - a label for the subtask, often this is handled as progress message; or null.public ProgressMonitor getSubtaskMonitor(java.lang.String label)
ProgressMonitorgetSubtaskMonitor in interface ProgressMonitorlabel - a label for the subtask, often this is handled as progress message; or null.public boolean canBeCancelled()
ProgressMonitorcanBeCancelled in interface ProgressMonitor