public class NullProgressMonitor extends Object implements ProgressMonitor
This implementation supports cancelation. The default implementations of the other methods do nothing.
Clients may instantiate or subclass this class.
UNKNOWN
Constructor and Description |
---|
NullProgressMonitor() |
Modifier and Type | Method and Description |
---|---|
void |
beginTask(String name,
int totalWork)
This implementation does nothing.
|
void |
done()
This implementation does nothing.
|
void |
internalWorked(double work)
This implementation does nothing.
|
boolean |
isCanceled()
This implementation returns the value of the internal
state variable set by
setCanceled . |
void |
setCanceled(boolean cancelled)
This implementation sets the value of an internal state variable.
|
void |
setTaskName(String name)
This implementation does nothing.
|
void |
subTask(String name)
This implementation does nothing.
|
void |
worked(int work)
This implementation does nothing.
|
public void beginTask(String name, int totalWork)
beginTask
in interface ProgressMonitor
name
- the name (or description) of the main tasktotalWork
- the total number of work units into which
the main task is been subdivided. If the value is UNKNOWN
the implementation is free to indicate progress in a way
which
doesn't require the total number of work units in advance.ProgressMonitor.beginTask(String, int)
public void done()
done
in interface ProgressMonitor
ProgressMonitor.done()
public void internalWorked(double work)
internalWorked
in interface ProgressMonitor
work
- the amount of work doneProgressMonitor.internalWorked(double)
public boolean isCanceled()
setCanceled
.
Subclasses which override this method should
override setCanceled
as well.isCanceled
in interface ProgressMonitor
true
if cancellation has been requested,
and false
otherwiseProgressMonitor.isCanceled()
,
ProgressMonitor.setCanceled(boolean)
public void setCanceled(boolean cancelled)
isCanceled
as well.setCanceled
in interface ProgressMonitor
cancelled
- true
indicates that cancelation has
been requested (but not necessarily acknowledged); false
clears this flagProgressMonitor.isCanceled()
,
ProgressMonitor.setCanceled(boolean)
public void setTaskName(String name)
setTaskName
in interface ProgressMonitor
name
- the name (or description) of the main taskProgressMonitor.setTaskName(String)
public void subTask(String name)
subTask
in interface ProgressMonitor
name
- the name (or description) of the subtaskProgressMonitor.subTask(String)
public void worked(int work)
worked
in interface ProgressMonitor
work
- the number of work units just completedProgressMonitor.worked(int)