private static @NotNull String buildPlainText(@NotNull JTable table, int[] rows) {
      StringBuilder stringBuilder = new StringBuilder();
      int lastRow = rows[rows.length - 1];

      int columnCount = table.getColumnCount();
      for (int row : rows) {
        for (int col = 0; col < columnCount; col++) {
          String text = getItemAsString(table, row, col);
          stringBuilder.append(text);
          if (col + 1 != columnCount) {
            stringBuilder.append('\t');
          }
        }
        if (lastRow != row) {
          stringBuilder.append('\n');
        }
      }

      return stringBuilder.toString();
    }
private static @NotNull String buildPlainText(@NotNull JTable table, int[] rows)