@Override
  protected @NotNull WidgetState getWidgetState(@Nullable VirtualFile file) {
    Pair<WidgetState, VirtualFile> lastStateAndFilePair = myLastWidgetStateAndFilePair;
    WidgetState widgetState = calcWidgetState(file, Pair.getFirst(lastStateAndFilePair), Pair.getSecond(lastStateAndFilePair));
    myLastWidgetStateAndFilePair = new Pair<>(widgetState, file);
    return widgetState;
  }
@Override
  protected @NotNull WidgetState getWidgetState(@Nullable VirtualFile file)