1 package org.gnomekr.potron.web.tree; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 import java.util.Set; 6 7 import org.apache.myfaces.custom.tree2.TreeNode; 8 import org.gnomekr.potron.data.Project; 9 import org.gnomekr.potron.data.Template; 10 11 /*** 12 * ProjectNode.java 13 * @author Xavier Cho 14 * @version $Revision 1.1 $ $Date: 2005/07/20 17:41:35 $ 15 */ 16 public class ProjectNode extends AbstractNavigationNode<Project> { 17 18 private static final long serialVersionUID = -1424746618513672904L; 19 20 public ProjectNode(Project project) { 21 super(project); 22 } 23 24 /*** 25 * @see org.gnomekr.potron.web.tree.AbstractNavigationNode#createChildNodes() 26 */ 27 @Override 28 protected List<TreeNode> createChildNodes() { 29 Set<Template> templates = getUserObject().getTemplates(); 30 31 List<TreeNode> children = new ArrayList<TreeNode>(templates.size()); 32 33 for (Template template : templates) { 34 children.add(new TemplateNode(template)); 35 } 36 37 return children; 38 } 39 }