Updated progress bar to support Validation state

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-import-widget@95293 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-02 08:35:50 +00:00 committed by Giancarlo Panichi
parent 92bfc6e8c7
commit a2445f9ab6
4 changed files with 31 additions and 2 deletions

View File

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

View File

@ -61,7 +61,7 @@ public class ImportProgressBarUpdater implements OperationProgressListener {
@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);
@ -72,6 +72,18 @@ public class ImportProgressBarUpdater implements OperationProgressListener {
}
@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

@ -27,6 +27,12 @@ public interface OperationProgressListener {
*/
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

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