void (@NotNull AnActionEvent event) { @Nullable Component component = event.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT); Window window = ComponentUtil.getWindow(component); boolean enabled = isEnabledFor(window); if (enabled && Registry.is("no.window.actions.in.editor")) { Editor editor = event.getData(CommonDataKeys.EDITOR); enabled = editor == null || !editor.getContentComponent().hasFocus(); } event.getPresentation().setEnabled(enabled); }