DataContext (VirtualFile pomFile) { final DataContext defaultContext = DataManager.getInstance().getDataContext(); return dataId -> { if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } if (CommonDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) { return new VirtualFile[]{pomFile}; } return defaultContext.getData(dataId); }; }