else
return parent.getSubprojectLevel();
}
public void add(Node parent,List children,int position,int actionType){
Node p=(parent==null)?root:parent;
// ArrayList trees=new ArrayList();
// extractParents(children,trees);
if (/*trees*/children.size()==0) return;
int subprojectLevel=getChildrenSubprojectLevel(parent);
int childCount=p.getChildCount();
if (position>childCount){
NodeFactory nodeFactory=NodeFactory.getInstance();
for (int i=childCount;i<position;i++){
Node node=nodeFactory.createVoidNode();
setSubprojectLevel(node,subprojectLevel);
p.add(node);
}
}
int j=position;
for (Iterator i=/*trees*/children.iterator();i.hasNext();){
Node node=(Node)i.next();
//if (node.getImpl() instanceof Task) System.out.println("ADD parent="+parent+":"+(parent==null?"X":parent.isInSubproject())+", node="+node+":"+node.isInSubproject());
setSubprojectLevel(node,subprojectLevel);
//if (node.getImpl() instanceof Task) System.out.println("ADD node in sub="+node.isInSubproject());
if (position==-1) p.add(node);
else p.insert(node,j++);