

Public Member Functions | |
| RecursiveChildrenListManager () | |
| RecursiveChildrenListManager (int children) | |
| RecursiveChildrenListManager (int children, int childrenPerParent) | |
| RecursiveChildrenListManager (Class beanClass, int children, int childrenPerParent) | |
| Comparator | getComparator () |
| void | initChildrenList (NodeList nodeList) |
Private Member Functions | |
| Object | createBean (String args) |
Static Private Member Functions | |
| static Constructor | getConstructor (Class clazz) |
Private Attributes | |
| int | count = 0 |
| final int | children |
| final int | childrenPerParent |
| final Class | beanClass |
| final Constructor | beanConstructor |
Static Private Attributes | |
| static final int | DEFAULT_CHILDREN = 10 |
| static final int | DEFAULT_CHILDREN_PER_PARENT = 3 |
| static final Class | DEFAULT_BEAN_CLASS = SimpleDemoBean.class |
an implementation of the ChildrenListManager to be used for testing and quick hacks. It recursively adds children of the same type to the parent, up to the number of children specified. This class is typically used in the following way:
GPNode root = NodeFactory.createNode(new SimpleDemoBean("parent"), new RecursiveChildrenListManager(10, 3));
expl = new TreeExplorer();
expl.setRootNode(root);
This creates a tree, in which you can expand 10 parent nodes
| cern::gp::explorer::test::helpers::RecursiveChildrenListManager::RecursiveChildrenListManager | ( | ) | [inline] |
Constructor to create a tree with a pre-defined number of children. This constructor uses SimpleDemoBean as Beans to display in the tree. If you need to change the default settings use a different constructor.
References DEFAULT_CHILDREN, and DEFAULT_CHILDREN_PER_PARENT.
| cern::gp::explorer::test::helpers::RecursiveChildrenListManager::RecursiveChildrenListManager | ( | int | children | ) | [inline] |
constructor that allows to specify how many times children are added to the parents, when the user opens the branches of the tree. After this number has been reached, no further children will be added to the parent, trying to open further branch of the tree will simply result in leaf nodes.
| children | how many times children shall be added |
References DEFAULT_BEAN_CLASS, and DEFAULT_CHILDREN_PER_PARENT.
| cern::gp::explorer::test::helpers::RecursiveChildrenListManager::RecursiveChildrenListManager | ( | int | children, | |
| int | childrenPerParent | |||
| ) | [inline] |
Constructor that allows to specify (1) how many times children are added to parents when the user opens the branches of the tree and (2) how many children are added to each parent.
| children | how many times children shall be added | |
| childrenPerParent | how many children shall be added to each parent |
References DEFAULT_BEAN_CLASS.
| cern::gp::explorer::test::helpers::RecursiveChildrenListManager::RecursiveChildrenListManager | ( | Class | beanClass, | |
| int | children, | |||
| int | childrenPerParent | |||
| ) | [inline] |
constructor that allows to specify how many times children are added to the parents, and how many sibling children are added each time, and the Bean class to use
| beanClass | the class to use as bean. This class should either have a constructor that accepts a String (preferred) or at least a no-argument constructor. | |
| children | the number of times children shall be added | |
| the | number of sibling children added to each parent |
References beanConstructor, and getConstructor().
| Object cern::gp::explorer::test::helpers::RecursiveChildrenListManager::createBean | ( | String | args | ) | [inline, private] |
helper method, uses the variable beanConstructor to create a new Bean
References beanClass, and beanConstructor.
Referenced by initChildrenList().
| Comparator cern::gp::explorer::test::helpers::RecursiveChildrenListManager::getComparator | ( | ) | [inline] |
Returns a comparator that can be used to sort the collection of nodes managed by this class. null can be returned to specify that the collection should not be sorted. If a comparator is returned it should be able to compare two nodes belonging to the children managed by this manager. An adapter can be used to deal with the bean associated to the node instead of the nodes itself.
null Implements cern::gp::nodes::children::ChildrenManager.
| static Constructor cern::gp::explorer::test::helpers::RecursiveChildrenListManager::getConstructor | ( | Class | clazz | ) | [inline, static, private] |
helper method, tries to find a suitable constructor from the class specified Currently, this must either be a constructor that accepts one string or a no-argument constructor.
Referenced by RecursiveChildrenListManager().
| void cern::gp::explorer::test::helpers::RecursiveChildrenListManager::initChildrenList | ( | NodeList | nodeList | ) | [inline] |
Receives the NodeList that is managed by this manager and that can be used to add or remove children.
This method is called lazily once when the children are going to be displayed. It is similar to the addNotify() of a GUI component.
The implementation of this method should do two things. First it should initialize the list of children with the current children. For that it can use the method addNode of the nodeList. Second, and only if the children are dynamic and are changing based on some external events, it should keep the reference to the given nodeList for future use.
If the children are not dynamic, which means that they don't change after they have been initialized here, there is no need to keep a reference to the nodeList.
| nodelist | the list representing the children managed by this manager |
Implements cern::gp::nodes::children::ChildrenListManager.
References cern::gp::nodes::children::NodeList::addNode(), children, childrenPerParent, count, and createBean().
final Class cern::gp::explorer::test::helpers::RecursiveChildrenListManager::beanClass [private] |
Referenced by createBean().
final Constructor cern::gp::explorer::test::helpers::RecursiveChildrenListManager::beanConstructor [private] |
Referenced by createBean(), and RecursiveChildrenListManager().
final int cern::gp::explorer::test::helpers::RecursiveChildrenListManager::children [private] |
Referenced by initChildrenList().
final int cern::gp::explorer::test::helpers::RecursiveChildrenListManager::childrenPerParent [private] |
Referenced by initChildrenList().
int cern::gp::explorer::test::helpers::RecursiveChildrenListManager::count = 0 [private] |
Referenced by initChildrenList().
final Class cern::gp::explorer::test::helpers::RecursiveChildrenListManager::DEFAULT_BEAN_CLASS = SimpleDemoBean.class [static, private] |
Referenced by RecursiveChildrenListManager().
final int cern::gp::explorer::test::helpers::RecursiveChildrenListManager::DEFAULT_CHILDREN = 10 [static, private] |
Referenced by RecursiveChildrenListManager().
final int cern::gp::explorer::test::helpers::RecursiveChildrenListManager::DEFAULT_CHILDREN_PER_PARENT = 3 [static, private] |
Referenced by RecursiveChildrenListManager().
1.6.2