Package com.bc.ceres.core
Class ProgressMonitorWrapper
- java.lang.Object
-
- com.bc.ceres.core.ProgressMonitorWrapper
-
- All Implemented Interfaces:
ProgressMonitor
- Direct Known Subclasses:
SubProgressMonitor
public abstract class ProgressMonitorWrapper extends Object implements ProgressMonitor
An abstract wrapper around a progress monitor which, unless overridden, forwardsIProgressMonitor
andIProgressMonitorWithBlocking
methods to the wrapped progress monitor.Clients may subclass.
This class has been more or less directly taken over from the Eclipse Core API.
-
-
Field Summary
-
Fields inherited from interface com.bc.ceres.core.ProgressMonitor
NULL, UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProgressMonitorWrapper(ProgressMonitor monitor)
Creates a new wrapper around the given monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTask(String taskName, int totalWork)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.void
done()
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.ProgressMonitor
getWrappedProgressMonitor()
Returns the wrapped progress monitor.void
internalWorked(double work)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.boolean
isCanceled()
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.void
setCanceled(boolean canceled)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.void
setSubTaskName(String subTaskName)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.void
setTaskName(String taskName)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.void
worked(int work)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor.
-
-
-
Constructor Detail
-
ProgressMonitorWrapper
protected ProgressMonitorWrapper(ProgressMonitor monitor)
Creates a new wrapper around the given monitor.- Parameters:
monitor
- the progress monitor to forward to
-
-
Method Detail
-
beginTask
public void beginTask(String taskName, int totalWork)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
beginTask
in interfaceProgressMonitor
- Parameters:
taskName
- 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 isUNKNOWN
the implementation is free to indicate progress in a way which doesn't require the total number of work units in advance.- See Also:
ProgressMonitor.beginTask(String, int)
-
done
public void done()
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
done
in interfaceProgressMonitor
- See Also:
ProgressMonitor.done()
-
getWrappedProgressMonitor
public ProgressMonitor getWrappedProgressMonitor()
Returns the wrapped progress monitor.- Returns:
- the wrapped progress monitor
-
internalWorked
public void internalWorked(double work)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
internalWorked
in interfaceProgressMonitor
- Parameters:
work
- the amount of work done- See Also:
ProgressMonitor.internalWorked(double)
-
isCanceled
public boolean isCanceled()
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
isCanceled
in interfaceProgressMonitor
- Returns:
true
if cancellation has been requested, andfalse
otherwise- See Also:
ProgressMonitor.isCanceled()
-
setCanceled
public void setCanceled(boolean canceled)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
setCanceled
in interfaceProgressMonitor
- Parameters:
canceled
-true
indicates that cancelation has been requested (but not necessarily acknowledged);false
clears this flag- See Also:
ProgressMonitor.setCanceled(boolean)
-
setTaskName
public void setTaskName(String taskName)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
setTaskName
in interfaceProgressMonitor
- Parameters:
taskName
- the name (or description) of the main task- See Also:
ProgressMonitor.setTaskName(String)
-
setSubTaskName
public void setSubTaskName(String subTaskName)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
setSubTaskName
in interfaceProgressMonitor
- Parameters:
subTaskName
- the name (or description) of the subtask- See Also:
ProgressMonitor.setSubTaskName(String)
-
worked
public void worked(int work)
This implementation of aProgressMonitor
method forwards to the wrapped progress monitor. Clients may override this method to do additional processing.- Specified by:
worked
in interfaceProgressMonitor
- Parameters:
work
- the number of work units just completed- See Also:
ProgressMonitor.worked(int)
-
-