AnActionEvent (InputEvent inputEvent, int modifiers) { Presentation presentation = myAction.getTemplatePresentation().clone(); DataContext parent = DataManager.getInstance().getDataContext(myInplaceButton); DataContext dataContext = CustomizedDataContext.create(parent, dataId -> { if (CommonDataKeys.VIRTUAL_FILE.is(dataId)) { Object object = myTabInfo.getObject(); if (object instanceof VirtualFile) return object; } return null; }); return new AnActionEvent(inputEvent, dataContext, myPlace != null ? myPlace : ActionPlaces.UNKNOWN, presentation, ActionManager.getInstance(), modifiers); }