Package org.eclipse.core.runtime
Class ProgressMonitorWrapper
- java.lang.Object
-
- org.eclipse.core.runtime.ProgressMonitorWrapper
-
- All Implemented Interfaces:
IProgressMonitor,IProgressMonitorWithBlocking
- Direct Known Subclasses:
SubProgressMonitor
public abstract class ProgressMonitorWrapper extends Object implements IProgressMonitor, IProgressMonitorWithBlocking
An abstract wrapper around a progress monitor which, unless overridden, forwardsIProgressMonitorandIProgressMonitorWithBlockingmethods to the wrapped progress monitor.This class can be used without OSGi running.
Clients may subclass.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedProgressMonitorWrapper(IProgressMonitor monitor)Creates a new wrapper around the given monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginTask(String name, int totalWork)This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.voidclearBlocked()This implementation of aIProgressMonitorWithBlockingmethod forwards to the wrapped progress monitor.voiddone()This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.IProgressMonitorgetWrappedProgressMonitor()Returns the wrapped progress monitor.voidinternalWorked(double work)This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.booleanisCanceled()This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.voidsetBlocked(IStatus reason)This implementation of aIProgressMonitorWithBlockingmethod forwards to the wrapped progress monitor.voidsetCanceled(boolean b)This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.voidsetTaskName(String name)This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.voidsubTask(String name)This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.voidworked(int work)This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor.
-
-
-
Constructor Detail
-
ProgressMonitorWrapper
protected ProgressMonitorWrapper(IProgressMonitor monitor)
Creates a new wrapper around the given monitor.- Parameters:
monitor- the progress monitor to forward to
-
-
Method Detail
-
beginTask
public void beginTask(String name, int totalWork)
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
beginTaskin interfaceIProgressMonitor- Parameters:
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 isUNKNOWNthe implementation is free to indicate progress in a way which doesn't require the total number of work units in advance.- See Also:
IProgressMonitor.beginTask(String, int)
-
clearBlocked
public void clearBlocked()
This implementation of aIProgressMonitorWithBlockingmethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
clearBlockedin interfaceIProgressMonitorWithBlocking- Since:
- 3.0
- See Also:
IProgressMonitorWithBlocking.clearBlocked()
-
done
public void done()
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
donein interfaceIProgressMonitor- See Also:
IProgressMonitor.done()
-
getWrappedProgressMonitor
public IProgressMonitor getWrappedProgressMonitor()
Returns the wrapped progress monitor.- Returns:
- the wrapped progress monitor
-
internalWorked
public void internalWorked(double work)
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
internalWorkedin interfaceIProgressMonitor- Parameters:
work- the amount of work done- See Also:
IProgressMonitor.internalWorked(double)
-
isCanceled
public boolean isCanceled()
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
isCanceledin interfaceIProgressMonitor- Returns:
trueif cancellation has been requested, andfalseotherwise- See Also:
IProgressMonitor.isCanceled()
-
setBlocked
public void setBlocked(IStatus reason)
This implementation of aIProgressMonitorWithBlockingmethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
setBlockedin interfaceIProgressMonitorWithBlocking- Parameters:
reason- an optional status object whose message describes the reason why this operation is blocked, ornullif this information is not available.- Since:
- 3.0
- See Also:
IProgressMonitorWithBlocking.setBlocked(IStatus)
-
setCanceled
public void setCanceled(boolean b)
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
setCanceledin interfaceIProgressMonitor- Parameters:
b-trueindicates that cancelation has been requested (but not necessarily acknowledged);falseclears this flag- See Also:
IProgressMonitor.setCanceled(boolean)
-
setTaskName
public void setTaskName(String name)
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
setTaskNamein interfaceIProgressMonitor- Parameters:
name- the name (or description) of the main task- See Also:
IProgressMonitor.setTaskName(String)
-
subTask
public void subTask(String name)
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
subTaskin interfaceIProgressMonitor- Parameters:
name- the name (or description) of the subtask- See Also:
IProgressMonitor.subTask(String)
-
worked
public void worked(int work)
This implementation of aIProgressMonitormethod forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
workedin interfaceIProgressMonitor- Parameters:
work- a non-negative number of work units just completed- See Also:
IProgressMonitor.worked(int)
-
-