1 package jde.debugger.gui;
3 import javax.swing.tree.MutableTreeNode;
4 import javax.swing.tree.TreeNode;
6 import jde.debugger.JDEException;
10 /** Base class for displaying different types of references */
11 abstract class ReferenceModel
14 /** Default ReferenceModel constructor */
17 } // ReferenceModel constructor
19 /** Get the number of children.
20 * @return The number of fields that we should be displaying.
22 abstract int getChildCount();
24 /** Returns if the node allows children */
25 abstract boolean getAllowsChildren();
27 // * @throws ClassNotLoadedException If the class hasn't been loaded.
28 // * This shouldn't be possible, but the compiler doesn't know that.
30 /** Create a child at the given index.
31 * @param childIndex index of child to create
32 * @return A tree node for the child at the given index
33 * @throws JDEException If an error occurs.
35 abstract MutableTreeNode createChildAt(int index) throws JDEException;
38 /** Get a string to represent the value of the variable */
39 abstract String getValue();
42 /** Update the values in the children
43 * @param children The array of old child values
45 abstract void updateChildren(TreeNode[] children);
47 /** Convert the TreeNode to an LVTreeNode.
48 * @param node The TreeNode to convert
49 * @return node cast to an LVTreeNode, or null if node is not an
52 protected static LVTreeNode asLVTreeNode(TreeNode node) {
53 if (node instanceof LVTreeNode)
54 return (LVTreeNode) node;
58 } // End of class ReferenceModel