private boolean insertParentNode(DiffNode nodeToInsert) {
   List<DiffNode> nodes = new ArrayList<DiffNode>();
   getAllNodes(nodes, root);
   for (DiffNode node : nodes) {
     if (node.getAncestor() != null
         && ((CompareScript) node.getAncestor())
             .getElement()
             .equals(((CompareScript) nodeToInsert.getAncestor()).getElement())) {
       addChildrenToParent(node, nodeToInsert.getChildren());
       return true;
     }
   }
   return false;
 }
  public void buildTree() {
    for (int i = 0; i < oldExpressions.size(); i++) {
      final Expression oldExpression = oldExpressions.get(i);
      CompareScript left = new CompareScript(oldExpression.getName(), oldExpression);
      left.setElement(oldExpression);
      left.setImage(adapterFactoryLabelProvider.getImage(oldExpression));
      final Expression newExpression = newExpressions.get(i);

      final CompareScript right = new CompareScript(newExpression.getName(), newExpression);
      right.setElement(newExpression);
      right.addContentChangeListener(
          new IContentChangeListener() {

            @Override
            public void contentChanged(IContentChangeNotifier compareScript) {
              if (compareScript instanceof CompareScript) {
                setDirty(true);
                if (getViewer() == null || getViewer().getControl().isDisposed()) return;
                getViewer().refresh(true);
              }
            }
          });
      right.setImage(adapterFactoryLabelProvider.getImage(newExpression));
      DiffNode leaf = new DiffNode(null, Differencer.CHANGE, null, left, right);
      final DiffNode poolNode = buildPathNodes(oldExpression.eContainer(), leaf);
      if (((CompareScript) poolNode.getAncestor()).getElement() instanceof Pool
          && root.getChildren().length == 0) {
        root.add(poolNode);
      }
    }
  }