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

kenneth_suter
27.36.2007 535613fb5fd9a2e33c5d5717dd17a2afaf2139ff
Addresses issues with GUI access to builds repository
- Fixes a bug in which caused the connection problem dialog to fail to appear
- Fixes a presentation problem with the HTML presented in the connection problem dialog
- Properly associates the web proxy dialog with its parent and centers on the screen

This commit passes the precommit target
5 files modified
46 ■■■■■ changed files
opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java 3 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java 9 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java 4 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java 28 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties
@@ -876,7 +876,7 @@
  <br>Unable to retrieve the list of builds from {0} due to: {1}.<br>\
  Possible Causes:<br>\
  <ul><li>Need to specify a proxy.<br><table><tr><td>\
  <input value="Specify Proxy" type="submit"/></td><td>Current Proxy: {2}<td>\
  <input value="Specify Proxy" type="submit"></input></td><td>Current Proxy: {2}<td>\
  </tr></table><br></li><li>{0} \
  is down or experiencing difficulty.</li></ul><br>You can still continue with \
  upgrade but will need to download a build separately and then point to it in \
opends/src/quicksetup/org/opends/quicksetup/ui/WebProxyDialog.java
@@ -27,6 +27,8 @@
package org.opends.quicksetup.ui;
import org.opends.quicksetup.util.Utils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
@@ -115,6 +117,7 @@
        tfHost.requestFocusInWindow();
      }
    });
    Utils.centerOnComponent(this, getParent());
    pack();
  }
opends/src/quicksetup/org/opends/quicksetup/upgrader/RemoteBuildManager.java
@@ -39,7 +39,6 @@
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.io.*;
import java.awt.*;
@@ -186,14 +185,6 @@
    String line;
    while (null != (line = reader.readLine())) {
      builder.append(line);
      // FOR TESTING
       try {
          Thread.sleep(50);
       } catch (InterruptedException e) {
          LOG.log(Level.INFO, "error", e);
       }
    }
    return builder.toString();
  }
opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/BuildListDownloadErrorPanel.java
@@ -110,7 +110,9 @@
    CustomHTMLEditorKit ek = new CustomHTMLEditorKit();
    ek.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ev) {
        specifyProxy(getParent());
        Component dlg = SwingUtilities.getAncestorOfClass(Window.class,
                BuildListDownloadErrorPanel.this);
        specifyProxy(dlg);
        // Since the proxy info may change we need
        // to regenerate the text
opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/ChooseVersionPanel.java
@@ -70,7 +70,7 @@
   */
  public ChooseVersionPanel(GuiApplication application) {
    super(application);
    createBuildLoader();
    getBuildLoader();
  }
  /**
@@ -245,7 +245,7 @@
    return getMsg("upgrade-choose-version-panel-instructions");
  }
  private RemoteBuildListComboBoxModelCreator createBuildLoader() {
  private RemoteBuildListComboBoxModelCreator getBuildLoader() {
    if (bld == null) {
      RemoteBuildManager rbm =
              ((Upgrader) getApplication()).getRemoteBuildManager();
@@ -356,15 +356,25 @@
      throws IOException
    {
      this.rbm = rbm;
      this.in = rbm.getDailyBuildsInputStream(getMainWindow(),
              "Reading build information");
      // This is a lengthy operation that must be
      // performed in the event thread.  So try
      // to do this work now during construction
      // rather than when the panel becomes visible
      // for the first time.  If we fail we'll try
      // again later.
      try {
        getInputStream();
      } catch (IOException e) {
        LOG.log(Level.INFO, "Error obtaining build list input stream", e);
      }
    }
    /**
     * {@inheritDoc}
     */
    public java.util.List<Build> processBackgroundTask() throws Exception {
      return rbm.listBuilds(in);
      return rbm.listBuilds(getInputStream());
    }
    /**
@@ -424,6 +434,14 @@
        });
      }
    }
    private InputStream getInputStream() throws IOException {
      if (this.in == null) {
        this.in = rbm.getDailyBuildsInputStream(getMainWindow(),
                "Reading build information");
      }
      return this.in;
    }
  }
}