void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) return; VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); boolean image = file != null && ImageFileTypeManager.getInstance().isImage(file); BackgroundImageDialog dialog = new BackgroundImageDialog(project, image ? file.getPath() : null); dialog.showAndGet(); }