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

jvergara
05.08.2008 9f9235d857a27af6adf6cf8c3b7d9fbaff58d993
Move the method wrapText form Utils to StatusCli since makes an unsafe reference to StaticUtils that could break the webstart installer.
2 files modified
51 ■■■■ changed files
opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java 12 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java
@@ -65,6 +65,7 @@
import org.opends.server.tools.ToolConstants;
import org.opends.server.tools.dsconfig.LDAPManagementContextFactory;
import org.opends.server.types.NullOutputStream;
import org.opends.server.util.StaticUtils;
import org.opends.server.util.args.ArgumentException;
import org.opends.server.util.cli.ConsoleApplication;
import org.opends.server.util.cli.LDAPConnectionConsoleInteraction;
@@ -619,13 +620,14 @@
      {
        getOutputStream().println();
        getOutputStream().println(
            wrap(INFO_NOT_AVAILABLE_SERVER_DOWN_CLI_LEGEND.get()));
            wrapText(INFO_NOT_AVAILABLE_SERVER_DOWN_CLI_LEGEND.get()));
      }
      else if (displayMustAuthenticateLegend)
      {
        getOutputStream().println();
        getOutputStream().println(
            wrap(INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LEGEND.get()));
            wrapText(
                INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LEGEND.get()));
      }
    }
    getOutputStream().println();
@@ -866,16 +868,17 @@
        if (!desc.isAuthenticated())
        {
          getOutputStream().println(
              wrap(INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LABEL.get()));
              wrapText(
                  INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LABEL.get()));
        }
        else
        {
          getOutputStream().println(wrap(INFO_NO_LISTENERS_FOUND.get()));
          getOutputStream().println(wrapText(INFO_NO_LISTENERS_FOUND.get()));
        }
      }
      else
      {
        getOutputStream().println(wrap(INFO_NO_LISTENERS_FOUND.get()));
        getOutputStream().println(wrapText(INFO_NO_LISTENERS_FOUND.get()));
      }
    }
    else
@@ -908,16 +911,17 @@
        if (!desc.isAuthenticated())
        {
          getOutputStream().println(
              wrap(INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LABEL.get()));
              wrapText(
                  INFO_NOT_AVAILABLE_AUTHENTICATION_REQUIRED_CLI_LABEL.get()));
        }
        else
        {
          getOutputStream().println(wrap(INFO_NO_DBS_FOUND.get()));
          getOutputStream().println(wrapText(INFO_NO_DBS_FOUND.get()));
        }
      }
      else
      {
        getOutputStream().println(wrap(INFO_NO_DBS_FOUND.get()));
        getOutputStream().println(wrapText(INFO_NO_DBS_FOUND.get()));
      }
    }
    else
@@ -946,7 +950,7 @@
    if (errorMsg != null)
    {
      getOutputStream().println();
      getOutputStream().println(wrap(errorMsg));
      getOutputStream().println(wrapText(errorMsg));
    }
  }
@@ -1002,7 +1006,7 @@
          line.append(getCellValue(tableModel.getValueAt(i, j), desc));
          getOutputStream().println(wrap(line.toMessage()));
          getOutputStream().println(wrapText(line.toMessage()));
        }
      }
    }
@@ -1202,7 +1206,7 @@
      buf.append(" ");
    }
    buf.append(" ").append(String.valueOf(value));
    getOutputStream().println(wrap(buf.toMessage()));
    getOutputStream().println(wrapText(buf.toMessage()));
  }
  private Message centerTitle(Message text)
@@ -1295,4 +1299,17 @@
  public boolean isVerbose() {
    return true;
  }
  /**
   * Wraps a message accoring to client tool console width.
   * @param text to wrap
   * @return raw message representing wrapped string
   */
  private Message wrapText(Message text)
  {
    return Message.raw(
        StaticUtils.wrapText(text, getCommandLineMaxLineWidth()));
  }
}
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1411,18 +1411,6 @@
            text.indexOf('>') != -1);
  }
  /**
   * Wraps a message accoring to client tool console width.
   * @param text to wrap
   * @return raw message representing wrapped string
   */
  static public Message wrap(Message text)
  {
    return Message.raw(
            org.opends.server.util.StaticUtils.wrapText(text,
                    getCommandLineMaxLineWidth()));
  }
  private static EmptyPrintStream emptyStream = new EmptyPrintStream();
  /**