private void hideProcessingDialog() { if (loadDialog != null) { loadDialog.hide(); } }
private void hideProcessingDialog() { if (loadDialog != null) { loadDialog.hide(); } }
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); } } }