Package com.iizigo.prop
Class PropProgressMonitorAdapter
- java.lang.Object
- com.iizigo.prop.PropProgressMonitorAdapter
 
- All Implemented Interfaces:
- IPropProgressMonitor
 - Direct Known Subclasses:
- NullPropProgressMonitor
 - public class PropProgressMonitorAdapter extends java.lang.Object implements IPropProgressMonitor Adapts the Eclipse IProgressMonitor to the "property-based" progress monitor.- Author:
- Christopher Mindus
 
- Field Summary- Fields inherited from interface com.iizix.IPropProgressMonitor- NULL
 
 - Constructor Summary- Constructors - Constructor - Description - PropProgressMonitorAdapter(org.eclipse.core.runtime.IProgressMonitor monitor, java.lang.String taskName, int totalWork)Constructor to adapt IProgressMonitor.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - void- beginTask(java.lang.String name, int totalWork)Notifies that the main task is beginning.- void- cancel()Cancels the progress monitor.- void- done()Notifies that the work is done; that is, either the main task is completed or the user canceled it.- java.lang.Object- getProgressMonitor()Gets the org.eclipse.core.runtime.IProgressMonitor instance.- boolean- isCanceled()Returns whether cancellation of current operation has been requested.- PropProgressMonitorAdapter- newSubMonitor(int work)Creates a new sub monitor taking up a number of work.- void- setTaskName(java.lang.String name)Sets the task name to the given value.- void- setWorked(int worked)Set worked value.- void- setWorkRemaining(int workRemaining)Set worked remaining.- void- worked(int work)Notifies that a given number of work unit of the main task has been completed.
 
- Constructor Detail- PropProgressMonitorAdapter- public PropProgressMonitorAdapter(org.eclipse.core.runtime.IProgressMonitor monitor, java.lang.String taskName, int totalWork)Constructor to adapt IProgressMonitor.- Parameters:
- monitor- The monitor to adapt.
- taskName- The task name.
- totalWork- The amount of work in the new submonitor.
 
 
 - Method Detail- beginTask- public void beginTask(java.lang.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:
- beginTaskin interface- IPropProgressMonitor
- 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- UNKNOWNthe implementation is free to indicate progress in a way which doesn't require the total number of work units in advance.
 
 - setTaskName- public void setTaskName(java.lang.String name) Sets the task name to the given value. This method is used to restore the task label after a nested operation was executed. Normally there is no need for clients to call this method.- Specified by:
- setTaskNamein interface- IPropProgressMonitor
- Parameters:
- name- the name (or description) of the main task.
- See Also:
- beginTask(java.lang.String, int)
 
 - worked- public void worked(int work) Notifies that a given number of work unit of the main task has been completed. Note that this amount represents an installment, as opposed to a cumulative amount of work done to date.- Specified by:
- workedin interface- IPropProgressMonitor
- Parameters:
- work- a non-negative number of work units just completed
 
 - setWorked- public void setWorked(int worked) Set worked value.- Specified by:
- setWorkedin interface- IPropProgressMonitor
- Parameters:
- worked- The work value.
 
 - setWorkRemaining- public void setWorkRemaining(int workRemaining) Set worked remaining.- Specified by:
- setWorkRemainingin interface- IPropProgressMonitor
- Parameters:
- workRemaining- The remaining work value, must be between zero and totalWork.
 
 - 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:
- donein interface- IPropProgressMonitor
 
 - isCanceled- public boolean isCanceled() Returns whether cancellation of current operation has been requested. Long-running operations should poll to see if cancellation has been requested.- Specified by:
- isCanceledin interface- IPropProgressMonitor
- Returns:
- trueif cancellation has been requested, and- falseotherwise.
 
 - cancel- public void cancel() Cancels the progress monitor.- Specified by:
- cancelin interface- IPropProgressMonitor
 
 - getProgressMonitor- public java.lang.Object getProgressMonitor() Gets the org.eclipse.core.runtime.IProgressMonitor instance.- Specified by:
- getProgressMonitorin interface- IPropProgressMonitor
- Returns:
- An object that is castable to org.eclipse.core.runtime.IProgressMonitor.
 
 - newSubMonitor- public PropProgressMonitorAdapter newSubMonitor(int work) Creates a new sub monitor taking up a number of work.- Specified by:
- newSubMonitorin interface- IPropProgressMonitor
- Parameters:
- work- A non-negative number of work units that the new sub monitor will tick off.
- Returns:
- A new submonitor.