Class TreeGrid<M>

    • Constructor Detail

      • TreeGrid

        public TreeGrid​(TreeStore<M> store,
                        ColumnModel<M> cm,
                        ColumnConfig<M,​?> treeColumn)
        Creates a new tree grid.
        Parameters:
        store - the tree store
        cm - the column model
        treeColumn - the tree column
    • Method Detail

      • collapseAll

        public void collapseAll()
        Collapses all nodes.
      • expandAll

        public void expandAll()
        Expands all nodes.
      • findNode

        public Tree.TreeNode<M> findNode​(com.google.gwt.dom.client.Element target)
        Returns the tree node for the given target.
        Parameters:
        target - the target element
        Returns:
        the tree node or null if no match
      • getAppearance

        public GridView.GridAppearance getAppearance()
        Returns the grid appearance.
        Returns:
        the grid appearance
      • getIconProvider

        public IconProvider<M> getIconProvider()
        Returns the model icon provider.
        Returns:
        the icon provider
      • getStyle

        public TreeStyle getStyle()
        Returns the tree style.
        Returns:
        the tree style
      • getTreeAppearance

        public Tree.TreeAppearance getTreeAppearance()
        Returns the tree appearance.
        Returns:
        the tree appearance
      • getTreeColumn

        public ColumnConfig<M,​?> getTreeColumn()
        Returns the column that represents the tree nodes.
        Returns:
        the tree column
      • getTreeLoader

        public TreeLoader<M> getTreeLoader()
        Returns the tree loader.
        Returns:
        the tree loader or null if not specified
      • getTreeStore

        public TreeStore<M> getTreeStore()
        Returns the tree's tree store.
        Returns:
        the tree store
      • getTreeView

        public TreeGridView<M> getTreeView()
        Returns the tree's view.
        Returns:
        the view
      • isAutoExpand

        public boolean isAutoExpand()
        Returns true if auto expand is enabled.
        Returns:
        the auto expand state
      • isAutoLoad

        public boolean isAutoLoad()
        Returns true if auto load is enabled.
        Returns:
        the auto load state
      • isCaching

        public boolean isCaching()
        Returns true when a loader is queried for it's children each time a node is expanded. Only applies when using a loader with the tree store.
        Returns:
        true if caching
      • isExpanded

        public boolean isExpanded​(M model)
        Returns true if the model is expanded.
        Parameters:
        model - the model
        Returns:
        true if expanded
      • isExpandOnDoubleClick

        public boolean isExpandOnDoubleClick()
        Returns the expand on double click state.
        Returns:
        the expand on double click state
      • isExpandOnFilter

        public boolean isExpandOnFilter()
        Returns the if expand all and collapse all is enabled on filter changes.
        Returns:
        the expand all collapse all state
      • isLeaf

        public boolean isLeaf​(M model)
        Returns true if the model is a leaf node. The leaf state allows a tree item to specify if it has children before the children have been realized.
        Parameters:
        model - the model
        Returns:
        the leaf state
      • reconfigure

        public void reconfigure​(ListStore<M> store,
                                ColumnModel<M> cm)
        Description copied from class: Grid
        Reconfigures the grid to use a different Store and Column Model. The View will be bound to the new objects and refreshed.
        Overrides:
        reconfigure in class Grid<M>
        Parameters:
        store - the new store
        cm - the new column model
      • refresh

        public void refresh​(M model)
        Refreshes the data for the given model.
        Parameters:
        model - the model to be refreshed
      • setAutoExpand

        public void setAutoExpand​(boolean autoExpand)
        If set to true, all non leaf nodes will be expanded automatically (defaults to false).
        Parameters:
        autoExpand - the auto expand state to set.
      • setAutoLoad

        public void setAutoLoad​(boolean autoLoad)
        Sets whether all children should automatically be loaded recursively (defaults to false). Useful when the tree must be fully populated when initially rendered.
        Parameters:
        autoLoad - true to auto load
      • setCaching

        public void setCaching​(boolean caching)
        Sets whether the children should be cached after first being retrieved from the store (defaults to true). When false, a load request will be made each time a node is expanded.
        Parameters:
        caching - the caching state
      • setExpanded

        public void setExpanded​(M model,
                                boolean expand)
        Sets the item's expand state.
        Parameters:
        model - the model
        expand - true to expand
      • setExpanded

        public void setExpanded​(M model,
                                boolean expand,
                                boolean deep)
        Sets the item's expand state.
        Parameters:
        model - the model
        expand - true to expand
        deep - true to expand all children recursively
      • setExpandOnDoubleClick

        public void setExpandOnDoubleClick​(boolean expandOnDoubleClick)
        Determines if the nodes should be expanded and collapsed on double clicks (defaults to true). Set to false when using two clicks to edit inline editing.
        Parameters:
        expandOnDoubleClick - true to expand and collapse on double clicks
      • setExpandOnFilter

        public void setExpandOnFilter​(boolean expandOnFilter)
        Sets whether the tree should expand all and collapse all when filters are applied (defaults to true).
        Parameters:
        expandOnFilter - true to expand and collapse on filter changes
      • setIconProvider

        public void setIconProvider​(IconProvider<M> iconProvider)
        Sets the tree's model icon provider which provides the icon style for each model.
        Parameters:
        iconProvider - the icon provider
      • setLeaf

        public void setLeaf​(M model,
                            boolean leaf)
        Sets the item's leaf state. The leaf state allows control of the expand icon before the children have been realized.
        Parameters:
        model - the model
        leaf - the leaf state
      • setTreeLoader

        public void setTreeLoader​(TreeLoader<M> treeLoader)
        Sets the tree loader.
        Parameters:
        treeLoader - the tree loader
      • setView

        public void setView​(GridView<M> view)
        Description copied from class: Grid
        Sets the grid's view. May only be called before the Grid is first attached.
        Overrides:
        setView in class Grid<M>
        Parameters:
        view - the view to use for this grid
      • toggle

        public void toggle​(M model)
        Toggles the model's expand state.
        Parameters:
        model - the model
      • onBrowserEvent

        public void onBrowserEvent​(com.google.gwt.user.client.Event ce)
        Specified by:
        onBrowserEvent in interface com.google.gwt.user.client.EventListener
        Overrides:
        onBrowserEvent in class Grid<M>