From ff7ed17007414fbb17984b2daf5f380606ca8496 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Thu, 28 Apr 2016 08:34:11 +0000
Subject: [PATCH] OPENDJ-2971 Resurect graphical setup methods

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java
index 76e78f2..9a05615 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/ui/UIFactory.java
@@ -53,6 +53,7 @@
 import javax.swing.text.html.HTMLEditorKit;
 
 import org.forgerock.i18n.LocalizableMessage;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
 
 /**
  * This class provides constants an methods to create Swing objects and to
@@ -63,7 +64,9 @@
  */
 public class UIFactory
 {
+  private static boolean initialized;
   private static String parentPackagePath;
+  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
   /** Specifies the horizontal insets between buttons. */
   public static final int HORIZONTAL_INSET_BETWEEN_BUTTONS = 5;
@@ -416,6 +419,33 @@
   }
 
   /**
+   * This method initialize the look and feel and UI settings specific to quick
+   * setup.
+   *
+   * @throws Throwable
+   *           if there is a problem initializing the look and feel.
+   */
+  public static void initialize() throws Throwable
+  {
+    if (!initialized)
+    {
+      try
+      {
+        UIManager.put("OptionPane.background", getColor(INFO_OPTIONPANE_BACKGROUND_COLOR.get()));
+        UIManager.put("Panel.background", getColor(INFO_PANEL_BACKGROUND_COLOR.get()));
+        UIManager.put("ComboBox.background", getColor(INFO_COMBOBOX_BACKGROUND_COLOR.get()));
+      }
+      catch (Throwable t)
+      {
+        // This might occur when we do not get the display
+        logger.warn(LocalizableMessage.raw("Error updating UIManager: " + t, t));
+      }
+      initializeLookAndFeel();
+      initialized = true;
+    }
+  }
+
+  /**
    * Creates a new JPanel.
    *
    * @return JPanel newly created

--
Gitblit v1.10.0