void (KeyEvent keyEvent) { if (keyEvent.getKeyCode() != KeyEvent.VK_ALT) return; if (keyEvent.getID() == KeyEvent.KEY_PRESSED) { for (SettingsEditorFragment<?, ?> fragment : myFragments) { JComponent component = fragment.getComponent(); Window window = ComponentUtil.getWindow(component); if (window == null || !window.isFocused()) { return; } if (fragment.isSelected() && fragment.getName() != null && component.getRootPane() != null && !myHints.contains(fragment.toString())) { JComponent hintComponent = createHintComponent(fragment); Rectangle rect = component.getVisibleRect(); if (rect.height < component.getHeight()) { continue; // scrolled out } RelativePoint point = new RelativePoint(component, new Point(rect.x + rect.width - hintComponent.getPreferredSize().width, rect.y - hintComponent.getPreferredSize().height + 5)); HintManager.getInstance().showHint(hintComponent, point, HintManager.HIDE_BY_ANY_KEY, -1); myHints.add(fragment.toString()); } } if (!myHints.isEmpty() && myHintsShownTime == 0) myHintsShownTime = System.currentTimeMillis(); } else if (keyEvent.getID() == KeyEvent.KEY_RELEASED && !myHints.isEmpty()) { HintManager.getInstance().hideAllHints(); Project project = DataManager.getInstance().getDataContext(keyEvent.getComponent()).getData(CommonDataKeys.PROJECT); FragmentStatisticsService.getInstance() .logHintsShown(project, myConfigId, myHints.size(), System.currentTimeMillis() - myHintsShownTime); myHintsShownTime = 0; myHints.clear(); } else { HintManager.getInstance().hideAllHints(); myHintsShownTime = 0; myHints.clear(); } }