If the tree is to be connected to a back-end application, a data
source and an adapter must be instantiated. The adapter
translates insertions, removals, and updates of
IlpObject instances in the data source into
insertions, removals, and updates of
IlpTreeNode instances in the tree model.The
adapter must be connected both to the data source and to the tree
model.
The tree automatically creates an appropriate adapter (of class
IlpContainmentTreeAdapter). If you want to
use a different adapter, you will need to create one and connect
it to both the data source and the tree component. The adapter
must be an instance of a subclass of
IlpAbstractTreeAdapter.
How to connect a data source to a tree
Component with a custom adapter
IlpTree ilpTree = new IlpTree();
IltDefaultDataSource dataSource = new IltDefaultDataSource();
// Create an instance of a custom adapter
MyAdapter adapter = new MyAdapter(tree.getContext());
// Connect the adapter to the data source
adapter.setDataSource(dataSource);
// Connect the adapter to the tree component
ilpTree.setAdapter(adapter);