Added Stop support
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@92481 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6590d42e11
commit
de3cd1b883
|
@ -63,5 +63,12 @@ public class ChangeColumnTypeProgressBarUpdater implements ChangeColumnTypeProgr
|
||||||
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationStopped(String reason, String details) {
|
||||||
|
Log.info("Stopped");
|
||||||
|
progressBar.updateText("Stopped");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,4 +122,18 @@ public class ChangeColumnTypeProgressDialog extends Window implements ChangeColu
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationStopped(String reason, String details) {
|
||||||
|
ok.setVisible(true);
|
||||||
|
this.trId=null;
|
||||||
|
AlertMessageBox d = new AlertMessageBox("Stopped Changing Column Type", reason);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,12 @@ public interface ChangeColumnTypeProgressListener {
|
||||||
* @param reason the failure reason.
|
* @param reason the failure reason.
|
||||||
*/
|
*/
|
||||||
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the operation is failed.
|
||||||
|
* @param caught the failure exception.
|
||||||
|
* @param reason the failure reason.
|
||||||
|
*/
|
||||||
|
public void operationStopped(String reason, String details);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class ChangeColumnTypeProgressUpdater extends Timer {
|
||||||
break;
|
break;
|
||||||
case STOPPED:
|
case STOPPED:
|
||||||
cancel();
|
cancel();
|
||||||
errorMessage(result);
|
stopMessage(result);
|
||||||
break;
|
break;
|
||||||
case FAILED:
|
case FAILED:
|
||||||
cancel();
|
cancel();
|
||||||
|
@ -103,6 +103,21 @@ public class ChangeColumnTypeProgressUpdater extends Timer {
|
||||||
fireOperationFailed(th, failure, details);
|
fireOperationFailed(th, failure, details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void stopMessage(ChangeColumnTypeMonitor result) {
|
||||||
|
Log.info("Change Column Type Stopped");
|
||||||
|
String failure = null;
|
||||||
|
String details = null;
|
||||||
|
if (result.getError() != null) {
|
||||||
|
failure = "Stopped changing the column type";
|
||||||
|
details = result.getError().getLocalizedMessage();
|
||||||
|
} else {
|
||||||
|
failure = "Stopped changing the column type";
|
||||||
|
details = "Change the column type stopped";
|
||||||
|
}
|
||||||
|
|
||||||
|
fireOperationStopped(failure, details);
|
||||||
|
}
|
||||||
|
|
||||||
protected String getStack(Throwable e) {
|
protected String getStack(Throwable e) {
|
||||||
String message = e.getLocalizedMessage() + " -> <br>";
|
String message = e.getLocalizedMessage() + " -> <br>";
|
||||||
Throwable c = e.getCause();
|
Throwable c = e.getCause();
|
||||||
|
@ -131,6 +146,11 @@ public class ChangeColumnTypeProgressUpdater extends Timer {
|
||||||
for (ChangeColumnTypeProgressListener listener : listeners)
|
for (ChangeColumnTypeProgressListener listener : listeners)
|
||||||
listener.operationFailed(caught, failure, failureDetails);
|
listener.operationFailed(caught, failure, failureDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void fireOperationStopped(String reason, String details) {
|
||||||
|
for (ChangeColumnTypeProgressListener listener : listeners)
|
||||||
|
listener.operationStopped(reason, details);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new {@link ChangeColumnTypeProgressListener} to this
|
* Add a new {@link ChangeColumnTypeProgressListener} to this
|
||||||
|
|
|
@ -63,5 +63,12 @@ public class DeleteColumnProgressBarUpdater implements DeleteColumnProgressListe
|
||||||
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationStopped(String reason, String details) {
|
||||||
|
Log.info("Stopped");
|
||||||
|
progressBar.updateText("Stopped");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,4 +122,18 @@ public class DeleteColumnProgressDialog extends Window implements DeleteColumnPr
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationStopped(String reason, String details) {
|
||||||
|
ok.setVisible(true);
|
||||||
|
this.trId=null;
|
||||||
|
AlertMessageBox d = new AlertMessageBox("Stopped Delete Column", reason);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,13 @@ public interface DeleteColumnProgressListener {
|
||||||
* @param reason the failure reason.
|
* @param reason the failure reason.
|
||||||
*/
|
*/
|
||||||
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the operation is failed.
|
||||||
|
* @param caught the failure exception.
|
||||||
|
* @param reason the failure reason.
|
||||||
|
*/
|
||||||
|
public void operationStopped(String reason, String details);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class DeleteColumnProgressUpdater extends Timer {
|
||||||
break;
|
break;
|
||||||
case STOPPED:
|
case STOPPED:
|
||||||
cancel();
|
cancel();
|
||||||
errorMessage(result);
|
stopMessage(result);
|
||||||
break;
|
break;
|
||||||
case FAILED:
|
case FAILED:
|
||||||
cancel();
|
cancel();
|
||||||
|
@ -106,6 +106,22 @@ public class DeleteColumnProgressUpdater extends Timer {
|
||||||
|
|
||||||
fireOperationFailed(th, failure, details);
|
fireOperationFailed(th, failure, details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void stopMessage(DeleteColumnMonitor result) {
|
||||||
|
Log.info("Delete Column Stopped");
|
||||||
|
String failure = null;
|
||||||
|
String details = null;
|
||||||
|
if (result.getError() != null) {
|
||||||
|
failure = "Stopped delete column";
|
||||||
|
details = result.getError().getLocalizedMessage();
|
||||||
|
} else {
|
||||||
|
failure = "Stopped delete column";
|
||||||
|
details = "Delete the column stopped";
|
||||||
|
}
|
||||||
|
|
||||||
|
fireOperationStopped(failure, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected String getStack(Throwable e) {
|
protected String getStack(Throwable e) {
|
||||||
String message = e.getLocalizedMessage() + " -> <br>";
|
String message = e.getLocalizedMessage() + " -> <br>";
|
||||||
|
@ -135,6 +151,11 @@ public class DeleteColumnProgressUpdater extends Timer {
|
||||||
for (DeleteColumnProgressListener listener : listeners)
|
for (DeleteColumnProgressListener listener : listeners)
|
||||||
listener.operationFailed(caught, failure, failureDetails);
|
listener.operationFailed(caught, failure, failureDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void fireOperationStopped(String reason, String details) {
|
||||||
|
for (DeleteColumnProgressListener listener : listeners)
|
||||||
|
listener.operationStopped(reason, details);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new {@link DeleteColumnProgressListener} to this
|
* Add a new {@link DeleteColumnProgressListener} to this
|
||||||
|
|
|
@ -63,5 +63,12 @@ public class LabelColumnProgressBarUpdater implements LabelColumnProgressListene
|
||||||
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
if (elaborated == 1) progressBar.updateProgress(1, "Completing...");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationStopped(String reason, String details) {
|
||||||
|
Log.info("Stopped");
|
||||||
|
progressBar.updateText("Stopped");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,4 +123,17 @@ public class LabelColumnProgressDialog extends Window implements LabelColumnProg
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void operationStopped(String reason, String details) {
|
||||||
|
ok.setVisible(true);
|
||||||
|
this.trId=null;
|
||||||
|
AlertMessageBox d = new AlertMessageBox(reason, details);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,4 +39,13 @@ public interface LabelColumnProgressListener {
|
||||||
* @param reason the failure reason.
|
* @param reason the failure reason.
|
||||||
*/
|
*/
|
||||||
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
public void operationFailed(Throwable caught, String reason, String failureDetails);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the operation is failed.
|
||||||
|
* @param caught the failure exception.
|
||||||
|
* @param reason the failure reason.
|
||||||
|
*/
|
||||||
|
public void operationStopped(String reason, String details);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class LabelColumnProgressUpdater extends Timer {
|
||||||
break;
|
break;
|
||||||
case STOPPED:
|
case STOPPED:
|
||||||
cancel();
|
cancel();
|
||||||
errorMessage(result);
|
stopMessage(result);
|
||||||
break;
|
break;
|
||||||
case FAILED:
|
case FAILED:
|
||||||
cancel();
|
cancel();
|
||||||
|
@ -106,6 +106,22 @@ public class LabelColumnProgressUpdater extends Timer {
|
||||||
|
|
||||||
fireOperationFailed(th, failure, details);
|
fireOperationFailed(th, failure, details);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void stopMessage(LabelColumnMonitor result) {
|
||||||
|
Log.info("Change Label Stopped");
|
||||||
|
String failure = null;
|
||||||
|
String details = null;
|
||||||
|
if (result.getError() != null) {
|
||||||
|
failure = "Stopped";
|
||||||
|
details = result.getError().getLocalizedMessage();
|
||||||
|
} else {
|
||||||
|
failure = "Stopped";
|
||||||
|
details = "Stopped changing the column label ";
|
||||||
|
}
|
||||||
|
|
||||||
|
fireOperationStopped(failure, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected String getStack(Throwable e) {
|
protected String getStack(Throwable e) {
|
||||||
String message = e.getLocalizedMessage() + " -> <br>";
|
String message = e.getLocalizedMessage() + " -> <br>";
|
||||||
|
@ -135,6 +151,12 @@ public class LabelColumnProgressUpdater extends Timer {
|
||||||
for (LabelColumnProgressListener listener : listeners)
|
for (LabelColumnProgressListener listener : listeners)
|
||||||
listener.operationFailed(caught, failure, failureDetails);
|
listener.operationFailed(caught, failure, failureDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void fireOperationStopped(String reason, String details) {
|
||||||
|
for (LabelColumnProgressListener listener : listeners)
|
||||||
|
listener.operationStopped(reason, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new {@link LabelColumnProgressListener} to this
|
* Add a new {@link LabelColumnProgressListener} to this
|
||||||
|
|
Loading…
Reference in New Issue