Updated progress bar to support Validation state
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@95290 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
756211e766
commit
51daddeefe
|
@ -194,4 +194,10 @@ public class CSVOperationInProgressCard extends WizardCard implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationValidate(float elaborated) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class CSVImportProgressBarUpdater implements CSVImportProgressListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationUpdate(float elaborated) {
|
public void operationUpdate(float elaborated) {
|
||||||
Log.info("Import elaborated: "+elaborated);
|
Log.info("Elaborated: "+elaborated);
|
||||||
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
|
if (elaborated == 0) progressBar.updateProgress(0, "Initializing...");
|
||||||
if (elaborated>0 && elaborated<1) {
|
if (elaborated>0 && elaborated<1) {
|
||||||
Log.trace("progress "+elaborated);
|
Log.trace("progress "+elaborated);
|
||||||
|
@ -70,6 +70,18 @@ public class CSVImportProgressBarUpdater implements CSVImportProgressListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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
|
@Override
|
||||||
public void operationStopped(TRId trId,String reason, String details) {
|
public void operationStopped(TRId trId,String reason, String details) {
|
||||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||||
|
|
|
@ -27,6 +27,12 @@ public interface CSVImportProgressListener {
|
||||||
*/
|
*/
|
||||||
public void operationUpdate(float elaborated);
|
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.
|
* Called when the operation is complete.
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class CSVImportProgressUpdater extends Timer {
|
||||||
fireOperationUpdate(result.getProgress());
|
fireOperationUpdate(result.getProgress());
|
||||||
break;
|
break;
|
||||||
case VALIDATING_RULES:
|
case VALIDATING_RULES:
|
||||||
fireOperationUpdate(result.getProgress());
|
fireOperationValidate(result.getProgress());
|
||||||
break;
|
break;
|
||||||
case GENERATING_VIEW:
|
case GENERATING_VIEW:
|
||||||
Log.info("Generating View...");
|
Log.info("Generating View...");
|
||||||
|
@ -147,6 +147,11 @@ public class CSVImportProgressUpdater extends Timer {
|
||||||
for (CSVImportProgressListener listener : listeners)
|
for (CSVImportProgressListener listener : listeners)
|
||||||
listener.operationUpdate(elaborated);
|
listener.operationUpdate(elaborated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void fireOperationValidate(float elaborated) {
|
||||||
|
for (CSVImportProgressListener listener : listeners)
|
||||||
|
listener.operationValidate(elaborated);
|
||||||
|
}
|
||||||
|
|
||||||
protected void fireOperationComplete(TRId trId) {
|
protected void fireOperationComplete(TRId trId) {
|
||||||
for (CSVImportProgressListener listener : listeners)
|
for (CSVImportProgressListener listener : listeners)
|
||||||
|
|
Loading…
Reference in New Issue