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

kenneth_suter
24.31.2007 2e1c5e41b9f3a51ab2a90533e8b8c653021f4867
resolves issue 1627 to make use of the framework's plumbing for marking the lone upgrader input field with the invalid field styling if the value is invalid
2 files modified
23 ■■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/WelcomePanel.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -638,7 +638,7 @@
            }
            uud.setServerLocation(serverLocationString);
            qs.displayFieldInvalid(FieldName.SERVER_LOCATION, false);
          } catch (IllegalArgumentException iae) {
            LOG.log(Level.INFO,
                    "illegal OpenDS installation directory selected", iae);
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/ui/WelcomePanel.java
@@ -48,6 +48,8 @@
  private static final long serialVersionUID = 8695606871542491768L;
  private JLabel lblServerLocation;
  private JTextComponent tcServerLocation;
  private JTextComponent tcCurrentServerBuildNumber;
@@ -82,6 +84,21 @@
  /**
   * {@inheritDoc}
   */
  public void displayFieldInvalid(FieldName fieldName, boolean invalid) {
    UIFactory.TextStyle style;
    if (invalid) {
      style = UIFactory.TextStyle.PRIMARY_FIELD_INVALID;
    } else {
      style = UIFactory.TextStyle.PRIMARY_FIELD_VALID;
    }
    if (FieldName.SERVER_LOCATION.equals(fieldName)) {
      UIFactory.setTextStyle(lblServerLocation, style);
    }
  }
  /**
   * {@inheritDoc}
   */
  protected String getTitle() {
    return getMsg("upgrade-welcome-panel-title");
  }
@@ -138,6 +155,8 @@
    // command line implies a build.
    if (Utils.isWebStart()) {
      lblServerLocation = UIFactory.makeJLabel(serverLocationDescriptor);
      tcServerLocation =
              UIFactory.makeJTextComponent(serverLocationDescriptor,
                      userData.getServerLocation());
@@ -153,7 +172,7 @@
      butBrowse.addActionListener(l);
      JPanel pnlBrowser = Utilities.createBrowseButtonPanel(
              UIFactory.makeJLabel(serverLocationDescriptor),
              lblServerLocation,
              tcServerLocation,
              butBrowse);
      pnlBrowser.setOpaque(false);