private static void appendAbbreviated(StringBuilder to,
                                          String text,
                                          int start,
                                          int end,
                                          FontMetrics metrics,
                                          int maxWidth,
                                          boolean replaceLineTerminators,
                                          boolean appendEllipsis,
                                          char returnSymbol) {
      int abbreviationLength =
        abbreviationLength(text, start, end, metrics, maxWidth, replaceLineTerminators, appendEllipsis, returnSymbol);

      if (!replaceLineTerminators) {
        to.append(text, start, start + abbreviationLength);
      }
      else {
        CharSequenceSubSequence subSeq = new CharSequenceSubSequence(text, start, start + abbreviationLength);
        for (LineTokenizer lt = new LineTokenizer(subSeq); !lt.atEnd(); lt.advance()) {
          to.append(subSeq, lt.getOffset(), lt.getOffset() + lt.getLength());
          if (lt.getLineSeparatorLength() > 0) {
            to.append(returnSymbol);
          }
        }
      }

      if (appendEllipsis && abbreviationLength != end - start) {
        to.append(ABBREVIATION_SUFFIX);
      }
    }
private static void appendAbbreviated(StringBuilder to,
                                          String text,
                                          int start,
                                          int end,
                                          FontMetrics metrics,
                                          int maxWidth,
                                          boolean replaceLineTerminators,
                                          boolean appendEllipsis,
                                          char returnSymbol)