Class WebTreeControlDepictor<C extends TreeControl>

Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>

public class WebTreeControlDepictor<C extends TreeControl> extends AbstractDecoratedWebComponentDepictor<C>
Strategy for rendering a tree component as an XHTML <div> element.
Author:
Garret Wilson
  • Field Details

    • TREE_NODE_COLLAPSED_IMAGE_RESOURCE_KEY

      public static final String TREE_NODE_COLLAPSED_IMAGE_RESOURCE_KEY
      The resource bundle key for the tree node expanded image URI.
      See Also:
    • TREE_NODE_EXPANDED_IMAGE_RESOURCE_KEY

      public static final String TREE_NODE_EXPANDED_IMAGE_RESOURCE_KEY
      The resource bundle key for the tree node collapsed image URI.
      See Also:
    • TREE_NODE_LEAF_IMAGE_RESOURCE_KEY

      public static final String TREE_NODE_LEAF_IMAGE_RESOURCE_KEY
      The resource bundle key for the tree node leaf image URI.
      See Also:
  • Constructor Details

    • WebTreeControlDepictor

      public WebTreeControlDepictor()
      Default constructor using the XHTML <div> element.
  • Method Details

    • getTreeNodeID

      public long getTreeNodeID(TreeNodeModel<?> treeNode)
      Determines the ID of the given tree node in this view. If the tree node has no ID assigned, one will be generated.
      Parameters:
      treeNode - The tree node for which an ID should be returned.
      Returns:
      The unique ID of the given tree node.
    • getTreeNode

      public TreeNodeModel<?> getTreeNode(long treeNodeID)
      Determines the tree node associated with the given ID.
      Parameters:
      treeNodeID - An ID assigned to a tree node.
      Returns:
      The tree node associated with the given ID, or null if there is no tree node associated with the ID.
    • processEvent

      public void processEvent(PlatformEvent event)
      Description copied from class: AbstractComponentDepictor
      Processes an event from the platform.

      This implementation handles PlatformFocusEvent.

      Specified by:
      processEvent in interface Depictor<C extends TreeControl>
      Overrides:
      processEvent in class AbstractComponentDepictor<C extends TreeControl>
      Parameters:
      event - The event to be processed.
    • getTreeNodeStyleIDs

      protected <T> Set<String> getTreeNodeStyleIDs(TreeModel treeModel, TreeNodeModel<T> treeNode, String prefix, String suffix)
      Retrieves the style IDs for a tree node.
      Type Parameters:
      T - The type of value contained in the tree node. This version returns the base tree node style ID GuiseCSSStyleConstants.TREE_NODE_CLASS with the given prefix/suffix, if any, along with styles representing the expanded or collapsed state and whether the node is a leaf.
      Parameters:
      treeModel - The component model.
      treeNode - The tree node.
      prefix - The prefix that needs to be added to the base style, or null if there is no prefix to add.
      suffix - The suffix that needs to be added to the base style, or null if there is no suffix to add.
      Returns:
      The style IDs for the tree node.
    • depictChildren

      protected void depictChildren() throws IOException
      Description copied from class: AbstractComponentDepictor
      Depicts any child components.
      Overrides:
      depictChildren in class AbstractComponentDepictor<C extends TreeControl>
      Throws:
      IOException - if there is an error updating the child depictions.
    • updateTreeNodeView

      protected <T> void updateTreeNodeView(TreeModel treeModel, TreeNodeModel<T> treeNode) throws IOException
      Updates the view of a tree node.
      Type Parameters:
      T - The type of value contained in the tree node.
      Parameters:
      treeModel - The component model.
      treeNode - The tree node.
      Throws:
      IOException - if there is an error updating the tree node view.
    • updateTreeNodeChildViews

      protected <T> void updateTreeNodeChildViews(TreeModel treeModel, TreeNodeModel<T> treeNode) throws IOException
      Updates the views of a tree node's children, if any.
      Type Parameters:
      T - The type of value contained in the tree node.
      Parameters:
      treeModel - The component model.
      treeNode - The tree node the views of the children of which should be updated.
      Throws:
      IOException - if there is an error updating the child tree node views.