From bb1b4f1a882179359bf027bdf6acb8e9c40e5ab7 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 10 May 2007 14:16:11 +0000
Subject: [PATCH] This commit addresses several issues that Brian brought up regarding the upgrader.

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
index e71a829..6d90d96 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
+++ b/opendj-sdk/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);
+  }
 }
 

--
Gitblit v1.10.0