private static @Nullable ProgressWindow castProgress(@NotNull ProgressIndicator indicator) {
    if (indicator instanceof ProgressWindow) {
      return (ProgressWindow)indicator;
    }
    return null;
  }
private static @Nullable ProgressWindow castProgress(@NotNull ProgressIndicator indicator)