org.htmlparser.parserapplications.filterbuilder
Class HtmlTreeModel
- TreeModel
public class HtmlTreeModel
implements TreeModel
Quick and dirty tree model for HTML nodes.
void | addTreeModelListener(TreeModelListener l) - Adds a listener for the TreeModelEvent posted after the tree changes.
|
Object | getChild(Object parent, int index) - Returns the child of parent at index index in the parent's child array.
|
int | getChildCount(Object parent) - Returns the number of children of parent.
|
int | getIndexOfChild(Object parent, Object child) - Returns the index of child in parent.
|
Object | getRoot() - Returns the root of the tree.
|
boolean | isLeaf(Object node) - Returns true if node is a leaf.
|
void | removeTreeModelListener(TreeModelListener l) - Removes a listener previously added with addTreeModelListener().
|
void | valueForPathChanged(TreePath path, Object newValue) - Messaged when the user has altered the value for the item identified by path to newValue.
|
mRoot
protected Node mRoot
mTreeListeners
protected Vector mTreeListeners
The list of tree listeners.
HtmlTreeModel
public HtmlTreeModel(NodeList root)
Create an HTML tree view.
root
- The nodes at the root of the tree
(the nodes are wrapped in an Html node that is never seen
because it's the root, but this makes all downstream processing
super-simple because every tree node is then a Node
,
not sometimes a NodeList
at the root).
addTreeModelListener
public void addTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes.
getChild
public Object getChild(Object parent,
int index)
Returns the child of parent at index index in the parent's child array.
getChildCount
public int getChildCount(Object parent)
Returns the number of children of parent.
getIndexOfChild
public int getIndexOfChild(Object parent,
Object child)
Returns the index of child in parent.
getRoot
public Object getRoot()
Returns the root of the tree.
isLeaf
public boolean isLeaf(Object node)
Returns true if node is a leaf.
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener().
valueForPathChanged
public void valueForPathChanged(TreePath path,
Object newValue)
Messaged when the user has altered the value for the item identified by path to newValue.
| © 2005 Derrick Oswald Mai 08, 2008 |
HTML Parser is an open source library released under LGPL. |  |