public @NlsSafe String getShortText(int maxChars) {
      int len = shortText.length();
      if (len > 0 && !trimmed) return shortText;
      if (len >= maxChars && (len - maxChars) * 10 / len == 0) return shortText;
      if (len > maxChars) {
        shortText = StringUtil.first(shortText, maxChars, true);
        trimmed = true;
        return shortText;
      }
      boolean hasSlashR = StringUtil.indexOf(longText, '\r', 0, Math.min(longText.length(), maxChars * 2 + 1)) > 0;
      if (!hasSlashR) {
        String s = StringUtil.first(longText, maxChars, true);
        trimmed = !Strings.areSameInstance(s, longText);
        shortText = StringUtil.convertLineSeparators(s, RETURN_SYMBOL);
      }
      else {
        String s = StringUtil.first(longText, maxChars * 2 + 1, false);
        String s2 = StringUtil.convertLineSeparators(s, RETURN_SYMBOL);
        shortText = StringUtil.first(s2, maxChars, true);
        trimmed = !Strings.areSameInstance(s, longText) || !Strings.areSameInstance(s2, shortText);
      }
      return shortText;
    }
public @NlsSafe String getShortText(int maxChars)