| Graphic Components > Table Component > Architecture of the Table Component > The Adapter |
The Adapter |
INDEX
PREVIOUS
NEXT
|
The table adapter converts business objects retrieved from the associated data source to table rows. The table adapter is defined by the interface IlpListAdapter. This adapter does not create representation objects in a table model but in a list model. This list model and the representation objects it contains are transformed into a table model at the level of the table component.
The default table adapter implementation provides the following services:
The following figure shows the table adapter classes:
A given IlpListAdapter instance can only represent IlpClass objects of the same type. So that only objects of a specific class or of one of its subclasses be represented, you should set this class with the setAcceptedClass method.
The following code plugs an IltDefaultDataSource to an IlpTableModel through an IlpTableListAdapter.
IlpTable ilpTable = new IlpTable(); IltDefaultDataSource dataSource = new IltDefaultDataSource(); ilpTable.setDataSource(dataSource, acceptedClass);
IlpTableListAdapter adapter = ilpTable.getAdapter();
IlpTable ilpTable= new IlpTable(); IlpTableListAdapter adapter = new IlpTableListAdapter(); ilpTable.setAdapter(adapter); ilpTable.setAcceptedClass(acceptedClass); IltDefaultDataSource dataSource = new IltDefaultDataSource(); ilpTable.setDataSource(dataSource);
List adapters use by default an IlpTableRowFactory that creates representation objects of type IlpDefaultTableRow.
You can create a table adapter implicitly by instantiating the IlpTable component, as shown in the following example.
The table adapter converts business objects retrieved from the associated data source to table rows. The new representation objects are created by a representation object factory. The factory interface varies according to the type of adapter. The table adapter uses by default an IlpTableRowFactory that creates representation objects of type IlpDefaultTableRow.
Adapter interfaces are read-only, meaning that they do not perform editing operations on the representation objects they create.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |