Updated on stop of the tasks
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@92507 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
36340e70bc
commit
61d7e8b579
|
@ -63,5 +63,12 @@ public class ColumnFilterProgressBarUpdater implements ColumnFilterProgressListe
|
|||
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
progressBar.updateText("Stopped");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -126,4 +126,11 @@ public class ColumnFilterProgressDialog extends Window implements ColumnFilterPr
|
|||
dialog.hide();
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operationStopped(TRId trId,String reason, String details) {
|
||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
||||
ok.setVisible(true);
|
||||
this.trId=trId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,15 @@ public interface ColumnFilterProgressListener {
|
|||
* @param reason the failure reason.
|
||||
*/
|
||||
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
||||
|
||||
/**
|
||||
* Called when the operation is stopped
|
||||
*
|
||||
* @param trId
|
||||
* @param reason
|
||||
* @param details
|
||||
*/
|
||||
public void operationStopped(TRId trId, String reason, String details);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ColumnFilterProgressUpdater extends Timer {
|
|||
break;
|
||||
case STOPPED:
|
||||
cancel();
|
||||
errorMessage(result);
|
||||
stopMessage(result);
|
||||
break;
|
||||
case FAILED:
|
||||
cancel();
|
||||
|
@ -106,6 +106,22 @@ public class ColumnFilterProgressUpdater extends Timer {
|
|||
|
||||
fireOperationFailed(th, failure, details);
|
||||
}
|
||||
|
||||
protected void stopMessage(ColumnFilterMonitor result) {
|
||||
Log.info("Apply column filter Stopped");
|
||||
String failure = null;
|
||||
String details = null;
|
||||
if (result.getError() != null) {
|
||||
failure = "Stopped";
|
||||
details = result.getError().getLocalizedMessage();
|
||||
} else {
|
||||
failure = "Stopped";
|
||||
details = "Stopped applying the column filter ";
|
||||
}
|
||||
|
||||
fireOperationStopped(result.getTrId(),failure, details);
|
||||
}
|
||||
|
||||
|
||||
protected String getStack(Throwable e) {
|
||||
String message = e.getLocalizedMessage() + " -> <br>";
|
||||
|
@ -136,6 +152,10 @@ public class ColumnFilterProgressUpdater extends Timer {
|
|||
listener.operationFailed(caught, failure, failureDetails);
|
||||
}
|
||||
|
||||
protected void fireOperationStopped(TRId trId, String reason, String details) {
|
||||
for (ColumnFilterProgressListener listener : listeners)
|
||||
listener.operationStopped(trId,reason, details);
|
||||
}
|
||||
/**
|
||||
* Add a new {@link ColumnFilterProgressListener} to this
|
||||
* {@link ColumnFilterProgressUpdater}.
|
||||
|
@ -157,4 +177,6 @@ public class ColumnFilterProgressUpdater extends Timer {
|
|||
public void removeListener(ColumnFilterProgressListener listener) {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue