Updated progress bar to support Validation state

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@95294 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-02 08:47:59 +00:00 committed by Giancarlo Panichi
parent 950bc37cef
commit 5c677ea4db
16 changed files with 138 additions and 13 deletions

View File

@ -33,6 +33,7 @@ public class ChangeTableTypeProgressBarUpdater implements ChangeTableTypeProgres
/**
* {@inheritDoc}
*/
@Override
public void operationComplete(TRId trId) {
Log.info("Completed");
progressBar.updateProgress(1, "Completed");
@ -42,18 +43,21 @@ public class ChangeTableTypeProgressBarUpdater implements ChangeTableTypeProgres
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Failed");
progressBar.updateText("Failed");
}
@Override
public void operationInitializing() {
Log.info("Inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("Import elaborated: "+elaborated);
Log.info("Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
if (elaborated>0 && elaborated<1) {
Log.trace("progress "+elaborated);
@ -64,7 +68,18 @@ public class ChangeTableTypeProgressBarUpdater implements ChangeTableTypeProgres
}
@Override
public void operationValidate(float elaborated) {
Log.info("Validation Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Start Validation...");
if (elaborated>0 && elaborated<1) {
Log.trace("Validation progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% Validation Progress...");
}
if (elaborated == 1) progressBar.updateProgress(1, "Validation...");
}
@Override
public void operationStopped(TRId trId,String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");

View File

@ -134,4 +134,10 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -27,6 +27,11 @@ public interface ChangeTableTypeProgressListener {
*/
public void operationUpdate(float elaborated);
/**
* Called when there is a validate for the operation.
* @param elaborated the elaborated part.
*/
public void operationValidate(float elaborated);
/**
* Called when the operation is complete.

View File

@ -59,7 +59,7 @@ public class ChangeTableTypeProgressUpdater extends Timer {
fireOperationUpdate(result.getProgress());
break;
case VALIDATING_RULES:
fireOperationUpdate(result.getProgress());
fireOperationValidate(result.getProgress());
break;
case GENERATING_VIEW:
Log.info("Generating View...");
@ -148,6 +148,11 @@ public class ChangeTableTypeProgressUpdater extends Timer {
for (ChangeTableTypeProgressListener listener : listeners)
listener.operationUpdate(elaborated);
}
protected void fireOperationValidate(float elaborated) {
for (ChangeTableTypeProgressListener listener : listeners)
listener.operationValidate(elaborated);
}
protected void fireOperationComplete(TRId trId) {
for (ChangeTableTypeProgressListener listener : listeners)

View File

@ -33,6 +33,7 @@ public class DeleteRowsProgressBarUpdater implements DeleteRowsProgressListener
/**
* {@inheritDoc}
*/
@Override
public void operationComplete(TRId trId) {
Log.info("Completed");
progressBar.updateProgress(1, "Completed");
@ -42,16 +43,19 @@ public class DeleteRowsProgressBarUpdater implements DeleteRowsProgressListener
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Failed");
progressBar.updateText("Failed");
}
@Override
public void operationInitializing() {
Log.info("Inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
@ -63,7 +67,18 @@ public class DeleteRowsProgressBarUpdater implements DeleteRowsProgressListener
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
}
@Override
public void operationValidate(float elaborated) {
Log.info("Validation Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Start Validation...");
if (elaborated>0 && elaborated<1) {
Log.trace("Validation progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% Validation Progress...");
}
if (elaborated == 1) progressBar.updateProgress(1, "Validation...");
}
@Override
public void operationStopped(TRId trId,String reason, String details) {

View File

@ -135,4 +135,10 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -27,6 +27,11 @@ public interface DeleteRowsProgressListener {
*/
public void operationUpdate(float elaborated);
/**
* Called when there is a validate for the operation.
* @param elaborated the elaborated part.
*/
public void operationValidate(float elaborated);
/**
* Called when the operation is complete.

View File

@ -59,7 +59,7 @@ public class DeleteRowsProgressUpdater extends Timer {
fireOperationUpdate(result.getProgress());
break;
case VALIDATING_RULES:
fireOperationUpdate(result.getProgress());
fireOperationValidate(result.getProgress());
break;
case GENERATING_VIEW:
Log.info("Generating View...");
@ -148,6 +148,11 @@ public class DeleteRowsProgressUpdater extends Timer {
for (DeleteRowsProgressListener listener : listeners)
listener.operationUpdate(elaborated);
}
protected void fireOperationValidate(float elaborated) {
for (DeleteRowsProgressListener listener : listeners)
listener.operationValidate(elaborated);
}
protected void fireOperationComplete(TRId trId) {
for (DeleteRowsProgressListener listener : listeners)

View File

@ -33,6 +33,7 @@ public class DuplicatesRowsProgressBarUpdater implements DuplicatesRowsProgressL
/**
* {@inheritDoc}
*/
@Override
public void operationComplete(TRId trId) {
Log.info("Completed");
progressBar.updateProgress(1, "Completed");
@ -42,16 +43,19 @@ public class DuplicatesRowsProgressBarUpdater implements DuplicatesRowsProgressL
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Failed");
progressBar.updateText("Failed");
}
@Override
public void operationInitializing() {
Log.info("Inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
@ -63,7 +67,18 @@ public class DuplicatesRowsProgressBarUpdater implements DuplicatesRowsProgressL
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
}
@Override
public void operationValidate(float elaborated) {
Log.info("Validation Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Start Validation...");
if (elaborated>0 && elaborated<1) {
Log.trace("Validation progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% Validation Progress...");
}
if (elaborated == 1) progressBar.updateProgress(1, "Validation...");
}
@Override
public void operationStopped(TRId trId,String reason, String details) {

View File

@ -133,4 +133,10 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -27,6 +27,11 @@ public interface DuplicatesRowsProgressListener {
*/
public void operationUpdate(float elaborated);
/**
* Called when there is a validate for the operation.
* @param elaborated the elaborated part.
*/
public void operationValidate(float elaborated);
/**
* Called when the operation is complete.

View File

@ -59,7 +59,7 @@ public class DuplicatesRowsProgressUpdater extends Timer {
fireOperationUpdate(result.getProgress());
break;
case VALIDATING_RULES:
fireOperationUpdate(result.getProgress());
fireOperationValidate(result.getProgress());
break;
case GENERATING_VIEW:
Log.info("Generating View...");
@ -148,6 +148,11 @@ public class DuplicatesRowsProgressUpdater extends Timer {
for (DuplicatesRowsProgressListener listener : listeners)
listener.operationUpdate(elaborated);
}
protected void fireOperationValidate(float elaborated) {
for (DuplicatesRowsProgressListener listener : listeners)
listener.operationValidate(elaborated);
}
protected void fireOperationComplete(TRId trId) {
for (DuplicatesRowsProgressListener listener : listeners)

View File

@ -33,6 +33,7 @@ public class RollBackProgressBarUpdater implements RollBackProgressListener {
/**
* {@inheritDoc}
*/
@Override
public void operationComplete(TRId trId) {
Log.info("Completed");
progressBar.updateProgress(1, "Completed");
@ -42,16 +43,19 @@ public class RollBackProgressBarUpdater implements RollBackProgressListener {
/**
* {@inheritDoc}
*/
@Override
public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Failed");
progressBar.updateText("Failed");
}
@Override
public void operationInitializing() {
Log.info("Inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void operationUpdate(float elaborated) {
Log.info("Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
@ -63,6 +67,18 @@ public class RollBackProgressBarUpdater implements RollBackProgressListener {
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
}
@Override
public void operationValidate(float elaborated) {
Log.info("Validation Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Start Validation...");
if (elaborated>0 && elaborated<1) {
Log.trace("Validation progress "+elaborated);
int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% Validation Progress...");
}
if (elaborated == 1) progressBar.updateProgress(1, "Validation...");
}
@Override

View File

@ -132,4 +132,10 @@ public class RollBackProgressDialog extends Window implements RollBackProgressLi
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -27,6 +27,11 @@ public interface RollBackProgressListener {
*/
public void operationUpdate(float elaborated);
/**
* Called when there is a validate for the operation.
* @param elaborated the elaborated part.
*/
public void operationValidate(float elaborated);
/**
* Called when the operation is complete.

View File

@ -59,7 +59,7 @@ public class RollBackProgressUpdater extends Timer {
fireOperationUpdate(result.getProgress());
break;
case VALIDATING_RULES:
fireOperationUpdate(result.getProgress());
fireOperationValidate(result.getProgress());
break;
case GENERATING_VIEW:
Log.info("Generating View...");
@ -148,6 +148,11 @@ public class RollBackProgressUpdater extends Timer {
for (RollBackProgressListener listener : listeners)
listener.operationUpdate(elaborated);
}
protected void fireOperationValidate(float elaborated) {
for (RollBackProgressListener listener : listeners)
listener.operationValidate(elaborated);
}
protected void fireOperationComplete(TRId trId) {
for (RollBackProgressListener listener : listeners)