KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > panoptes > model > node > GroupNode


1 package net.sf.panoptes.model.node;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5
6
7 /**
8  * Simple class for use in the treemodel when logical grouping is to be done. This
9  * class does not represent anything else than a group and does not have any other
10  * meaning. Is typically used when the user wants to group MBeans from different domains.
11  *
12  * @author Dag Liodden
13  */

14 public class GroupNode extends NodeSupport {
15     
16     private boolean acceptsChildren = true;
17     
18     /**
19      * Children of this group
20      */

21     private ArrayList JavaDoc children;
22     
23     public GroupNode(Node parent) {
24         super(parent);
25         children = new ArrayList JavaDoc();
26     }
27
28     public GroupNode(Node parent, String JavaDoc name, String JavaDoc description) {
29         this(parent);
30         getConfigDescriptor().setName(name);
31         getConfigDescriptor().setDescription(description);
32         getConfigDescriptor().setIconName(Node.ICON_FOLDER);
33     }
34     
35     public void init() {
36         
37     }
38     
39     public int size() {
40         return children.size();
41     }
42     
43     public void addChild(Node child) {
44         children.add(child);
45     }
46
47     public List JavaDoc getChildren() {
48         return children;
49
50     }
51     public boolean mightHaveChildren() {
52         return true;
53     }
54
55     public void refresh() {
56     
57     }
58
59     public void clear() {
60         children.clear();
61     }
62
63     /* (non-Javadoc)
64      * @see net.sf.panoptes.model.node.Node#getBean()
65      */

66     public Object JavaDoc getBean() {
67         return this;
68     }
69
70
71 }
72
Popular Tags