@Override protected boolean onResponseReceived(RequestContext context) { GwtUtils.log( getClass(), "onResponseReceived", "service = " + getServiceName() + ", methodName = " + context.getMethodName() + " response.statusCode = " + context.getResponse().getStatusCode()); hideWaitPanelIfRequired(context); return true; }
@Override protected boolean onError(RequestContext context, Throwable exception) { GwtUtils.log( getClass(), "onError", "service = " + getServiceName() + ", methodName = " + context.getMethodName() + " ex.class = " + exception.getClass().getName() + " ex.message = " + exception.getMessage()); hideWaitPanelIfRequired(context); if (getServicePropertyBoolean(context.getMethodName(), "vetoOnFailureCallback", false)) { GwtUtils.log(getClass(), "onError", "vetoOnFailureCallback is ON"); return false; } if (exception.getMessage() != null && exception.getMessage().equals("0")) { return false; } return true; }
@Override protected boolean onCreateRequest(RequestContext context) { GwtUtils.log( getClass(), "onCreateRequest", "service = " + getServiceName() + ", methodName = " + context.getMethodName() + " serviceEntryPoint = " + context.getServiceEntryPoint()); showWaitPanelIfRequired(context); return true; }
private void showWaitPanelIfRequired(RequestContext context) { if (getServicePropertyBoolean(context.getMethodName(), "showWaitPanel", false)) { GwtUtils.log(getClass(), "showWaitPanelIfRequired", "showWaitPanel = true"); if (waitPanel == null) { waitPanel = new PopupPanel(); GwtUtils.setStyleAttribute(waitPanel, "border", "none"); GwtUtils.setStyleAttribute(waitPanel, "background", "transparent"); waitPanel.setGlassEnabled(false); waitPanel.setAnimationEnabled(true); Image waitingImg = new Image(UriUtils.fromTrustedString("/images/commons/transp-loading.gif")); waitPanel.setWidget(waitingImg); } GwtUtils.showWait(waitPanel); } }
private void hideWaitPanelIfRequired(RequestContext context) { if (getServicePropertyBoolean(context.getMethodName(), "showWaitPanel", false)) { GwtUtils.hideWait(); } }