FileDocCategorySizeDatePackage
Category.javaAPI DocApache Struts 2.0.9 Apps3196Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase.ajax.tree

Category

public class Category extends Object

Fields Summary
private static Map
catMap
private long
id
private String
name
private List
children
private boolean
toggle
Constructors Summary
public Category(long id, String name, Category children)

        this.id = id;
        this.name = name;
        this.children = new ArrayList<Category>();
        for (Category child : children) {
            this.children.add(child);
        }

        catMap.put(id, this);
    
Methods Summary
public static org.apache.struts2.showcase.ajax.tree.CategorygetById(long id)


     
        new Category(1, "Root",
                new Category(2, "Java",
                        new Category(3, "Web Frameworks",
                                new Category(4, "Struts"),
                                new Category(7, "Stripes"),
                                new Category(8, "Rife")),
                        new Category(9, "Persistence",
                                new Category(10, "iBatis"),
                                new Category(11, "Hibernate"),
                                new Category(12, "JDO"),
                                new Category(13, "JDBC"))),
                new Category(14, "JavaScript",
                        new Category(15, "Dojo"),
                        new Category(16, "Prototype"),
                        new Category(17, "Scriptaculous"),
                        new Category(18, "OpenRico"),
                        new Category(19, "DWR")));
    
        return catMap.get(id);
    
public java.util.ListgetChildren()

        return children;
    
public longgetId()

        return id;
    
public java.lang.StringgetName()

        return name;
    
public booleanisToggle()

        return toggle;
    
public voidsetChildren(java.util.List children)

        this.children = children;
    
public voidsetId(long id)

        this.id = id;
    
public voidsetName(java.lang.String name)

        this.name = name;
    
public voidtoggle()

        toggle = !toggle;