/** * Whether to show a toolbar of buttons at the bottom of the Dialog. * * * @return Boolean * @see com.smartgwt.client.docs.Appearance Appearance overview and related methods */ public Boolean getShowToolbar() { return getAttributeAsBoolean("showToolbar"); }
/** * Style of the Dialog background * * * @return String * @see com.smartgwt.client.docs.Appearance Appearance overview and related methods */ public String getStyleName() { return getAttributeAsString("styleName"); }
private void hideProcessingDialog() { if (loadDialog != null) { loadDialog.hide(); } }
private void showProcessingDialog() { if (loadDialog == null) { HTMLFlow msg = new HTMLFlow(MESSAGES.uploadShapefileUploadingFile()); msg.setWidth100(); msg.setHeight100(); msg.setAlign(Alignment.CENTER); msg.setPadding(20); msg.setOverflow(Overflow.HIDDEN); loadDialog = new Dialog(); loadDialog.setShowCloseButton(false); loadDialog.setWidth(330); loadDialog.setHeight(100); loadDialog.setIsModal(true); loadDialog.setShowModalMask(true); loadDialog.setTitle(MESSAGES.titlePleaseWait()); loadDialog.addItem(msg); } loadDialog.show(); }
public static Dialog getOrCreateRef(JavaScriptObject jsObj) { if(jsObj == null) return null; BaseWidget obj = BaseWidget.getRef(jsObj); if(obj != null) { return (Dialog) obj; } else { return new Dialog(jsObj); } }
/** * Style of the Dialog background * * @param styleName styleName Default value is "dialogBackground" * @see com.smartgwt.client.docs.Appearance Appearance overview and related methods */ public void setStyleName(String styleName) { setAttribute("styleName", styleName, true); }
private void showProcessingDialog() { if (loadDialog == null) { HTMLFlow msg = new HTMLFlow(MESSAGES.uploadShapefileUploadingFile()); msg.setWidth100(); msg.setHeight100(); msg.setAlign(Alignment.CENTER); msg.setPadding(20); msg.setOverflow(Overflow.HIDDEN); loadDialog = new Dialog(); loadDialog.setShowCloseButton(false); loadDialog.setWidth(330); loadDialog.setHeight(100); loadDialog.setIsModal(true); loadDialog.setShowModalMask(true); loadDialog.setTitle(MESSAGES.titlePleaseWait()); loadDialog.addItem(msg); } loadDialog.show(); }
/** * Whether to show a toolbar of buttons at the bottom of the Dialog. * * @param showToolbar showToolbar Default value is false * @see com.smartgwt.client.docs.Appearance Appearance overview and related methods */ public void setShowToolbar(Boolean showToolbar) { setAttribute("showToolbar", showToolbar, true); }
/** * Returns dataSourceName. * * @param onUploadFinished */ public void upload(DataCallback<String> onUploadFinished) { this.onUploadFinished = onUploadFinished; if (validate()) { HTMLFlow msg = new HTMLFlow(MESSAGES.uploadShapefileUploadingFile()); msg.setWidth100(); msg.setHeight100(); msg.setAlign(Alignment.CENTER); msg.setPadding(20); msg.setOverflow(Overflow.HIDDEN); loadDialog = new Dialog(); loadDialog.setShowCloseButton(false); loadDialog.setWidth(330); loadDialog.setHeight(100); loadDialog.setIsModal(true); loadDialog.setShowModalMask(true); loadDialog.setTitle(MESSAGES.titlePleaseWait()); loadDialog.addItem(msg); loadDialog.show(); form.submit(); } }
/** * Array of Buttons to show in the {@link com.smartgwt.client.widgets.Dialog#getShowToolbar showToolbar}, if shown. * <P> The set of buttons to use is typically set by calling one of the shortcuts. * * @param toolbarButtons the toolbar buttons * @throws IllegalStateException this property cannot be changed after the component has been rendered */ public void setToolbarButtons(Canvas... toolbarButtons) { setAttribute("toolbarButtons", toolbarButtons, false); }
private void hideProcessingDialog() { if (loadDialog != null) { loadDialog.hide(); } }
/** * Returns dataSourceName. * * @param onUploadFinished */ public void upload(DataCallback<String> onUploadFinished) { this.onUploadFinished = onUploadFinished; if (validate()) { HTMLFlow msg = new HTMLFlow(MESSAGES.uploadShapefileUploadingFile()); msg.setWidth100(); msg.setHeight100(); msg.setAlign(Alignment.CENTER); msg.setPadding(20); msg.setOverflow(Overflow.HIDDEN); loadDialog = new Dialog(); loadDialog.setShowCloseButton(false); loadDialog.setWidth(330); loadDialog.setHeight(100); loadDialog.setIsModal(true); loadDialog.setShowModalMask(true); loadDialog.setTitle(MESSAGES.titlePleaseWait()); loadDialog.addItem(msg); loadDialog.show(); hiddenLayerName.setValue(layerName); hiddenToken.setValue(GwtCommandDispatcher.getInstance().getUserToken()); form.submit(); } }
/** * Style to apply to the message text shown in the center of the dialog * <p><b>Note : </b> This is an advanced setting</p> * * @param messageStyle messageStyle Default value is "normal" * @throws IllegalStateException this property cannot be changed after the component has been created */ public void setMessageStyle(String messageStyle) throws IllegalStateException { setAttribute("messageStyle", messageStyle, false); }
private void uploadFinished(String result) { loadDialog.hide(); String fileId = null; if (RESPONSE_INVALID_FILE.equals(result)) { SC.warn(MESSAGES.uploadShapefileResponseInvalidFile()); } else if (RESPONSE_NO_RIGHTS.equals(result)) { SC.warn(MESSAGES.uploadShapefileResponseNoRights()); } else if (result.startsWith(RESPONSE_OK)) { String res = result.substring(RESPONSE_OK.length()); if (res != null && res.contains("[") && res.contains("]")) { int startIndex = res.indexOf("["); int stopIndex = res.indexOf("]"); if (startIndex < stopIndex - 1) { fileId = res.substring(startIndex + 1, stopIndex); } else { SC.say(MESSAGES.uploadShapefileResponseOkButWrong(result)); } } else { SC.say(MESSAGES.uploadShapefileResponseOkButWrong(result)); } } else { SC.warn(MESSAGES.uploadShapefileResponseDefaultNOK(result)); } if (onUploadFinished != null && fileId != null) { onUploadFinished.execute(fileId); } } }
private void uploadFinished(String result) { String dataSourceName = null; loadDialog.hide(); if (RESPONSE_INVALID_FILE.equals(result)) { SC.warn(MESSAGES.uploadShapefileResponseInvalidFile()); } else if (RESPONSE_INVALID_LAYER.equals(result)) { SC.warn(MESSAGES.uploadShapefileResponseInvalidLayer()); } else if (RESPONSE_NO_RIGHTS.equals(result)) { SC.warn(MESSAGES.uploadShapefileResponseNoRights()); } else if (result.startsWith(RESPONSE_OK)) { String[] res = result.split("_", 2); if (res != null && res.length == 2) { dataSourceName = res[1]; SC.say(MESSAGES.uploadShapefileResponseOK()); } else { SC.warn(MESSAGES.uploadShapefileResponseOkButWrong(result)); } } else { SC.warn(MESSAGES.uploadShapefileResponseDefaultNOK(result)); } if (onUploadFinished != null) { onUploadFinished.execute(dataSourceName); } } }