boolean confirmChanges = chkConfirmChange.getValue();
if (confirmChanges == false) {
String info = "Deleting event " + String.valueOf(row);
RootPanel.get("lblInfo").add(new Label(info));
return;
}
// request confirmation
boolean applyDelete = confirmChanges ?
Window.confirm("Are you sure you want to delete this event?") :
true;
if (applyDelete) {
String info = "Deleted " + String.valueOf(row);
RootPanel.get("lblInfo").add(new Label(info));
} else {
// cancel the deletion
timeline.cancelDelete();
String info = "Deleting event " + String.valueOf(row) + " cancelled";
RootPanel.get("lblInfo").add(new Label(info));
}
}
}
};
}