/**
 * 
 */
package org.richfaces;

import java.util.List;

import org.richfaces.component.UITree;
import org.richfaces.model.SimpleRecursiveNode;

/**
 * @author Nick Belaevski
 *         mailto:nbelaevski@exadel.com
 *         created 25.07.2007
 *
 */
public class TreeModelBean {
	public Boolean adviseNodeOpened(UITree tree) {
		return Boolean.TRUE;
	}

	private SimpleRecursiveNode simpleRecursiveNode;
	
	public TreeModelBean() {
		simpleRecursiveNode = new SimpleRecursiveNode(null, null);
		for (int i = 0; i < 5; i++) {
			SimpleRecursiveNode node2 = new SimpleRecursiveNode(simpleRecursiveNode, "Node " + i);
		
			for (int j = 0; j < 6; j++) {
				SimpleRecursiveNode node3 = new SimpleRecursiveNode(node2, "Node " + i + " " + j);
			
				for (int k = 0; k < 4; k++) {
					SimpleRecursiveNode node4 = new SimpleRecursiveNode(node3, "Node " + i + " " + j + " " + k);
				}
			}
		}
	}
	
	public List getSimpleResursiveNodes() {
		return simpleRecursiveNode.getChildren();
	}
}
