The adapter

The tree adapter converts business objects retrieved from the associated data source to tree nodes. It is defined by the class IlpContainmentTreeAdapter.
The tree adapter retrieves structural information (that is parent/child relationship) about business objects from the associated data source and determines whether an object should appear as a root representation object.
The default tree adapter implementation provides the following services:
The following figure shows the tree adapter classes.
tgo_tree_adapter.png
Containment tree adapter classes
You can create a containment tree adapter implicitly by instantiating the IlpTree component as shown in the following example.

How to create a tree adapter by instantiating a tree component

IlpTree ilpTree = new IlpTree();
IlpDataSource dataSoure = new IlpDefaultDataSource();
ilpTree.setDataSource(dataSource);

How to retrieve a tree adapter

IlpAbstractTreeAdaper adapter = ilpTree.getAdapter();

Representation object factory

The tree adapter converts business objects retrieved from the associated data source to tree nodes. The new representation objects are created by a representation object factory. The factory interface varies according to the type of adapter. The containment tree adapter uses by default an IlpDefaultTreeNodeFactory that creates representation objects of type IlpDefaultTreeNode.

Expansion strategy

The tree adapter uses an expansion strategy to identify whether objects should be loaded or not in the tree model. An expansion strategy defines how an object is going to behave when an expansion is requested, for example, when the user opens a tree node by double-clicking or using the tree expansion handles. The expansion strategy indicates whether load on demand is implemented and provides methods to load and release child nodes.
The tree adapter uses an expansion strategy factory to define the expansion strategy for each tree node that it creates. The default expansion strategy factory implementation ( IlpDefaultTreeExpansionStrategyFactory) verifies the property "expansion" defined for each business object in the cascading style sheet loaded in the component.
The default tree expansion strategy factory supports three types of expansion strategies:
  • IN_PLACE : loads the child objects on demand, as the user expands the parent tree node. In this expansion strategy, tree nodes are considered as parent nodes, only when they have containment relationships defined in the attached data source, through the IlpContainer interface. The child objects should already be loaded in the data source, and should be visible according to the data source filter, if there is one defined.
  • IN_PLACE_MINIMAL_LOADING : loads the child objects on demand, as the user expands the parent tree node. All tree nodes with this expansion strategy are considered as possible parent nodes, and therefore are represented with an expansion icon. If the tree node does not contain child objects, the expansion icon will disappear when the expansion is executed for the first time.
  • NO_EXPANSION : expansion is not supported by the tree node.
For information on how to customize the business object expansion type, see Customizing the expansion of business objects .
The expansion strategy factory can be customized for the adapter either through CSS or through the API. See Configuring the tree component.

Editing

Adapter interfaces are read-only, meaning that they do not perform editing operations on the representation objects they create.