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

jvergara
27.32.2009 1a75c24bf3008344ed09980d99799f4d46190dfb
Fix for issue 4372 (control-panel output is on one line on copy)
Use a workaround for bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4988885 by adding a 
 character.
2 files modified
41 ■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java 13 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java 28 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java
@@ -280,6 +280,7 @@
      msg = Utilities.applyFont(msg+"<br>", ColorAndFontConstants.progressFont);
      try
      {
        msg = filterForBugID4988885(msg);
        doc.insertBeforeStart(doc.getElement(LASTID), msg);
      }
      catch (Throwable t)
@@ -320,6 +321,7 @@
      try
      {
        msg = filterForBugID4988885(msg);
        doc.insertBeforeStart(doc.getElement(LASTID), msg);
      }
      catch (Throwable t)
@@ -619,4 +621,15 @@
      }
    }
  }
  /**
   * This is necessary because of bug 4988885.
   * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4988885
   * @param msg the message.
   * @return the message filtered.
   */
  private static String filterForBugID4988885(String msg)
  {
    return msg.replaceAll("<br>", "<br>&#10;");
  }
}
opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.util;
@@ -57,12 +57,20 @@
  /**
   * The constant used to separate parameters in an URL.
   */
  private String PARAM_SEPARATOR = "&&&&";
  private static final String PARAM_SEPARATOR = "&&&&";
  /**
   * The space in HTML.
   */
  private static Message SPACE = Message.raw("&nbsp;");
  private static final Message SPACE = Message.raw("&nbsp;");
  /**
   * The line break.
   * The extra char is necessary because of bug:
   * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4988885
   */
   private static final Message LINE_BREAK=
     Message.raw(Constants.HTML_LINE_BREAK+"&#10;");
  /**
   * Returns the HTML representation of the text without providing any style.
@@ -317,7 +325,7 @@
    while (root != null)
    {
      stackBuf.append(Utils.getHtml(INFO_EXCEPTION_ROOT_CAUSE.get().toString()))
              .append(Constants.HTML_LINE_BREAK);
              .append(getLineBreak());
      stackBuf.append(getHtmlStack(root));
      root = root.getCause();
    }
@@ -330,10 +338,10 @@
    if (msg != null)
    {
      buf.append(UIFactory.applyFontToHtml(Utils.getHtml(t.getMessage()),
              UIFactory.PROGRESS_ERROR_FONT)).append(Constants.HTML_LINE_BREAK);
              UIFactory.PROGRESS_ERROR_FONT)).append(getLineBreak());
    } else
    {
      buf.append(t.toString()).append(Constants.HTML_LINE_BREAK);
      buf.append(t.toString()).append(getLineBreak());
    }
    buf.append(getErrorWithStackHtml(openDiv, hideText, showText, stackText,
        closeDiv, false));
@@ -361,7 +369,7 @@
   */
  public Message getLineBreak()
  {
    return Message.raw(Constants.HTML_LINE_BREAK);
    return LINE_BREAK;
  }
  /**
@@ -436,7 +444,7 @@
    .append(SPACE)
    .append(SPACE)
    .append(Utils.getHtml(ex.toString()))
    .append(Constants.HTML_LINE_BREAK);
    .append(getLineBreak());
    StackTraceElement[] stack = ex.getStackTrace();
    for (StackTraceElement aStack : stack) {
      buf.append(SPACE)
@@ -450,7 +458,7 @@
              .append(SPACE)
              .append(SPACE)
              .append(Utils.getHtml(aStack.toString()))
              .append(Constants.HTML_LINE_BREAK);
              .append(getLineBreak());
    }
    return buf.toString();
  }
@@ -506,7 +514,7 @@
              .append("\">").append(text).append("</a>");
      if (hide)
      {
        buf.append(Constants.HTML_LINE_BREAK).append(stackText);
        buf.append(getLineBreak()).append(stackText);
      }
      buf.append(closeDiv);