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

jvergara
20.04.2007 4874b6f0375b090c38cfaea9196dbcbb36ebbe8c
Fix for 2318.

In UIFactory we try to update the UIManager but this may fail when we do not have the DISPLAY. Catch the exception and log a message in the logger when this occurs.
1 files modified
25 ■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java 25 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup.ui;
import org.opends.messages.Message;
import static org.opends.messages.QuickSetupMessages.*;
import java.awt.Color;
@@ -42,6 +43,8 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.text.JTextComponent;
@@ -68,6 +71,8 @@
  private static String parentPackagePath;
  private static final Logger LOG = Logger.getLogger(UIFactory.class.getName());
  /**
   * Specifies the horizontal insets between buttons.
   */
@@ -526,12 +531,20 @@
      new HashMap<IconType, ImageIcon>();
  static {
    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()));
    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
      LOG.log(Level.WARNING, "Error updating UIManager: "+t, t);
    }
  }
  /**