Ejemplo n.º 1
0
  /**
   * Formats this comment region.
   *
   * @param indentation the indentation of this comment region
   * @param width the maximal width of text in this comment region measured in average character
   *     widths
   */
  protected void formatRegion(final String indentation, final int width) {

    final int last = fLines.size() - 1;
    if (last >= 0) {

      CommentLine lastLine = (CommentLine) fLines.get(last);
      CommentRange lastRange = lastLine.getLast();
      lastLine.formatLowerBorder(lastRange, indentation, width);

      CommentLine previous;
      CommentLine next = null;
      CommentRange range = null;
      for (int line = last; line >= 0; line--) {

        previous = next;
        next = (CommentLine) fLines.get(line);

        range = next.formatLine(previous, range, indentation, line);
      }
      next.formatUpperBorder(range, indentation, width);
    }
  }