|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.util.tasks.FileProcessingProgressMonitorAdapter
public class FileProcessingProgressMonitorAdapter
Constructor Summary | |
---|---|
FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor,
long totalLength)
|
|
FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor,
long alreadyProcessed,
long totalLength)
|
|
FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor,
long alreadyProcessed,
long totalLength,
java.lang.String messageFormat)
|
|
FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor,
long totalLength,
java.lang.String messageFormat)
|
Method Summary | |
---|---|
void |
begin(java.lang.String taskName,
int totalWork)
Called to indicate the start of the task that this TaskMonitor
instance is monitoring. |
void |
beginWithUnknownTotalWork(java.lang.String taskName)
Called to indicate the start of the task that this TaskMonitor
instance is monitoring. |
void |
done()
Called to indicate the end of the task that this TaskMonitor
instance is monitoring. |
boolean |
isCanceled()
Called to test whether cancelation has been requested for the task that this TaskMonitor instance is monitoring. |
TaskMonitor |
newSubTaskMonitor(int amount)
Called to obtain a new TaskMonitor instance to be used in a
sub-task of the task being monitored by this TaskMonitor
instance. |
void |
setCanceled()
Sets the cancel state to true for the task this TaskMonitor is
monitoring. |
void |
setCurrentWorkDescription(java.lang.String description)
Called to set a more detailed description of the current work being done than the task name alone gives. |
void |
setTaskName(java.lang.String taskName)
Called to set the task name of the task being monitored by this TaskMonitor . |
void |
worked(int processed)
Called by the task that this TaskMonitor is monitoring to report
progress. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor, long totalLength)
public FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor, long totalLength, java.lang.String messageFormat)
public FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor, long alreadyProcessed, long totalLength)
public FileProcessingProgressMonitorAdapter(TaskMonitor parentMonitor, long alreadyProcessed, long totalLength, java.lang.String messageFormat)
Method Detail |
---|
public void worked(int processed)
TaskMonitor
TaskMonitor
is monitoring to report
progress. This method is typically called multiple times during the task.
Each time the number of work units that have been completed since the
last call to this method are passed. In other words, the number of work
units reported to this method must be non-cumulative.
worked
in interface TaskMonitor
processed
- a non-negative, non-cumulative amount of work unitspublic boolean isCanceled()
TaskMonitor
Called to test whether cancelation has been requested for the task that
this TaskMonitor
instance is monitoring.
To be cancelation-aware, the task should poll this method at regular
intervals. If true
is returned, the task should return early
as quickly as possible.
isCanceled
in interface TaskMonitor
true
if cancelation has been requested for this taskpublic void begin(java.lang.String taskName, int totalWork)
TaskMonitor
Called to indicate the start of the task that this TaskMonitor
instance is monitoring. This method is called when the total number of
work units for the task are known.
Either this method or the TaskMonitor.beginWithUnknownTotalWork(String)
method must be called only once per TaskMonitor
instance, and one
or the other must be called before other methods on the instance are
called.
begin
in interface TaskMonitor
taskName
- the name of the task that is beginning, or null
if
there is no task nametotalWork
- the total amount of work units that this task will take (must be
non-negative)public void beginWithUnknownTotalWork(java.lang.String taskName)
TaskMonitor
Called to indicate the start of the task that this TaskMonitor
instance is monitoring. This method is called when the total number of
work units for the task is not known.
Either this method or the TaskMonitor.begin(String, int)
method must be
called only once per TaskMonitor
instance, and one or the other
must be called before other methods on the instance are called.
beginWithUnknownTotalWork
in interface TaskMonitor
taskName
- the name of the task that is beginning, or null
if
there is no task namepublic void done()
TaskMonitor
Called to indicate the end of the task that this TaskMonitor
instance is monitoring. This method must be called, even if the
task aborts with an error or is canceled.
It is safe to call this method multiple times.
done
in interface TaskMonitor
public void setCanceled()
TaskMonitor
Sets the cancel state to true for the task this TaskMonitor
is
monitoring.
setCanceled
in interface TaskMonitor
public void setTaskName(java.lang.String taskName)
TaskMonitor
TaskMonitor
. Normally there is no reason to call this method,
since the task name is set by either the TaskMonitor.begin(String, int)
or
TaskMonitor.beginWithUnknownTotalWork(String)
methods and generally remains
constant throughout the lifetime of the task.
setTaskName
in interface TaskMonitor
taskName
- the task name as described above, or null
to clear
the task namepublic void setCurrentWorkDescription(java.lang.String description)
TaskMonitor
Called to set a more detailed description of the current work being done
than the task name alone gives. The current work description is an
additional description above and beyond the task name that is specified
in the TaskMonitor.begin(String, int)
,
TaskMonitor.beginWithUnknownTotalWork(String)
, and/or
TaskMonitor.setTaskName(String)
methods.
Many UI implementations of TaskMonitor
will render the task name
as a header and the current work description as a sub-header. Other UI
implementations may choose to ignore the current work description or to
let it override the task name.
setCurrentWorkDescription
in interface TaskMonitor
description
- the current work description as described above, or
null
to clear the current work descriptionpublic TaskMonitor newSubTaskMonitor(int amount)
TaskMonitor
Called to obtain a new TaskMonitor
instance to be used in a
sub-task of the task being monitored by this TaskMonitor
instance.
Note that every call to this method results in a new TaskMonitor
instance, and all of the TaskMonitor
rules apply to each
instance. Specifically, one of the begin
methods should be
called on the new instance, and the TaskMonitor.done()
method must be called
on the new instance.
Each sub-TaskMonitor
uses up sub number of work units of its
parent TaskMonitor
. This number is specified as the
amount
argument to this method. The sub-TaskMonitor
will have its own number of total work units (specified by the
TaskMonitor.begin(String, int)
method) and internally sub-task progress will
be scaled into main-task progress.
newSubTaskMonitor
in interface TaskMonitor
amount
- the amount of work units of the main task that the sub-task will
use up (must be non-negative)
TaskMonitor
instance to be used for a sub-task as
described above (never null
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |