void (@NotNull LightweightHint hint, @NotNull Editor editor, @NotNull HintHint hintInfo, @NotNull Point p, @HintManager.HideFlags int flags, int timeout, boolean reviveOnEditorChange, @Nullable Runnable onHintHidden) { EDT.assertIsEdt(); myHideAlarm.cancelAllRequests(); hideHints(HintManager.HIDE_BY_OTHER_HINT, false, false); if (editor != myLastEditor) { hideAllHints(); } if (!ApplicationManager.getApplication().isUnitTestMode() && !editor.getContentComponent().isShowing()) return; if (!ApplicationManager.getApplication().isActive()) return; updateLastEditor(editor); HintManagerImpl.getPublisher().hintShown(editor, hint, flags, hintInfo); Component component = hint.getComponent(); // Set focus to control so that screen readers will announce the tooltip contents. // Users can press "ESC" to return to the editor. if (myRequestFocusForNextHint) { hintInfo.setRequestFocus(true); myRequestFocusForNextHint = false; } HintManagerImpl.doShowInGivenLocation(hint, editor, p, hintInfo, true); ListenerUtil.addMouseListener(component, new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { myHideAlarm.cancelAllRequests(); } }); ListenerUtil.addFocusListener(component, new FocusAdapter() { @Override public void focusGained(FocusEvent e) { myHideAlarm.cancelAllRequests(); } }); if (BitUtil.isSet(flags, HintManager.HIDE_BY_MOUSEOVER)) { ListenerUtil.addMouseMotionListener(component, new MouseMotionAdapter() { @Override public void mouseMoved(MouseEvent e) { hideHints(HintManager.HIDE_BY_MOUSEOVER, true, false); } }); } myHintsStack.add(new HintManagerImpl.HintInfo(hint, flags, reviveOnEditorChange)); if (timeout > 0) { Timer timer = TimerUtil.createNamedTimer("Hint timeout", timeout, event -> hint.hide()); timer.setRepeats(false); timer.start(); } }