$package("js.ui.tree");

js.ui.tree.AbstractTreeModel = function (){
}
js.ui.tree.AbstractTreeModel.prototype.owner = null;
js.ui.tree.AbstractTreeModel.prototype.root = null;
js.ui.tree.AbstractTreeModel.prototype.asksAllowsChildren = true;

js.ui.tree.AbstractTreeModel.prototype.setRoot = function(value){
	this.root = value;
}
js.ui.tree.AbstractTreeModel.prototype.getRoot = function(){
	return this.root;
}
//js.ui.tree.AbstractTreeModel.prototype.getIndexOfChild = function(){}

js.ui.tree.AbstractTreeModel.prototype.getIndexOfChild = function(parent, child){ 
	if(parent == null || child == null) return -1; 
	else return parent.getIndex(child); 
}
js.ui.tree.AbstractTreeModel.prototype.getChild = function(parent, index){ 
	return parent.GetChildAt(index); 
}
js.ui.tree.AbstractTreeModel.prototype.getChildCount = function(parent){ 
	return parent.getChildCount(); 
}
js.ui.tree.AbstractTreeModel.prototype.isLeaf = function(node){  
	if(this.asksAllowsChildren)	return !node.getAllowsChildren(); 
	else return node.isLeaf(); 
}

