Exemple #1
0
  /**
   * Return the HTML representation of the message list
   *
   * @param eqProperties - properties
   * @param equationUser - Equation User
   * @return the HTML representation of the message list
   */
  public String toHTML(Properties eqProperties, EquationUser equationUser) {
    StringBuffer strHTML = new StringBuffer();

    // initial HTML
    if (equationUser.isLanguageRTL()) {
      strHTML.append("<table class='wf_RIGHT_ALIGN'>");
    } else {
      strHTML.append("<table>");
    }

    // offset
    int offset = strHTML.length();

    // content
    if (queueMessages != null) {
      for (int i = 0; i < queueMessages.length; i++) {
        strHTML.insert(
            offset,
            formatMsgToHTML(queueMessages[i], i + queuePosition, eqProperties, equationUser));
      }
    } else {
      strHTML.append("<tr><td>");
      strHTML.append(
          EquationCommonContext.getContext().getLanguageResource(equationUser, "GBL000002"));
      strHTML.append("</tr></td>");
    }
    strHTML.append("</table>");
    // final HTML
    return strHTML.toString();
  }
Exemple #2
0
 /**
  * Return the String representation of the message type
  *
  * @param type - message type
  * @param eqProperties - properties
  * @param equationUser - Equation User
  * @return the String representation of the message type
  */
 public static String cvtMsgTypeToStr(
     int type, Properties eqProperties, EquationUser equationUser) {
   String str = "";
   switch (type) {
     case AS400Message.INFORMATIONAL:
       str = "GBLINFOL";
       break;
     case AS400Message.INQUIRY:
       str = "GBLINQ";
       break;
     case AS400Message.REPLY_FROM_SYSTEM_REPLY_LIST:
     case AS400Message.REPLY_MESSAGE_DEFAULT_USED:
     case AS400Message.REPLY_NOT_VALIDITY_CHECKED:
     case AS400Message.REPLY_SYSTEM_DEFAULT_USED:
     case AS400Message.REPLY_VALIDITY_CHECKED:
       str = "GBLREPLY";
       break;
     case AS400Message.SENDERS_COPY:
       str = "GBL000062";
       break;
     case AS400Message.COMPLETION:
       str = "GBLCOMPN";
       break;
     case AS400Message.DIAGNOSTIC:
       str = "GBLDIAGC";
       break;
     case AS400Message.ESCAPE:
     case AS400Message.ESCAPE_NOT_HANDLED:
       str = "GBLESC";
       break;
       // case AS400Message.MESSAGE_OPTION_ALL:
       // case AS400Message.MESSAGE_OPTION_NONE:
       // case AS400Message.MESSAGE_OPTION_UP_TO_10:
     case AS400Message.NOTIFY:
     case AS400Message.NOTIFY_NOT_HANDLED:
       str = "GBLNOTFY";
       break;
     case AS400Message.REQUEST:
     case AS400Message.REQUEST_WITH_PROMPTING:
       str = "GBLRQST";
       break;
   }
   return EquationCommonContext.getContext().getLanguageResource(equationUser, str);
 }