org.ow2.clif.console.lib.egui.editor
Class CollectProgressDialog

java.lang.Object
  extended by org.ow2.clif.console.lib.egui.editor.CollectProgressDialog
All Implemented Interfaces:
org.eclipse.jface.operation.IRunnableWithProgress, CollectListener

public class CollectProgressDialog
extends java.lang.Object
implements CollectListener, org.eclipse.jface.operation.IRunnableWithProgress

Progress monitor while collecting results

Author:
Joan Chaumont

Field Summary
protected  long bladesize
           
protected  boolean canceled
           
protected  ClifAppFacade clifApp
           
protected  boolean completed
           
protected  long fullsize
           
protected  org.eclipse.core.runtime.IProgressMonitor monitor
           
protected  long progress
           
 
Constructor Summary
CollectProgressDialog(org.eclipse.swt.widgets.Shell shell, ClifAppFacade clifApp, java.lang.String[] bladesId)
          Constructor
 
Method Summary
 void bladeCollectStart(java.lang.String bladeId, long size)
          Called before collecting test results from a blade.
 void collectStart(java.lang.String testId, long size)
          Called at the collect beginning.
 void done()
          Called when the full collect is complete.
 void go()
          Run the ProgressMonitorDialog
 boolean isCanceled()
          Called an arbitrarily number of times at arbitrary moments during a collect to ensure the collect must go on or be canceled.
 boolean isCanceled(java.lang.String bladeId)
          Called an arbitrarily number of times at arbitrary moments during a collect to ensure the collect must go on or be canceled for the given blade.
 void progress(java.lang.String bladeId, long done)
          Called an arbitrary number of times when collecting test results from a blade to give current progress
 void run(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monitor

protected org.eclipse.core.runtime.IProgressMonitor monitor

completed

protected boolean completed

canceled

protected boolean canceled

fullsize

protected long fullsize

bladesize

protected long bladesize

progress

protected long progress

clifApp

protected ClifAppFacade clifApp
Constructor Detail

CollectProgressDialog

public CollectProgressDialog(org.eclipse.swt.widgets.Shell shell,
                             ClifAppFacade clifApp,
                             java.lang.String[] bladesId)
Constructor

Parameters:
shell - parent shell
clifApp - clifApp used by this test
bladesId - blades id to collect
Method Detail

go

public void go()
Run the ProgressMonitorDialog


run

public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
         throws java.lang.InterruptedException
Specified by:
run in interface org.eclipse.jface.operation.IRunnableWithProgress
Throws:
java.lang.InterruptedException

collectStart

public void collectStart(java.lang.String testId,
                         long size)
Description copied from interface: CollectListener
Called at the collect beginning.

Specified by:
collectStart in interface CollectListener
Parameters:
testId - the identifier of the test to be collected
size - the total number of bytes to be collected

bladeCollectStart

public void bladeCollectStart(java.lang.String bladeId,
                              long size)
Description copied from interface: CollectListener
Called before collecting test results from a blade.

Specified by:
bladeCollectStart in interface CollectListener
Parameters:
bladeId - the identifier of the blade about to be collected
size - the total number of bytes to collect from the given blade

progress

public void progress(java.lang.String bladeId,
                     long done)
Description copied from interface: CollectListener
Called an arbitrary number of times when collecting test results from a blade to give current progress

Specified by:
progress in interface CollectListener
Parameters:
bladeId - the identifier of the blade test results are being collected from
done - number of bytes already collected (cannot decrease, nor be greater then the size given in the preliminary bladeCollectStart call)

done

public void done()
Description copied from interface: CollectListener
Called when the full collect is complete.

Specified by:
done in interface CollectListener

isCanceled

public boolean isCanceled()
Description copied from interface: CollectListener
Called an arbitrarily number of times at arbitrary moments during a collect to ensure the collect must go on or be canceled.

Specified by:
isCanceled in interface CollectListener
Returns:
true if the full collect must be canceled, false to go on.

isCanceled

public boolean isCanceled(java.lang.String bladeId)
Description copied from interface: CollectListener
Called an arbitrarily number of times at arbitrary moments during a collect to ensure the collect must go on or be canceled for the given blade.

Specified by:
isCanceled in interface CollectListener
Parameters:
bladeId - the identifier of the considered blade
Returns:
true if the full collect must be canceled for the given blade, false to go on.