Typical use case is:
monitor.beginTask() try { .. do some work monitor.worked() monitor.subTask()/monitor.intermediateTask() .. do some work monitor.worked() } finally { monitor.finishTask(); }
{@link #subTask(String)} and {@link #indeterminateSubTask(String)} has nothing to do with logicalstructure of the work, they just show task title to the user. If task consists of multiple tasks then {@link #createSubTaskMonitor(int,boolean)} may be used. Itwill create new ProgressMonitor, then can be passed to the subtask. Subtask doesn't know whether it runs standalone or as a part of other task. Progressbar will be updated so that total progress is shown, not just progress of the subtask All ProgressMonitor implementations should be thread safe.