Updated progress bar to support Validation state

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-export-widget@95292 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-02 08:33:22 +00:00 committed by Giancarlo Panichi
parent 8809fcc18a
commit 1d4b073834
4 changed files with 30 additions and 3 deletions

View File

@ -206,4 +206,10 @@ public class SDMXOperationInProgressCard extends WizardCard implements
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -59,7 +59,7 @@ public class SDMXExportProgressBarUpdater implements SDMXExportProgressListener
@Override
public void operationUpdate(float elaborated) {
Log.info("Export elaborated: "+elaborated);
Log.info("Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
if (elaborated>0 && elaborated<1) {
Log.trace("progress "+elaborated);
@ -70,6 +70,18 @@ public class SDMXExportProgressBarUpdater implements SDMXExportProgressListener
}
@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

@ -28,6 +28,11 @@ public interface SDMXExportProgressListener {
*/
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,8 +59,7 @@ public class SDMXExportProgressUpdater extends Timer {
fireOperationUpdate(result.getProgress());
break;
case VALIDATING_RULES:
Log.info("Validating Rules...");
fireOperationUpdate(result.getProgress());
fireOperationValidate(result.getProgress());
break;
case GENERATING_VIEW:
Log.info("Generating View...");
@ -146,6 +145,11 @@ public class SDMXExportProgressUpdater extends Timer {
for (SDMXExportProgressListener listener : listeners)
listener.operationUpdate(elaborated);
}
protected void fireOperationValidate(float elaborated) {
for (SDMXExportProgressListener listener : listeners)
listener.operationValidate(elaborated);
}
protected void fireOperationComplete() {
for (SDMXExportProgressListener listener : listeners)