Class HtmlTreeCellRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, TreeCellRenderer

public class HtmlTreeCellRenderer extends DefaultTreeCellRenderer implements TreeCellRenderer
Renderer for tree view of a NodeList.
See Also:
  • Constructor Details

    • HtmlTreeCellRenderer

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

    • 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:
    • 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.
    • 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.
      Specified by:
      getTreeCellRendererComponent in interface TreeCellRenderer
      Overrides:
      getTreeCellRendererComponent in class DefaultTreeCellRenderer
      Parameters:
      tree -
      value -
      selected -
      expanded -
      leaf -
      row -
      hasFocus -
      Returns:
      See Also: