Interface TreeModel

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    TreeModelImpl

    public interface TreeModel
    extends Serializable
    A tree view manage a tree structure of items. The tree data is lazy loaded by using the data provider specified at tree view creation.
    Author:
    Bogdan Stefanescu
    • Method Detail

      • getContentProvider

        ContentProvider getContentProvider()
        Gets the content provider used by this tree.
      • setContentProvider

        void setContentProvider​(ContentProvider provider)
        Sets the content provider to be used by this tree.
      • setInput

        void setInput​(Object input)
        Sets the input data.
        Parameters:
        input - (may be null)
      • getInput

        Object getInput()
        Gets the current input of the tree.
        Returns:
        the tree input data. may be null.
      • getRoot

        TreeItem getRoot()
        Get the tree root item, or null if tree has no input.
        Returns:
        the root
      • find

        TreeItem find​(String path)
        Find the item at the given path. Only loaded items are searched. This operation will not load any extra item.
        Parameters:
        path - the path to search
        Returns:
        the item at the given path or null if none
      • findAndReveal

        TreeItem findAndReveal​(String path)
        Find and item given it's path and expand parents if needed. The returned item is not explicitly expanded so it may be collapsed or its children if any not yet loaded
        Parameters:
        path - the path to search
        Returns:
        the item or null if none