From 38a8fdce94e08220c2a1d409858566b33a2907fe Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 04 Jan 2010 06:46:50 +0000
Subject: [PATCH] Complete fix for issue 4412 (creating bogus entry from ldif in control panel, the error warning winodw shows hidden behind) Rewrite the code used to calculate the preferred size of the error pane.

---
 opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 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 fe9f3c6..7eba75e 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/ui/ProgressDialog.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008-2009 Sun Microsystems, Inc.
+ *      Copyright 2008-2010 Sun Microsystems, Inc.
  */
 
 package org.opends.guitools.controlpanel.ui;
@@ -289,6 +289,26 @@
     public void setSummary(Message msg)
     {
       errorPane.setText(msg.toString());
+
+      if (!details.isSelected() && isVisible())
+      {
+        Message wrappedText = Utilities.wrapHTML(msg, 70);
+        JEditorPane pane = new JEditorPane();
+        pane.setContentType("text/html");
+        pane.setText(wrappedText.toString());
+        ProgressDialog dlg = (ProgressDialog)Utilities.getParentDialog(this);
+        int width = Math.max(pane.getPreferredSize().width + 40,
+        dlg.getWidth());
+        int height = Math.max(pane.getPreferredSize().height + 40 +
+            extraStrut.getHeight() + details.getPreferredSize().height,
+        dlg.getHeight());
+        // We might want to resize things.
+        if (width > dlg.getWidth() || height > dlg.getHeight())
+        {
+          Dimension newDim = new Dimension(width, height);
+          dlg.setSize(newDim);
+        }
+      }
     }
 
     /**

--
Gitblit v1.10.0