public @NlsSafe String getOptimalTextForComponent(File file, JComponent component) {
    return getOptimalTextForComponent(file, component, component.getWidth());
  }
public @NlsSafe String getOptimalTextForComponent(File file, JComponent component)