/** * Sends an informational message for display by desktop. * * @param message Text of the message. * @param caption Optional caption text. */ public static void showMessage(String message, String caption) { getShell().getMessageWindow().showMessage(message, caption); }
/** * If event data is of the format [session id]^[requester], this is an invitation * request. If event data is of the format [session id], it is a cancellation of a * previous request. */ @Override public void eventCallback(String eventName, String eventData) { String[] pcs = eventData.split("\\^", 2); String tag = EVENT_INVITE + "_" + pcs[0]; CareWebShell shell = CareWebUtil.getShell(); if (pcs.length == 2) { String message = StrUtil.formatMessage("@cwf.chat.invitation.message", pcs[1]); String caption = StrUtil.formatMessage("@cwf.chat.invitation.caption"); shell.getMessageWindow().showMessage(message, caption, null, 999999, tag, (event) -> { eventManager.fireLocalEvent(EVENT_ACCEPT, pcs[0]); }); } else { shell.getMessageWindow().clearMessages(tag); } } };