IDEA-246087 [new run config UI] Improved keyboard navigation to fields
authorDmitry Avdeev <dmitry.avdeev@jetbrains.com>
Tue, 2 Mar 2021 13:57:18 +0000 (16:57 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 2 Mar 2021 14:18:04 +0000 (14:18 +0000)
show hints for visible fragments only

GitOrigin-RevId: 87b518229d070a9af9cadbb9d6820cffc6cee032

platform/platform-api/src/com/intellij/execution/ui/FragmentHintManager.java

index 754ffcacd04da99e910351f126c293edf70c7c48..f90132fdbb5789f3f19d922420a4b5775bf2f277 100644 (file)
@@ -128,9 +128,10 @@ public class FragmentHintManager {
     if (keyEvent.getKeyCode() != KeyEvent.VK_ALT) return;
     if (keyEvent.getID() == KeyEvent.KEY_PRESSED) {
       for (SettingsEditorFragment<?, ?> fragment : myFragments) {
-        if (fragment.isSelected()) {
+        JComponent component = fragment.getComponent();
+        if (fragment.isSelected() && fragment.getName() != null && component.getRootPane() != null) {
           JComponent hintComponent = createHintComponent(fragment);
-          Point northEastOf = RelativePoint.getNorthEastOf(fragment.getComponent()).getScreenPoint();
+          Point northEastOf = RelativePoint.getNorthEastOf(component).getScreenPoint();
           northEastOf.translate(-hintComponent.getPreferredSize().width, -hintComponent.getPreferredSize().height + 5);
           HintManager.getInstance().showHint(hintComponent, RelativePoint.fromScreen(northEastOf), HintManager.HIDE_BY_ANY_KEY, -1);
         }