public @Nullable ListPopup createPopup(@NotNull DataContext dataContext, @Nullable ActionGroup extraActions) {
    final VirtualFile virtualFile = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);
    if (virtualFile == null) return null;
    boolean enabled = checkEnabled(virtualFile);
    if (!enabled) return null;
    Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
    FileDocumentManager documentManager = FileDocumentManager.getInstance();
    final Document document = documentManager.getDocument(virtualFile);
    if (!allowDirectories && virtualFile.isDirectory() || document == null && !virtualFile.isDirectory()) return null;

    final byte[] bytes;
    try {
      bytes = virtualFile.isDirectory() ? null : VfsUtilCore.loadBytes(virtualFile);
    }
    catch (IOException e) {
      return null;
    }
    DefaultActionGroup group = createActionGroup(virtualFile, editor, document, bytes, null);
    DefaultActionGroup popupGroup = new DefaultActionGroup();
    if (extraActions != null) {
      popupGroup.add(extraActions);
      popupGroup.addSeparator();
    }
    popupGroup.add(group);

    return JBPopupFactory.getInstance().createActionGroupPopup(getTemplatePresentation().getText(),
      popupGroup, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false);
  }
public @Nullable ListPopup createPopup(@NotNull DataContext dataContext, @Nullable ActionGroup extraActions)