DataContext (@Nullable Editor editor, Component component, VirtualFile selectedFile, @NotNull Project project) { return SimpleDataContext.builder() .setParent(DataManager.getInstance().getDataContext(component)) .add(PlatformCoreDataKeys.CONTEXT_COMPONENT, editor == null ? null : editor.getComponent()) .add(CommonDataKeys.PROJECT, project) .add(CommonDataKeys.VIRTUAL_FILE, selectedFile) .build(); }