protected void setSelectionToClient(
      VirtualTreeModelViewer virtualViewer, ILabelProvider labelProvider, VirtualItem findItem) {
    virtualViewer.getTree().setSelection(new VirtualItem[] {findItem});
    ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
    virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.SELECT);
    // Set the force flag to all select delta in order to override model's selection policy.
    stateDelta.accept(
        new IModelDeltaVisitor() {
          @Override
          public boolean visit(IModelDelta delta, int depth) {
            if ((delta.getFlags() & IModelDelta.SELECT) != 0) {
              ((ModelDelta) delta).setFlags(delta.getFlags() | IModelDelta.FORCE);
            }
            return true;
          }
        });
    fClientViewer.updateViewer(stateDelta);

    ISelection selection = fClientViewer.getSelection();
    if (!selection.isEmpty()
        && selection instanceof IStructuredSelection
        && ((IStructuredSelection) selection).getFirstElement().equals(findItem.getData())) {
    } else {
      DebugUIPlugin.errorDialog(
          fClientViewer.getControl().getShell(),
          ActionMessages.VirtualFindAction_0,
          MessageFormat.format(
              ActionMessages.VirtualFindAction_1, new Object[] {labelProvider.getText(findItem)}),
          new Status(
              IStatus.ERROR,
              DebugUIPlugin.getUniqueIdentifier(),
              ActionMessages.VirtualFindAction_1));
    }
  }
 private void collectAllChildren(VirtualItem element, List<VirtualItem> collect) {
   VirtualItem[] children = element.getItems();
   if (children != null) {
     for (int i = 0; i < children.length; i++) {
       if (!children[i].needsLabelUpdate()) {
         collect.add(children[i]);
         collectAllChildren(children[i], collect);
       }
     }
   }
 }