void (@NotNull EditorMouseEvent e) { myAlarm.cancelAllRequests(); Editor editor = e.getEditor(); if (editor.getUserData(DISABLED) != null) return; if (e.getArea() == EditorMouseEventArea.EDITING_AREA) { MouseEvent mouseEvent = e.getMouseEvent(); Point point = mouseEvent.getPoint(); FoldRegion fold = e.getCollapsedFoldRegion(); TooltipController controller = TooltipController.getInstance(); if (fold != null && !fold.shouldNeverExpand()) { myAlarm.addRequest(() -> { if (editor.getUserData(DISABLED) != null || !editor.getComponent().isShowing() || !fold.isValid() || fold.isExpanded()) return; DocumentFragment range = createDocumentFragment(fold); Point p = SwingUtilities.convertPoint((Component)mouseEvent.getSource(), point, editor.getComponent().getRootPane().getLayeredPane()); controller.showTooltip(editor, p, new DocumentFragmentTooltipRenderer(range), false, FOLDING_TOOLTIP_GROUP); }, TOOLTIP_DELAY_MS); } else { controller.cancelTooltip(FOLDING_TOOLTIP_GROUP, mouseEvent, true); } } }