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

jvergara
25.15.2009 6d75cff85d0134f1e59a44fe279c012d523c509f
Fix for issue 3464 (Install summary screen cut-off)
Add some word break tags (<wbr>) to the install paths that are displayed in the summary to force some wrapping.
4 files modified
74 ■■■■ changed files
opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java 5 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java 25 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 5 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java 39 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
@@ -683,9 +683,12 @@
      }
    } else {
      if (getUninstallUserData().getRemoveLibrariesAndTools()) {
        String formattedPath =
          addWordBreaks(
              getStringFromCollection(paths, getLineBreak().toString()), 60, 5);
        successMsg =
            INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY_REMOVE_JARFILES
            .get(getStringFromCollection(paths, getLineBreak().toString()));
            .get(formattedPath);
      } else {
        successMsg = INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY.get();
      }
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -2064,15 +2064,18 @@
        getFormattedSummary(INFO_SUMMARY_CANCELING.get()));
    Installation installation = getInstallation();
    String cmd = getPath(installation.getControlPanelCommandFile());
    String cmd = Utils.addWordBreaks(
        getPath(installation.getControlPanelCommandFile()), 60, 5);
    cmd = UIFactory.applyFontToHtml(cmd, UIFactory.INSTRUCTIONS_MONOSPACE_FONT);
    String formattedPath = Utils.addWordBreaks(
        formatter.getFormattedText(
            Message.raw(getPath(new File(getInstancePath())))).toString(),
            60, 5);
    Message successMessage = Utils.getCustomizedObject(
        "INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY",
        INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get(
            formatter.getFormattedText(
                Message.raw(getPath(new File(getInstancePath())))),
                INFO_GENERAL_SERVER_STOPPED.get(),
                cmd), Message.class);
            formattedPath, INFO_GENERAL_SERVER_STOPPED.get(),
            cmd), Message.class);
    hmSummary.put(InstallProgressStep.FINISHED_SUCCESSFULLY,
            getFormattedSuccess(successMessage));
    hmSummary.put(InstallProgressStep.FINISHED_CANCELED,
@@ -2092,7 +2095,9 @@
  {
   Installation installation = getInstallation();
   String cmd = getPath(installation.getControlPanelCommandFile());
   cmd = UIFactory.applyFontToHtml(cmd, UIFactory.INSTRUCTIONS_MONOSPACE_FONT);
   cmd = Utils.addWordBreaks(
       UIFactory.applyFontToHtml(cmd, UIFactory.INSTRUCTIONS_MONOSPACE_FONT),
       60, 5);
   Message status;
   if (installation.getStatus().isServerRunning())
   {
@@ -2102,11 +2107,13 @@
   {
     status = INFO_GENERAL_SERVER_STOPPED.get();
   }
   String formattedPath = Utils.addWordBreaks(
   formatter.getFormattedText(
       Message.raw(getPath(new File(getInstancePath())))).toString(),
       60, 5);
   Message successMessage = Utils.getCustomizedObject(
       "INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY",
       INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get(
           formatter.getFormattedText(
               Message.raw(getPath(new File(getInstancePath())))),
       INFO_SUMMARY_INSTALL_FINISHED_SUCCESSFULLY.get(formattedPath,
           status,
           cmd), Message.class);
    hmSummary.put(InstallProgressStep.FINISHED_SUCCESSFULLY,
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -2024,9 +2024,12 @@
              formatter.getFormattedText(Message.raw(installPath)),
              newVersion);
    } else {
      String formattedPath = Utils.addWordBreaks(
          formatter.getFormattedText(Message.raw(installPath)).toString(),
          60, 5);
      txt = getFormattedSuccess(
              INFO_SUMMARY_UPGRADE_FINISHED_SUCCESSFULLY.get(
                      formatter.getFormattedText(Message.raw(installPath)),
                  formattedPath,
                      newVersion));
    }
    return txt;
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1785,6 +1785,45 @@
    }
    return value;
  }
  /**
   * Adds word break tags to the provided html string.
   * @param htmlString the string.
   * @param from the first index to start the spacing from.
   * @param spacing the minimal spacing between word breaks.
   * @return a string containing word breaks.
   */
  public static String addWordBreaks(String htmlString, int from, int spacing)
  {
    StringBuffer sb = new StringBuffer();
    boolean insideTag = false;
    int totalAddedChars = 0;
    int addedChars = 0;
    for (int i = 0 ; i<htmlString.length(); i++)
    {
      char c = htmlString.charAt(i);
      sb.append(c);
      if (c == '<')
      {
        insideTag = true;
      }
      else if ((c == '>') && insideTag)
      {
        insideTag = false;
      }
      if (!insideTag && (c != '>'))
      {
        addedChars ++;
        totalAddedChars ++;
      }
      if ((addedChars > spacing) && (totalAddedChars > from) && !insideTag)
      {
        sb.append("<wbr>");
        addedChars = 0;
      }
    }
    return sb.toString();
  }
}
/**