public class SubProgressMonitor extends ProgressMonitorWrapper
This class may be instantiated or subclassed by clients.
Modifier and Type | Field and Description |
---|---|
static int |
PREPEND_MAIN_LABEL_TO_SUBTASK
Style constant indicating that the main task label
should be prepended to the subtask label.
|
static int |
SUPPRESS_SUBTASK_LABEL
Style constant indicating that calls to
subTask should not have any effect. |
UNKNOWN
Constructor and Description |
---|
SubProgressMonitor(ProgressMonitor monitor,
int ticks)
Creates a new sub-progress monitor for the given monitor.
|
SubProgressMonitor(ProgressMonitor monitor,
int ticks,
int style)
Creates a new sub-progress monitor for the given monitor.
|
Modifier and Type | Method and Description |
---|---|
void |
beginTask(String name,
int totalWork)
Notifies that the main task is beginning.
|
void |
done()
Notifies that the work is done; that is, either the main task is completed
or the user canceled it.
|
void |
internalWorked(double work)
Internal method to handle scaling correctly.
|
void |
subTask(String name)
Notifies that a subtask of the main task is beginning.
|
void |
worked(int work)
Notifies that a given number of work unit of the main task
has been completed.
|
getWrappedProgressMonitor, isCanceled, setCanceled, setTaskName
public static final int SUPPRESS_SUBTASK_LABEL
subTask
should not have any effect.public static final int PREPEND_MAIN_LABEL_TO_SUBTASK
public SubProgressMonitor(ProgressMonitor monitor, int ticks)
monitor
- the parent progress monitorticks
- the number of work ticks allocated from the parent monitorpublic SubProgressMonitor(ProgressMonitor monitor, int ticks, int style)
monitor
- the parent progress monitorticks
- the number of work ticks allocated from the parent monitorstyle
- one of
SUPPRESS_SUBTASK_LABEL
PREPEND_MAIN_LABEL_TO_SUBTASK
SUPPRESS_SUBTASK_LABEL
,
PREPEND_MAIN_LABEL_TO_SUBTASK
public void beginTask(String name, int totalWork)
ProgressMonitor
beginTask
in interface ProgressMonitor
beginTask
in class ProgressMonitorWrapper
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.public void done()
ProgressMonitor
done
in interface ProgressMonitor
done
in class ProgressMonitorWrapper
public void internalWorked(double work)
ProgressMonitor
worked(int)
.internalWorked
in interface ProgressMonitor
internalWorked
in class ProgressMonitorWrapper
work
- the amount of work donepublic void subTask(String name)
ProgressMonitor
subTask
in interface ProgressMonitor
subTask
in class ProgressMonitorWrapper
name
- the name (or description) of the subtaskpublic void worked(int work)
ProgressMonitor
worked
in interface ProgressMonitor
worked
in class ProgressMonitorWrapper
work
- the number of work units just completed