eu.future.earth.gwt.client.date.AddCallBackHandler Maven / Gradle / Ivy
The newest version!
package eu.future.earth.gwt.client.date;
import com.google.gwt.user.client.rpc.AsyncCallback;
import eu.future.earth.gwt.client.date.DateEvent.DateEventActions;
public class AddCallBackHandler implements AsyncCallback {
private DatePanel view = null;
private T data = null;
public AddCallBackHandler(DatePanel view, T theData) {
super();
this.view = view;
data = theData;
}
public T getData() {
return data;
}
public DatePanel getView() {
return view;
}
public void sendFailureEvent() {
view.notifyReady(DateEventActions.ADD_FAILED, data, false);
}
public void onFailure(Throwable caught) {
sendFailureEvent();
}
public void onSuccess(T result) {
view.notifyReady(DateEventActions.ADD_DONE, result, false);
}
}