public static void install(@NotNull JComponent component, @Nullable Runnable whenPerformed) {
    onEnterKey(component, () -> {
      if (Registry.is("edit.source.on.enter.key.disabled") ||
          isOverriddenByAction(IdeActions.ACTION_EDIT_SOURCE) ||
          isOverriddenByAction(IdeActions.ACTION_VIEW_SOURCE)) {
        return false;
      }

      List<Navigatable> navigatables = getNavigatables(DataManager.getInstance().getDataContext(component));
      // nowhere to navigate
      if (navigatables.isEmpty()) {
        return false;
      }

      boolean requestFocus = AdvancedSettings.getBoolean("edit.source.on.enter.key.request.focus.in.editor");
      for (Navigatable navigatable : navigatables) {
        navigatable.navigate(requestFocus);
      }
      if (whenPerformed != null) {
        whenPerformed.run();
      }
      return true;
    });
  }
public static void install(@NotNull JComponent component, @Nullable Runnable whenPerformed)