net.sourceforge.java.util.jobs
Class CompositeJobProgressMonitor

java.lang.Object
  extended bynet.sourceforge.java.util.jobs.DefaultJobProgressMonitor
      extended bynet.sourceforge.java.util.jobs.CompositeJobProgressMonitor
All Implemented Interfaces:
IProgressMonitor

public class CompositeJobProgressMonitor
extends DefaultJobProgressMonitor

Reports the progress of a composite IJob, i.e. an IJob which is segemented into several single sub tasks.

Author:
Sebastian Machhausen

Field Summary
 
Fields inherited from class net.sourceforge.java.util.jobs.DefaultJobProgressMonitor
job, status, totalWork, workDone
 
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
 
Constructor Summary
CompositeJobProgressMonitor(IJob job)
           Creates a new CompositeJobProgressMonitor.
 
Method Summary
 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.
 
Methods inherited from class net.sourceforge.java.util.jobs.DefaultJobProgressMonitor
isCanceled, setCanceled, setTaskName, worked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeJobProgressMonitor

public CompositeJobProgressMonitor(IJob job)

Creates a new CompositeJobProgressMonitor.

Parameters:
job - the IJob for which to report the progress
Method Detail

beginTask

public void beginTask(String name,
                      int totalWork)

Notifies that the main task is beginning. This must only be called once on a given progress monitor instance.

Specified by:
beginTask in interface IProgressMonitor
Overrides:
beginTask in class DefaultJobProgressMonitor
Parameters:
name - the name (or description) of the main task
totalWork - 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.

done

public void done()

Notifies that the work is done; that is, either the main task is completed or the user canceled it. This method may be called more than once (implementations should be prepared to handle this case).

Specified by:
done in interface IProgressMonitor
Overrides:
done in class DefaultJobProgressMonitor

internalWorked

public void internalWorked(double work)

Internal method to handle scaling correctly. This method must not be called by a client. Clients should always use the method worked(int).

Specified by:
internalWorked in interface IProgressMonitor
Overrides:
internalWorked in class DefaultJobProgressMonitor
Parameters:
work - the amount of work done

subTask

public void subTask(String name)

Notifies that a subtask of the main task is beginning. Subtasks are optional; the main task might not have subtasks.

Specified by:
subTask in interface IProgressMonitor
Overrides:
subTask in class DefaultJobProgressMonitor
Parameters:
name - the name (or description) of the subtask