Home » xmlbeans-2.5.0-src » org.apache.xmlbeans.samples » xmltree » [javadoc | source]
org.apache.xmlbeans.samples.xmltree
final class: XmlModel [javadoc | source]
java.lang.Object
   org.apache.xmlbeans.samples.xmltree.XmlModel

All Implemented Interfaces:
    TreeModel

Defines a data model for the XmlTree. Through the data model, the tree can retrieve information about the underlying hierarchical data, including the root of the hierarchy, children of specified nodes, and so on. This data model interacts with the underlying XML data through XmlEntry instances (known as "user objects" in the context of JTree data models). The XmlEntry class knows how to retrieve XML-specific hierarchical information as it is represented by the XmlObject XMLBeans type. In other words, from the tree's perspective, XmlEntry wraps XmlObject.
Constructor:
 public XmlModel(XmlEntry entry) 
    Creates a new instance of the model using entry as a root node.
    Parameters:
    entry - The root node.
Method from org.apache.xmlbeans.samples.xmltree.XmlModel Summary:
addTreeModelListener,   getChild,   getChildCount,   getIndexOfChild,   getRoot,   isLeaf,   removeTreeModelListener,   valueForPathChanged
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xmlbeans.samples.xmltree.XmlModel Detail:
 public  void addTreeModelListener(TreeModelListener treeModelListener) 
    Adds a listener.
 public Object getChild(Object node,
    int index) 
    Gets the child of node at index.
 public int getChildCount(Object node) 
    Gets the number of children that node has.
 public int getIndexOfChild(Object parentNode,
    Object childNode) 
    Gets the index of childNode as a child of parentNode.
 public Object getRoot() 
    Gets the root of this model.
 public boolean isLeaf(Object node) 
    Determines whether node has any children, returning true if it doesn't.
 public  void removeTreeModelListener(TreeModelListener treeModelListener) 
    Removes a listener added by addTreeModelListener.
 public  void valueForPathChanged(TreePath treePath,
    Object newValue) 
    Called when the user has altered the value for the item identified by treePath to newValue.