コード例 #1
0
ファイル: Dialog.java プロジェクト: mo3athBaioud/bluestome
  protected void drawHtmlPostSubsButtons(Writer out) throws IOException {
    Messages msgs = MessagesManager.getMessages();

    out.write(
        "<div class=\""
            + CssConstants.CSSCLASS_TABSETSAVEBAR
            + "\">\n"); //$NON-NLS-1$ //$NON-NLS-2$

    Button save = new Button();
    String saveOnclick = this.getConfigValue("saveOnclick", "mgnlDialogFormSubmit();");
    String saveLabel = this.getConfigValue("saveLabel", msgs.get("buttons.save"));
    if (StringUtils.isNotEmpty(saveOnclick) && StringUtils.isNotEmpty("saveLabel")) {
      save.setOnclick(saveOnclick); // $NON-NLS-1$ //$NON-NLS-2$
      save.setLabel(saveLabel); // $NON-NLS-1$ //$NON-NLS-2$
      out.write(save.getHtml());
    }
    Button cancel = new Button();
    cancel.setOnclick(
        this.getConfigValue("cancelOnclick", "window.close();")); // $NON-NLS-1$ //$NON-NLS-2$
    cancel.setLabel(
        this.getConfigValue(
            "cancelLabel", msgs.get("buttons.cancel"))); // $NON-NLS-1$ //$NON-NLS-2$
    out.write(cancel.getHtml());

    out.write("</div>\n"); // $NON-NLS-1$
  }
コード例 #2
0
ファイル: MessageCommand.java プロジェクト: cheeray/Magnolia
 /** @see info.magnolia.commands.MgnlCommand#execute(info.magnolia.context.Context) */
 @Override
 public boolean execute(Context context) throws Exception {
   if (StringUtils.isNotEmpty(message)) {
     Messages msgs = MessagesUtil.chainWithDefault(this.getI18nBasename());
     AlertUtil.setMessage(msgs.getWithDefault(message, message));
   }
   return true;
 }