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

jvergara
03.40.2008 9a2b7fab9d523ff7867840d43cc6739de7c5ee4d
Modify the MainMenuBar and MainActionsPane so that they can be extended.
Fix a problem with the ControlPanelLog class: now when it is extended only one log file is created.
4 files modified
36 ■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/ui/GenericMenuBar.java 6 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/MainActionsPane.java 6 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.java 19 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/util/ControlPanelLog.java 5 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/GenericMenuBar.java
@@ -103,7 +103,11 @@
    return menu;
  }
  private void displayURL(final String url)
  /**
   * Tries to display a URL in the systems default WEB browser.
   * @param url the URL to be displayed.
   */
  protected void displayURL(final String url)
  {
    BackgroundTask<Void> worker = new BackgroundTask<Void>()
    {
opends/src/guitools/org/opends/guitools/controlpanel/ui/MainActionsPane.java
@@ -174,7 +174,11 @@
    return null;
  }
  private ArrayList<Category> createCategories()
  /**
   * Creates the categories contained by this panel.
   * @return the categories contained by this panel.
   */
  protected ArrayList<Category> createCategories()
  {
    ArrayList<Category> categories = new ArrayList<Category>();
    Message[][] labels;
opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.java
@@ -62,6 +62,20 @@
  {
    super(info);
    addMenus();
    if (Utilities.isMacOS())
    {
      setMacOSQuitHandler();
    }
  }
  /**
   * Method that can be overwritten to set specific menus.
   *
   */
  protected void addMenus()
  {
    JMenu menu;
    JMenuItem menuItem;
@@ -86,11 +100,6 @@
      add(menu);
    }
    add(createHelpMenuBar());
    if (Utilities.isMacOS())
    {
      setMacOSQuitHandler();
    }
  }
  /**
opends/src/guitools/org/opends/guitools/controlpanel/util/ControlPanelLog.java
@@ -44,6 +44,7 @@
    "org.opends"
  };
  static private File logFile = null;
  static private FileHandler fileHandler;
  /**
   * Creates a new file handler for writing log messages to the file indicated
@@ -55,7 +56,7 @@
    if (!isInitialized())
    {
      logFile = file;
      FileHandler fileHandler = new FileHandler(logFile.getCanonicalPath());
      fileHandler = new FileHandler(logFile.getCanonicalPath());
      fileHandler.setFormatter(new SimpleFormatter());
      for (String packageName : packages)
      {
@@ -76,8 +77,6 @@
   * @throws IOException if something goes wrong
   */
  static public void initPackage(String packageName) throws IOException {
    FileHandler fileHandler = new FileHandler(logFile.getCanonicalPath());
    fileHandler.setFormatter(new SimpleFormatter());
    Logger logger = Logger.getLogger(packageName);
    logger.setUseParentHandlers(false); // disable logging to console
    logger.addHandler(fileHandler);