mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

kenneth_suter
10.16.2007 e85e6d0af6875147e77127f10e0211c014ca28d9
opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
@@ -92,12 +92,18 @@
   */
  public String getFormattedError(String text, boolean applyMargin)
  {
    String html =
        UIFactory.getIconHtml(UIFactory.IconType.ERROR_LARGE)
            + SPACE
            + SPACE
            + UIFactory.applyFontToHtml(getHtml(text),
                UIFactory.PROGRESS_ERROR_FONT);
    String html;
    if (!containsHtml(text)) {
      html = UIFactory.getIconHtml(UIFactory.IconType.ERROR_LARGE)
          + SPACE
          + SPACE
          + UIFactory.applyFontToHtml(getHtml(text),
              UIFactory.PROGRESS_ERROR_FONT);
    } else {
      html =
          UIFactory.getIconHtml(UIFactory.IconType.ERROR_LARGE) + SPACE
          + SPACE + UIFactory.applyFontToHtml(text, UIFactory.PROGRESS_FONT);
    }
    String result = UIFactory.applyErrorBackgroundToHtml(html);
    if (applyMargin)
@@ -119,12 +125,19 @@
   */
  public String getFormattedWarning(String text, boolean applyMargin)
  {
    String html =
    String html;
    if (!containsHtml(text)) {
      html =
        UIFactory.getIconHtml(UIFactory.IconType.WARNING_LARGE)
            + SPACE
            + SPACE
            + UIFactory.applyFontToHtml(getHtml(text),
                UIFactory.PROGRESS_WARNING_FONT);
    } else {
      html =
          UIFactory.getIconHtml(UIFactory.IconType.WARNING_LARGE) + SPACE
          + SPACE + UIFactory.applyFontToHtml(text, UIFactory.PROGRESS_FONT);
    }
    String result = UIFactory.applyWarningBackgroundToHtml(html);
    if (applyMargin)
@@ -591,5 +604,11 @@
          closeDiv, inverse);
    }
  }
  private boolean containsHtml(String text) {
    return (text != null &&
            text.indexOf('<') != -1 &&
            text.indexOf('>') != -1);
  }
}