void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); DataContext dataContext = e.getDataContext(); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (editor == null || SystemInfo.isWindows || SystemInfo.isMac) { presentation.setEnabled(false); } else { boolean rightPlace = true; final InputEvent inputEvent = e.getInputEvent(); if (inputEvent instanceof MouseEvent me) { rightPlace = false; if (dataContext.getData(EditorGutter.KEY) == null) { final Component component = SwingUtilities.getDeepestComponentAt(me.getComponent(), me.getX(), me.getY()); rightPlace = !(component instanceof JScrollBar); } } presentation.setEnabled(rightPlace); } }