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

jvergara
14.25.2009 a80621e8c223413d945ab9dc7bf1c7ef7097aed4
Fix for issue 4400 (Control Panel broken in OpenJDK)
The problem occurs because the default border for the list highlight provides empty insets and this generates an exception in the CompoundBorder class). This is a bug in the OpenJDK, but the workaround is trivial (and only executed once during the loading of the classes), so I am implementing it because without it the control-panel cannot be used.
1 files modified
18 ■■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/ui/components/ActionButton.java 18 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/components/ActionButton.java
@@ -75,6 +75,22 @@
    buttonBorder = new EmptyBorder(5, n, 5, 25);
    Border highlightBorder =
      UIManager.getBorder("List.focusCellHighlightBorder");
    // This is required (see issue
    // https://opends.dev.java.net/issues/show_bug.cgi?id=4400)
    // since in OpenJDK the CompoundBorder class does not handle properly
    // null insets.
    if (highlightBorder != null)
    {
      try
      {
        b.setBorder(BorderFactory.createCompoundBorder(
          highlightBorder, buttonBorder));
      }
      catch (Throwable t)
      {
        highlightBorder = null;
      }
    }
    if (highlightBorder == null)
    {
      highlightBorder =
@@ -103,7 +119,7 @@
  private static final Color pressedForeground =
    ColorAndFontConstants.pressedForeground;
  static final Font actionFont = ColorAndFontConstants.defaultFont;
  private static final Font actionFont = ColorAndFontConstants.defaultFont;
  /**