void (@NotNull EditorFactoryEvent event) { Project project = event.getEditor().getProject(); if (project != null) { ImageOrColorPreviewService service = project.getServiceIfCreated(ImageOrColorPreviewService.class); if (service != null) { service.detach(event.getEditor()); } } }