com.alee.extended.tree
Interface AsyncTreeDataProvider<E extends AsyncUniqueNode>

Type Parameters:
E - custom node type
All Known Implementing Classes:
AbstractTreeDataProvider, FileTreeDataProvider, SampleDataProvider

public interface AsyncTreeDataProvider<E extends AsyncUniqueNode>

This interface provides methods for asynchronous tree data retrieval.

Author:
Mikle Garin

Method Summary
 java.util.Comparator<E> getChildsComparator(E node)
          Returns child nodes comparator for the specified asynchronous tree node.
 Filter<E> getChildsFilter(E node)
          Returns child nodes filter for the specified asynchronous tree node.
 E getRoot()
          Returns asynchronous tree root node.
 boolean isLeaf(E node)
          Returns whether the specified node is leaf (doesn't have any childs) or not.
 void loadChilds(E node, ChildsListener<E> listener)
          Starts loading child nodes for the specified asynchronous tree node.
 

Method Detail

getRoot

E getRoot()
Returns asynchronous tree root node. This request uses the EDT and should be processed quickly.

Returns:
root node

loadChilds

void loadChilds(E node,
                ChildsListener<E> listener)
Starts loading child nodes for the specified asynchronous tree node. When you finish loading childs for the specified node or you failed to load them, simply inform the listener about that. This request uses a separate thread and might take a lot of time to process without having any UI issues.

Parameters:
node - parent node
listener - childs loading progress listener

getChildsComparator

java.util.Comparator<E> getChildsComparator(E node)
Returns child nodes comparator for the specified asynchronous tree node. No sorting applied to childs in case null is returned.

Parameters:
node - parent node
Returns:
child nodes comparator

getChildsFilter

Filter<E> getChildsFilter(E node)
Returns child nodes filter for the specified asynchronous tree node. No filtering applied to childs in case null is returned.

Parameters:
node - parent node
Returns:
child nodes filter

isLeaf

boolean isLeaf(E node)
Returns whether the specified node is leaf (doesn't have any childs) or not. This request uses the EDT and should be processed quickly. If you cannot be sure if the node is leaf or not - simply return false, that will allow the tree to expand this node on request.

Parameters:
node - node
Returns:
true if the specified node is leaf, false otherwise