From 9abf2773c43eec1c96c1130bb0425e9b19cee4c6 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 27 Nov 2009 16:55:08 +0000
Subject: [PATCH] Complete fix for issue 4372 (control-panel output is on one line on copy).

---
 opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java b/opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java
index 2fc8844..fe9f3c6 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java
@@ -271,23 +271,14 @@
 
     /**
      * Appends a line to the logs (Details are) section of the panel.  The text
-     * will be preceded by a new line (is similar to println()).
+     * will have a new-line char at the end (is similar to println()).
      * @param msg the HTML formatted text to be appended.
      */
     public void appendErrorLine(String msg)
     {
-      HTMLDocument doc = (HTMLDocument)logs.getDocument();
-      msg = Utilities.applyFont(msg+"<br>", ColorAndFontConstants.progressFont);
-      try
-      {
-        msg = filterForBugID4988885(msg);
-        doc.insertBeforeStart(doc.getElement(LASTID), msg);
-      }
-      catch (Throwable t)
-      {
-        // Bug
-        t.printStackTrace();
-      }
+      msg = filterForBugID4988885(msg+"<br>");
+      msg = Utilities.applyFont(msg, ColorAndFontConstants.progressFont);
+      appendHtml(msg);
     }
 
     /**
@@ -581,7 +572,7 @@
     }
 
     /**
-     * Checks if the 'Close when over' checkbox is selected and if it is the
+     * Checks if the 'Close when over' check box is selected and if it is the
      * case, closes the dialog after waiting for 2 seconds (so that the user
      * can see the result, or cancel the automatic closing of the dialog).
      *
@@ -630,6 +621,6 @@
    */
   private static String filterForBugID4988885(String msg)
   {
-    return msg.replaceAll("<br>", "<br>&#10;");
+    return msg.replaceAll("<br>", "&#10;<br>");
   }
 }

--
Gitblit v1.10.0