Handler (@NotNull AnActionEvent e) { Project project = e.getProject(); EditorWindow currentWindow = e.getData(EditorWindow.DATA_KEY); Content content = currentWindow != null ? null : getContentFromEvent(e); if (content != null && content.isPinnable()) { return createHandler(content); } final EditorWindow window = currentWindow != null ? currentWindow : project != null ? FileEditorManagerEx.getInstanceEx(project).getCurrentWindow() : null; VirtualFile selectedFile = window == null ? null : getFileFromEvent(e, window); if (selectedFile != null) { return createHandler(window, selectedFile); } return null; }