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

jvergara
04.20.2009 aa09acea1d63383816178c2d4cd9637a8cce9721
Refactor some constants.
3 files modified
72 ■■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/task/Task.java 15 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java 14 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/cli/CommandBuilder.java 43 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/task/Task.java
@@ -974,19 +974,8 @@
  /**
   * The separator used to link the lines of the resulting command-lines.
   */
  private final static String LINE_SEPARATOR;
  static
  {
    if (SetupUtils.isWindows())
    {
      LINE_SEPARATOR = " ";
    }
    else
    {
      LINE_SEPARATOR =
   "&nbsp;\\<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
  }
  private final static String LINE_SEPARATOR =
    CommandBuilder.HTML_LINE_SEPARATOR;
  /**
   * Returns the equivalent command line in HTML without font properties.
opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
@@ -72,6 +72,13 @@
   private static final Message LINE_BREAK=
     Message.raw("&#10;"+Constants.HTML_LINE_BREAK);
   private static final Message TAB = new MessageBuilder(SPACE)
   .append(SPACE)
   .append(SPACE)
   .append(SPACE)
   .append(SPACE)
   .toMessage();
  /**
   * Returns the HTML representation of the text without providing any style.
   * @param text the source text from which we want to get the HTML
@@ -378,12 +385,7 @@
   */
  public Message getTab()
  {
    return new MessageBuilder(SPACE)
            .append(SPACE)
            .append(SPACE)
            .append(SPACE)
            .append(SPACE)
            .toMessage();
    return TAB;
  }
  /**
opends/src/server/org/opends/server/util/cli/CommandBuilder.java
@@ -75,6 +75,24 @@
  }
  /**
   * The separator used to link the lines of the resulting command-lines in
   * HTML format.
   */
  public final static String HTML_LINE_SEPARATOR;
  static
  {
    if (SetupUtils.isWindows())
    {
      HTML_LINE_SEPARATOR = "&nbsp;";
    }
    else
    {
      HTML_LINE_SEPARATOR =
     "&nbsp;\\<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
  }
  /**
   * The constructor for the CommandBuilder.
   * @param commandName the command name.
   */
@@ -157,17 +175,32 @@
   */
  public String toString()
  {
    return toString(false);
    return toString(false, LINE_SEPARATOR);
  }
  /**
   * Returns the String representation of this command builder (i.e. what we
   * want to show to the user).
   * @param lineSeparator the String to be used to separate lines of the
   * command-builder.
   * @return the String representation of this command builder (i.e. what we
   * want to show to the user).
   */
  public String toString(String lineSeparator)
  {
    return toString(false, lineSeparator);
  }
  /**
   * Returns the String representation of this command builder (i.e. what we
   * want to show to the user).
   * @param showObfuscated displays in clear the obfuscated values.
   * @param lineSeparator the String to be used to separate lines of the
   * command-builder.
   * @return the String representation of this command builder (i.e. what we
   * want to show to the user).
   */
  private String toString(boolean showObfuscated)
  private String toString(boolean showObfuscated, String lineSeparator)
  {
    StringBuilder builder = new StringBuilder();
    builder.append(commandName);
@@ -194,14 +227,14 @@
      if (arg instanceof BooleanArgument)
      {
        builder.append(LINE_SEPARATOR+argName);
        builder.append(lineSeparator+argName);
      }
      else if (arg instanceof FileBasedArgument)
      {
        for (String value :
          ((FileBasedArgument)arg).getNameToValueMap().keySet())
        {
          builder.append(LINE_SEPARATOR+argName+" ");
          builder.append(lineSeparator+argName+" ");
          if (isObfuscated(arg) && !showObfuscated)
          {
            value = OBFUSCATED_VALUE;
@@ -217,7 +250,7 @@
      {
        for (String value : arg.getValues())
        {
          builder.append(LINE_SEPARATOR+argName+" ");
          builder.append(lineSeparator+argName+" ");
          if (isObfuscated(arg) && !showObfuscated)
          {
            value = OBFUSCATED_VALUE;