Class Tree<T>

  • All Implemented Interfaces:
    org.jboss.elemento.IsElement, Attachable

    public class Tree<T>
    extends Object
    implements org.jboss.elemento.IsElement, Attachable
    • Constructor Detail

      • Tree

        public Tree​(String id,
                    Node<T> root,
                    DataFunction<T> data)
        Creates a tree with the specified root node. All other nodes are loaded on demand using the provided callback.
      • Tree

        public Tree​(String id,
                    elemental2.core.JsArray<Node<T>> nodes)
        Creates a tree and populates the tree with the specified nodes. This expects all nodes at construction time and does not load nodes on demand.

        If you use this constructor you must ensure that T can be turned into JSON.

    • Method Detail

      • element

        public elemental2.dom.HTMLElement element()
        Specified by:
        element in interface org.jboss.elemento.IsElement<T>
      • attach

        public void attach()
        Initialized the Api instance using the Options given at constructor argument. Make sure to call this method before using any of the API methods. It's safe to call the methods multiple times (the initialization will happen only once).
        Specified by:
        attach in interface Attachable
      • destroy

        public void destroy()
      • getSelected

        public Node<T> getSelected()
      • refreshNode

        public void refreshNode​(String id)
      • selectNode

        public void selectNode​(String id)
      • selectNode

        public void selectNode​(String id,
                               boolean closeSelected)
      • search

        public void search​(String query)
      • clearSearch

        public void clearSearch()
      • openAllNodes

        public void openAllNodes()