View Javadoc
1 package net.sf.panoptes.model.node; 2 3 import java.util.Vector; 4 5 6 /*** 7 * Simple class for use in the treemodel when logical grouping is to be done. This 8 * class does not represent anything else than a group and does not have any other 9 * meaning. Is typically used when the user wants to group MBeans from different domains. 10 * 11 * @author Dag Liodden 12 */ 13 public class ComponentGroupNode implements INode { 14 15 private String iconName = null; 16 private boolean acceptsChildren = true; 17 18 private NodeDescriptor configDescriptor = null; 19 20 /*** 21 * Children of this group 22 */ 23 private Vector children; 24 25 /*** 26 * Name of the group 27 */ 28 private String name; 29 30 /*** 31 * Group description 32 */ 33 private String description; 34 35 /*** 36 * 37 */ 38 public ComponentGroupNode(String name, String description) { 39 children = new Vector(); 40 this.name = name; 41 this.description = description; 42 } 43 44 public void addChild(INode child) { 45 children.add(child); 46 } 47 48 /* (non-Javadoc) 49 * @see com.glt.troodon.console.INode#getConfigDescriptor() 50 */ 51 public NodeDescriptor getConfigDescriptor() { 52 if (configDescriptor != null) return configDescriptor; 53 else return new NodeDescriptor(name, description); 54 55 } 56 57 /* (non-Javadoc) 58 * @see com.glt.troodon.console.INode#getChildren() 59 */ 60 public INode[] getChildren() { 61 return (INode[]) children.toArray(new INode[children.size()]); 62 63 } 64 65 /* (non-Javadoc) 66 * @see com.glt.troodon.console.INode#getIconName() 67 */ 68 public String getIconName() { 69 if (iconName != null) return iconName; 70 else return INode.ICON_FOLDER; 71 72 } 73 74 /* (non-Javadoc) 75 * @see net.sf.panoptes.view.configurator.INode#acceptsChildren() 76 */ 77 public boolean acceptsChildren() { 78 return acceptsChildren; 79 } 80 81 /*** 82 * Sets the iconName. 83 * @param iconName The iconName to set 84 */ 85 public void setIconName(String iconName) { 86 this.iconName = iconName; 87 } 88 89 /*** 90 * Sets acceptsChildren. If you don't want this group to accept arbitrary children, set it to true. 91 * @param acceptsChildren The acceptsChildren to set 92 */ 93 public void setAcceptsChildren(boolean acceptsChildren) { 94 this.acceptsChildren = acceptsChildren; 95 } 96 97 /*** 98 * Sets the configDescriptor. 99 * @param configDescriptor The configDescriptor to set 100 */ 101 public void setConfigDescriptor(NodeDescriptor configDescriptor) { 102 this.configDescriptor = configDescriptor; 103 } 104 105 }

This page was automatically generated by Maven