Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-monitor-widget@99288 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-08-26 14:20:34 +00:00 committed by Giancarlo Panichi
parent 5b23c6c652
commit 09a8f53b73
4 changed files with 31 additions and 40 deletions

View File

@ -49,13 +49,14 @@ public class MonitorBarUpdater implements MonitorUpdaterListener {
}
@Override
public void monitorInitializing() {
public void monitorInitializing(OperationMonitor operationMonitor) {
Log.info("Inizializing");
progressBar.updateProgress(0, "Initializing...");
}
@Override
public void monitorUpdate(float elaborated) {
public void monitorUpdate(OperationMonitor operationMonitor) {
float elaborated=operationMonitor.getTask().getProgress();
Log.info("Elaborated: "+elaborated);
if (elaborated>=0 && elaborated<1) {
Log.trace("progress "+elaborated);
@ -67,7 +68,8 @@ public class MonitorBarUpdater implements MonitorUpdaterListener {
}
@Override
public void monitorValidate(float elaborated) {
public void monitorValidate(OperationMonitor operationMonitor) {
float elaborated=operationMonitor.getTask().getProgress();
Log.info("Validation Elaborated: "+elaborated);
if (elaborated == 0) progressBar.updateProgress(0, "Start Validation...");
if (elaborated>0 && elaborated<1) {
@ -86,18 +88,14 @@ public class MonitorBarUpdater implements MonitorUpdaterListener {
}
@Override
public void monitorGeneratingView() {
public void monitorGeneratingView(OperationMonitor operationMonitor) {
Log.info("Generating View...");
progressBar.updateText("Generating View...");
}
@Override
public void monitorChanged(OperationMonitor operationMonitor) {
// TODO Auto-generated method stub
}
@Override

View File

@ -103,13 +103,13 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
}
@Override
public void monitorInitializing() {
public void monitorInitializing(OperationMonitor result) {
// TODO Auto-generated method stub
}
@Override
public void monitorUpdate(float elaborated) {
public void monitorUpdate(OperationMonitor operationMonitor) {
// TODO Auto-generated method stub
}
@ -154,22 +154,18 @@ public class MonitorDialog extends Window implements MonitorUpdaterListener {
}
@Override
public void monitorGeneratingView() {
public void monitorGeneratingView(OperationMonitor operationMonitor) {
// TODO Auto-generated method stub
}
@Override
public void monitorValidate(float elaborated) {
public void monitorValidate(OperationMonitor operationMonitor) {
// TODO Auto-generated method stub
}
@Override
public void monitorChanged(OperationMonitor operationMonitor) {
// TODO Auto-generated method stub
}
@Override
public void monitorAborted() {

View File

@ -61,7 +61,7 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
switch (result.getTask().getState()) {
case INITIALIZING:
Log.info("Initializing...");
fireMonitorInitializing();
fireMonitorInitializing(result);
break;
case ABORTED:
cancel();
@ -69,14 +69,15 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
Log.info("Aborted");
break;
case IN_PROGRESS:
fireMonitorUpdate(result.getTask().getProgress());
fireMonitorUpdate(result);
break;
case VALIDATING_RULES:
fireMonitorValidate(result.getTask().getProgress());
fireMonitorValidate(result);
break;
case GENERATING_VIEW:
Log.info("Generating View...");
fireMonitorGeneratingView();
fireMonitorGeneratingView(result);
break;
case STOPPED:
cancel();
@ -105,6 +106,7 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
}
protected void errorMessage(OperationMonitor result) {
Log.info("Operation Failed");
Throwable th;
@ -147,24 +149,24 @@ public class MonitorUpdater extends Timer implements MonitorDialogEventUIListene
return message;
}
protected void fireMonitorInitializing() {
protected void fireMonitorInitializing(OperationMonitor result) {
for (MonitorUpdaterListener listener : listeners)
listener.monitorInitializing();
listener.monitorInitializing(result);
}
protected void fireMonitorGeneratingView() {
protected void fireMonitorGeneratingView(OperationMonitor result) {
for (MonitorUpdaterListener listener : listeners)
listener.monitorGeneratingView();
listener.monitorGeneratingView(result);
}
protected void fireMonitorUpdate(float elaborated) {
protected void fireMonitorUpdate(OperationMonitor result) {
for (MonitorUpdaterListener listener : listeners)
listener.monitorUpdate(elaborated);
listener.monitorUpdate(result);
}
protected void fireMonitorValidate(float elaborated) {
protected void fireMonitorValidate(OperationMonitor result) {
for (MonitorUpdaterListener listener : listeners)
listener.monitorValidate(elaborated);
listener.monitorValidate(result);
}
protected void fireMonitorComplete(TRId trId) {

View File

@ -18,19 +18,19 @@ public interface MonitorUpdaterListener {
/**
* Called when the operation is starting.
*/
public void monitorInitializing();
public void monitorInitializing(OperationMonitor operationMonitor);
/**
* Called when there is a progress for the operation.
* @param elaborated the elaborated part.
*/
public void monitorUpdate(float elaborated);
public void monitorUpdate(OperationMonitor operationMonitor);
/**
* Called when there is a validate for the operation.
* @param elaborated the elaborated part.
*/
public void monitorValidate(float elaborated);
public void monitorValidate(OperationMonitor operationMonitor);
/**
* Called when the operation is complete.
@ -71,14 +71,9 @@ public interface MonitorUpdaterListener {
/**
* Called when the operation is generating the view
*/
public void monitorGeneratingView();
public void monitorGeneratingView(OperationMonitor operationMonitor);
/**
* Called when the operation montor is changed
*
* @param operationMonitor
*/
public void monitorChanged(OperationMonitor operationMonitor);
}