public class SubProgressMonitor extends ProgressMonitorWrapper
try {
pm.beginTask("Main Task", 100);
doSomeWork(pm, 30);
SubProgressMonitor subMonitor= SubProgressMonitor.create(pm, 40);
try {
subMonitor.beginTask("", 300);
doSomeWork(subMonitor, 300);
} finally {
subMonitor.done();
}
doSomeWork(pm, 30);
} finally {
pm.done();
}
This class may be instantiated or subclassed by clients.
This class has been more or less directly taken over from the Eclipse Core API.
| 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. |
NULL, 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 taskName,
int totalWork)
This implementation of a
ProgressMonitor
method forwards to the wrapped progress monitor. |
static ProgressMonitor |
create(ProgressMonitor monitor,
int ticks)
Creates a progress monitor based on the passed in parent monitor.
|
void |
done()
This implementation of a
ProgressMonitor
method forwards to the wrapped progress monitor. |
void |
internalWorked(double work)
This implementation of a
ProgressMonitor
method forwards to the wrapped progress monitor. |
void |
setSubTaskName(String subTaskName)
This implementation of a
ProgressMonitor
method forwards to the wrapped progress monitor. |
void |
worked(int work)
This implementation of a
ProgressMonitor
method forwards to the wrapped progress monitor. |
getWrappedProgressMonitor, isCanceled, setCanceled, setTaskNamepublic 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_SUBTASKpublic static ProgressMonitor create(ProgressMonitor monitor, int ticks)
ProgressMonitor.NULL,
monitor is returned, otherwise a new SubProgressMonitor is created.monitor - the parent progress monitorticks - the number of work ticks allocated from the
parent monitorpublic void beginTask(String taskName, int totalWork)
ProgressMonitorWrapperProgressMonitor
method forwards to the wrapped progress monitor.
Clients may override this method to do additional
processing.beginTask in interface ProgressMonitorbeginTask in class ProgressMonitorWrappertaskName - 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()
ProgressMonitorWrapperProgressMonitor
method forwards to the wrapped progress monitor.
Clients may override this method to do additional
processing.done in interface ProgressMonitordone in class ProgressMonitorWrapperProgressMonitor.done()public void internalWorked(double work)
ProgressMonitorWrapperProgressMonitor
method forwards to the wrapped progress monitor.
Clients may override this method to do additional
processing.internalWorked in interface ProgressMonitorinternalWorked in class ProgressMonitorWrapperwork - the amount of work doneProgressMonitor.internalWorked(double)public void setSubTaskName(String subTaskName)
ProgressMonitorWrapperProgressMonitor
method forwards to the wrapped progress monitor.
Clients may override this method to do additional
processing.setSubTaskName in interface ProgressMonitorsetSubTaskName in class ProgressMonitorWrappersubTaskName - the name (or description) of the subtaskProgressMonitor.setSubTaskName(String)public void worked(int work)
ProgressMonitorWrapperProgressMonitor
method forwards to the wrapped progress monitor.
Clients may override this method to do additional
processing.worked in interface ProgressMonitorworked in class ProgressMonitorWrapperwork - the number of work units just completedProgressMonitor.worked(int)Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.