void (final Component component) { if (component != null && component.isShowing() && isAutoScrollMode()) { myAutoScrollAlarm.cancelAllRequests(); myAutoScrollAlarm.addRequest( () -> { if (component.isShowing()) { //for tests if (!needToCheckFocus() || UIUtil.hasFocus(component)) { scrollToSource(component); } } }, Registry.intValue("ide.autoscroll.to.source.delay", 100) ); } }