private void adjustFieldLengthIfNeeded() {
    if (adjustFieldLength.get()) {
      adjustFieldLength.set(false);

      for (Field f : topScreenModel.getFields()) {
        if (f.isAutoAdjust()) {
          int maxLength = topScreenModel.getRecords().stream()
            .map(r -> r.get(f).asString().length()).max(Integer::compareTo).orElse(0);
          fieldLengthMap.put(f, Math.max(maxLength, f.getHeader().length()));
        }
      }
    }
  }
The presentation logic for the top screen.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/screen/top/TopScreenPresenter.java