Class TreePanel<T extends TreeModel,I extends TreeNode>

Type Parameters:
T - tree model object type
I - node model object type
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public abstract class TreePanel<T extends TreeModel,I extends TreeNode> extends Panel
Represents the content of a tree column cell.
Author:
Matej Knopp
See Also:
  • Constructor Details

    • TreePanel

      public TreePanel(String id, IModel<I> model, int level)
      Constructor.
      Parameters:
      id - component id
      model - model to access the TreeNode
      level - node depth level
  • Method Details

    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class MarkupContainer
    • getIconComponent

      public IconImage getIconComponent()
      Returns the icon component instance.
      Returns:
      icon component
    • getIcon

      protected abstract Icon getIcon(IModel<I> model)
      Return the icon for this node or null if no icon should be used.
      Parameters:
      model - model for the TreeNode
      Returns:
      icon instance or null
    • newNodeComponent

      protected abstract Component newNodeComponent(String id, IModel<I> model)
      Creates a new component for the given TreeNode.
      Parameters:
      id - component ID
      model - model that returns the node
      Returns:
      component for node
    • getDefaultNodeModel

      protected IModel<I> getDefaultNodeModel()
    • newJunctionLink

      protected Component newJunctionLink(MarkupContainer parent, String id, Object node)
      Creates the junction link for given node. Also (optionally) creates the junction image. If the node is a leaf (it has no children), the created junction link is non-functional.
      Parameters:
      parent - parent component of the link
      id - wicket:id of the component
      node - tree node for which the link should be created.
      Returns:
      The link component
    • newLink

      public MarkupContainer newLink(String id, TreePanel.ILinkCallback callback)
      Creates a link of type specified by current linkType. When the links is clicked it calls the specified callback.
      Parameters:
      id - The component id
      callback - The link call back
      Returns:
      The link component
    • onJunctionLinkClicked

      protected abstract void onJunctionLinkClicked(AjaxRequestTarget target, Object node)
      Callback function called after user clicked on an junction link. The node has already been expanded/collapsed (depending on previous status).
      Parameters:
      target - Request target - may be null on non-ajax call
      node - Node for which this callback is relevant