Java Data Sources > Working with the Server/Java Mapping > Lists > Working with List Data Sources
 
Working with List Data Sources
The List data source is represented by an IlsRpList representation object, and each item of the list is represented by an IlsRpElement instance. The example below is based on the server model of the demo network 7. The view defined in this code sample uses these new representation objects to list all the nodes of the network.
view ListNodesView (any containerIndex=0, string containerClass=""):
represent IlsDSRepresentation repres:
any containerIndex = view.containerIndex;
string containerClass = view.containerClass;
string title = "Nodes list view";
subscribe origin Network:
represent IlsRpList list:
string identifier = identifier;
propagate domains;
 
 
subscribe Domain:
propagate nodes;
 
 
subscribe Node:
represent IlsRpElement element:
mandatory ref<IlsRpList> list = view.origin->list;
string label = name;
JList
Rogue Wave® Server offers two predefined connectors to a JList instance. The data model associated with the JList instance can be filled and synchronized with a list data source using the adapter IlsListDS2JListAdapter, or with a column of a table data source using the adapter IlsTableDS2JListAdapter. To easily connect a Swing JList instance to a list or to a column of a table data source, you can use a high-level IlsDSJList object.
JComboBox
Rogue Wave Server offers two predefined connectors to a JComboBox instance. The data model associated with that JComboBox instance can be filled and synchronized with a list data source using the adapter IlsListDS2JComboBoxAdapter or with a column of a table data source using the adapter IlsTableDS2JListAdapter. To easily connect a Swing JComboBox instance to a list or to a column of a table data source, you can use the high level object IlsDSJComboBox.
Adapter Enhancements
Adapters now implement IlPluggableAdapter and IlJPluggableAdapter interfaces. These interfaces allow you to plug and unplug data sources, data model, and graphic components uniformly. These interfaces can be built into your own adapters, and allow you to extend our generic high-level graphic IlsInstancierDSJComponent object.
IlsInstancierDSJComponent
This generic high-level object manages a connection to a server and has the capability to instantiate a data source, an adapter, a data model and a graphic component “on the fly” according to the main representation object of your .ils view specification. The class IlsInstancierDSJComponent already knows all the predefined data sources included in Rogue Wave Server.
To extend this high level object, see IlsJPluggableInstancierFactory.
IlsJPluggableInstancierFactory
This factory allows an instance of IlsInstancierDSJComponent to instantiate a data source, an adapter, a data model, and a graphic component “on the fly” according to the main representation object specified in your .ils view. To extend this model, you must provide the name of a representation class and an instance of IlsJPluggableInstancier. See Table 19.1 below for the predefined associations.
Predefined Associations for IlsJPLuggableInstancierFactory
Representation Object
IlsJPluggableInstancier
Data Source
Adapter
Data Model
Graphic Component
IlsRpList
IlsListDataSource
IlsListDS2JListAdapter
DefaultListModel
JList
IlsRpTable
IlsTableDataSource
IlsDSJTableAdapter
DefaultTableModel
JTable
IlsRpTree
IlsTreeDataSource
IlsDSJTreeAdapter
DefaultTreeModel
JTree
IlsRpGanttModel
IlsGanttDataSource
IlsGanttDS2IlvHierarchyChartAdapter
IlvDefaultGanttModel
IlvGanttChart
IlsRpGraph
IlsGraphDataSource
IlsDSGraphAdapter
IlvGrapher
IlvManagerView
IlsRpSDMModel
IlsSDMDataSource
IlsDSGraphAdapter
IlvDefaultSDMModel
IlvSDMView

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.