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

jvergara
26.44.2008 53206ce28721940f13e60c351ef4773edab89be7
opends/src/guitools/org/opends/guitools/controlpanel/ControlPanelLauncher.java
@@ -177,13 +177,9 @@
      {
        try
        {
          // Setup MacOSX native menu bar before AWT is loaded.
          Utils.setMacOSXMenuBar(
              AdminToolMessages.INFO_CONTROL_PANEL_TITLE.get());
          try
          {
            UIManager.setLookAndFeel(
                UIManager.getSystemLookAndFeelClassName());
            initLookAndFeel();
          }
          catch (Throwable t)
          {
@@ -237,8 +233,49 @@
    System.setErr(printStream);
    return returnValue[0];
  }
  private static void initLookAndFeel() throws Throwable
  {
    if (SwingUtilities.isEventDispatchThread())
    {
//    Setup MacOSX native menu bar before AWT is loaded.
      Utils.setMacOSXMenuBar(
          AdminToolMessages.INFO_CONTROL_PANEL_TITLE.get());
      UIManager.setLookAndFeel(
          UIManager.getSystemLookAndFeelClassName());
    }
    else
    {
      final Throwable[] ts = {null};
      SwingUtilities.invokeAndWait(new Runnable()
      {
        public void run()
        {
          try
          {
//          Setup MacOSX native menu bar before AWT is loaded.
            Utils.setMacOSXMenuBar(
                AdminToolMessages.INFO_CONTROL_PANEL_TITLE.get());
            UIManager.setLookAndFeel(
                UIManager.getSystemLookAndFeelClassName());
          }
          catch (Throwable t)
          {
            ts[0] = t;
          }
        }
      });
      if (ts[0] != null)
      {
        throw ts[0];
      }
    }
  }
}
/**
 * The enumeration containing the different return codes that the command-line
 * can have.