g-Eclipse
Release 1.0.0

eu.geclipse.core.util
Class MasterMonitor

java.lang.Object
  extended by eu.geclipse.core.util.MasterMonitor

public class MasterMonitor
extends java.lang.Object

This class serves as a container for a bunch of monitors. If an operation needs to be monitored by multiple monitors these monitors can be specified as slaves of the master monitor and the master monitor can be provided as single access point to the operation. Any operation on the master monitor will be forwarded to the slaves. A master monitor is thought to be canceled if any of its slaves was canceled.


Constructor Summary
MasterMonitor()
          Create a new master monitor without slaves.
MasterMonitor(IProgressMonitor slave)
          Create a new master monitor with one slave.
MasterMonitor(IProgressMonitor slave1, IProgressMonitor slave2)
          Create a new master monitor with two slaves.
 
Method Summary
 void addSlave(IProgressMonitor slave)
          Add a slave to this master monitor.
 void beginTask(java.lang.String name, int totalWork)
           
 void done()
           
 void internalWorked(double work)
           
 boolean isCanceled()
           
 void setCanceled(boolean value)
           
 void setTaskName(java.lang.String name)
           
 void subTask(java.lang.String name)
           
 void worked(int work)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterMonitor

public MasterMonitor()
Create a new master monitor without slaves.


MasterMonitor

public MasterMonitor(IProgressMonitor slave)
Create a new master monitor with one slave. The slave can also be null which makes NullProgressMonitors obsolete.

Parameters:
slave - The slave of this monitor.

MasterMonitor

public MasterMonitor(IProgressMonitor slave1,
                     IProgressMonitor slave2)
Create a new master monitor with two slaves.

Parameters:
slave1 - The first slave.
slave2 - The second slave.
Method Detail

addSlave

public void addSlave(IProgressMonitor slave)
Add a slave to this master monitor. This method should not be called after any operation was performed on the monitor. Especially when called after beginTask(String, int) the result of adding a new slave is not predicted.

Parameters:
slave - The new slave to be added.

beginTask

public void beginTask(java.lang.String name,
                      int totalWork)

done

public void done()

internalWorked

public void internalWorked(double work)

isCanceled

public boolean isCanceled()

setCanceled

public void setCanceled(boolean value)

setTaskName

public void setTaskName(java.lang.String name)

subTask

public void subTask(java.lang.String name)

worked

public void worked(int work)

g-Eclipse
Release 1.0.0