AnActionEvent (AnAction a, final VirtualFile[] files, final Project p) { DataContext dc = id -> { if (VcsDataKeys.VIRTUAL_FILES.is(id)) return JBIterable.of(files); if (CommonDataKeys.EDITOR.is(id)) return editor; if (CommonDataKeys.PROJECT.is(id)) return p; return null; }; return AnActionEvent.createFromAnAction(a, null, "", dc); }