Class TreePanel<T extends TreeModel,​I extends TreeNode>

    • Constructor Detail

      • 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 Detail

      • 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