@Override
  public void uiDataSnapshot(@NotNull DataSink sink) {
    super.uiDataSnapshot(sink);
    sink.set(TODO_PANEL_DATA_KEY, this);
    sink.set(PlatformCoreDataKeys.HELP_ID, "find.todoList");

    NodeDescriptor<?> selection = ObjectUtils.tryCast(TreeUtil.getLastUserObject(myTree.getSelectionPath()), NodeDescriptor.class);
    if (selection == null) return;
    sink.lazy(CommonDataKeys.VIRTUAL_FILE, () -> {
      PsiFile file = TodoTreeBuilder.getFileForNodeDescriptor(selection);
      return PsiUtilCore.getVirtualFile(file);
    });
    sink.lazy(CommonDataKeys.PSI_ELEMENT, () -> {
      PsiElement selectedElement = TodoTreeHelper.getInstance(myProject).getSelectedElement(selection);
      if (selectedElement != null) return selectedElement;
      return TodoTreeBuilder.getFileForNodeDescriptor(selection);
    });
    sink.lazy(CommonDataKeys.VIRTUAL_FILE_ARRAY, () -> {
      VirtualFile file = PsiUtilCore.getVirtualFile(TodoTreeBuilder.getFileForNodeDescriptor(selection));
      return file == null ? null : new VirtualFile[]{file};
    });
    sink.lazy(CommonDataKeys.NAVIGATABLE, () -> {
      Object element = selection.getElement();
      if (!(element instanceof TodoFileNode || element instanceof TodoItemNode)) { // allow user to use F4 only on files an TODOs
        return null;
      }
      TodoItemNode pointer = myTodoTreeBuilder.getFirstPointerForElement(element);
      SmartTodoItemPointer value = pointer == null ? null : pointer.getValue();
      return value == null ? null : PsiNavigationSupport.getInstance().createNavigatable(
        myProject,
        value.getTodoItem().getFile().getVirtualFile(),
        value.getRangeMarker().getStartOffset());
    });
  }
@Override
  public void uiDataSnapshot(@NotNull DataSink sink)