/** * Gets the message. * * @param context * the actionContext. * @return the message. */ protected String getMessage(Map<String, Object> context) { String msg = getActionParameter(context); if (msg == null || HtmlHelper.isHtml(msg)) { return msg; } return HtmlHelper .toHtml(HtmlHelper.emphasis(HtmlHelper.escapeForHTML(msg))); }
/** * Utility method used to translate a code using the context translation * provider. If {@link #getMessageArgs(Map)} returns a not-null array or * arguments, they are passed to the translation provider to be used as message * format arguments. * * @param messageCode * the message code to translate. * @param context * the action context. * @return the translated message. */ protected String translate(String messageCode, Map<String, Object> context) { Object[] messageArgs = getMessageArgs(context); String translation; if (messageArgs == null) { translation = getTranslationProvider(context).getTranslation(messageCode, getLocale(context)); } else { translation = getTranslationProvider(context).getTranslation(messageCode, messageArgs, getLocale(context)); } return translation; }
/** * Displays the message using a {@code JOptionPane.INFORMATION_MESSAGE}. * <p> * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { getController(context).popupInfo(getSourceComponent(context), getI18nName(getTranslationProvider(context), getLocale(context)), getIconImageURL(), getMessage(context)); return super.execute(actionHandler, context); } }
/** * Displays the message using a {@code JOptionPane.YES_NO_OPTION}. * <p> * {@inheritDoc} * * @param actionHandler * the action handler * @param context * the context * @return the boolean */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { getController(context).popupYesNo(getSourceComponent(context), getI18nName(getTranslationProvider(context), getLocale(context)), getIconImageURL(), getMessage(context), getYesAction(context), getNoAction(context), context); return super.execute(actionHandler, context); }
/** * Displays an ok cancel dialog * <p> * {@inheritDoc} * * @param actionHandler * the action handler * @param context * the context * @return the boolean */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { getController(context) .popupOkCancel(getSourceComponent(context), getI18nName(getTranslationProvider(context), getLocale(context)), getIconImageURL(), getMessage(context), getOkAction(context), getCancelAction(context), context); return super.execute(actionHandler, context); }
/** * Displays the message using a {@code JOptionPane.YES_NO_CANCEL_OPTION}. * <p> * {@inheritDoc} * * @param actionHandler * the action handler * @param context * the context * @return the boolean */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { getController(context).popupYesNoCancel(getSourceComponent(context), getI18nName(getTranslationProvider(context), getLocale(context)), getIconImageURL(), getMessage(context), getYesAction(context), getNoAction(context), getCancelAction(context), context); return super.execute(actionHandler, context); }