org.htmlparser.parserapplications.filterbuilder

Class HtmlTreeCellRenderer

public class HtmlTreeCellRenderer extends DefaultTreeCellRenderer implements TreeCellRenderer

Renderer for tree view of a NodeList.
Constructor Summary
HtmlTreeCellRenderer()
Create a new tree cell renderer for Nodes.
Method Summary
ComponentgetTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Render the node for the tree cell.
StringtoHtml(TagNode tag)
Render the tag as HTML.
StringtoText(TextNode node)
Express this string node as a printable string This is suitable for display in a debugger or output to a printout.

Constructor Detail

HtmlTreeCellRenderer

public HtmlTreeCellRenderer()
Create a new tree cell renderer for Nodes.

Method Detail

getTreeCellRendererComponent

public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
Render the node for the tree cell.

Parameters: tree {@inheritDoc } value {@inheritDoc } selected {@inheritDoc } expanded {@inheritDoc } leaf {@inheritDoc } row {@inheritDoc } hasFocus {@inheritDoc }

Returns: {@inheritDoc }

See Also: TreeCellRenderer#getTreeCellRendererComponent(JTree, Object, boolean, boolean, boolean, int, boolean)

toHtml

public String toHtml(TagNode tag)
Render the tag as HTML. This is different from the tag's normal toHtml() method in that it doesn't process children or end tags, just the initial tag, and it also wraps the tag in html a label would expect.

Parameters: tag The tag to convert to HTML.

Returns: A string suitable for rendering the tag.

See Also: toHtml

toText

public String toText(TextNode node)
Express this string node as a printable string This is suitable for display in a debugger or output to a printout. Control characters are replaced by their equivalent escape sequence and contents is truncated to 80 characters.

Parameters: node The node to render.

Returns: A string representation of the string node.

HTML Parser is an open source library released under LGPL. SourceForge.net