@Override
  public void uiDataSnapshot(@NotNull DataSink sink) {
    super.uiDataSnapshot(sink);
    sink.set(PlatformCoreDataKeys.HELP_ID, HelpID.ANT);
    sink.set(PlatformDataKeys.TREE_EXPANDER, myProject != null ? myTreeExpander : null);

    Tree tree = myTree;
    if (tree == null) return;
    TreePath[] paths = tree.getSelectionPaths();
    TreePath leadPath = tree.getLeadSelectionPath();
    AntBuildFile currentBuildFile = getCurrentBuildFile();
    sink.lazy(CommonDataKeys.VIRTUAL_FILE_ARRAY, () -> {
      final List<VirtualFile> virtualFiles = collectAntFiles(buildFile -> {
        final VirtualFile virtualFile = buildFile.getVirtualFile();
        if (virtualFile != null && virtualFile.isValid()) {
          return virtualFile;
        }
        return null;
      }, paths);
      return virtualFiles == null? null : virtualFiles.toArray(VirtualFile.EMPTY_ARRAY);
    });
    sink.lazy(PlatformCoreDataKeys.PSI_ELEMENT_ARRAY, () -> {
      final List<PsiElement> elements = collectAntFiles(AntBuildFile::getAntFile, paths);
      return elements == null ? null : elements.toArray(PsiElement.EMPTY_ARRAY);
    });
    sink.lazy(CommonDataKeys.NAVIGATABLE, () -> {
      if (leadPath != null) {
        final DefaultMutableTreeNode node = (DefaultMutableTreeNode)leadPath.getLastPathComponent();
        if (node != null) {
          if (node.getUserObject() instanceof AntTargetNodeDescriptor targetNodeDescriptor) {
            final Navigatable navigatable = targetNodeDescriptor.getTarget().getOpenFileDescriptor();
            if (navigatable != null && navigatable.canNavigate()) {
              return navigatable;
            }
          }
        }
      }
      if (currentBuildFile != null && !myProject.isDisposed()) {
        final VirtualFile file = currentBuildFile.getVirtualFile();
        if (file != null && file.isValid()) {
          return new OpenFileDescriptor(myProject, file);
        }
      }
      return null;
    });
  }
@Override
  public void uiDataSnapshot(@NotNull DataSink sink)