ilog.ds.adapter
Class IlListDS2AbstractListModelAdapter

java.lang.Object
  |
  +--ilog.ds.adapter.IlAbstractAdapter
        |
        +--ilog.ds.adapter.IlAbstractListModelAdapter
              |
              +--ilog.ds.adapter.IlListDS2AbstractListModelAdapter
All Implemented Interfaces:
BatchListener, DataSourceListener, EventListener, IlFreezableAdapter, IlPluggableAdapter, ListDataListener, ListDSListener
Direct Known Subclasses:
IlListDS2DefaultComboBoxModelAdapter, IlListDS2DefaultListModelAdapter

public abstract class IlListDS2AbstractListModelAdapter
extends IlAbstractListModelAdapter
implements ListDSListener

This class adapts the events from the IlListDataSource to a Swing AbstractListModel. It does not implement how objects are created or updated, that is, how the properties from the data source are mapped to the Object themselves. This class supports the mapping between the data source objects and the model objects. It stores the data source reference.

See Also:
IlListDataSource, AbstractListModel

Inner classes inherited from class ilog.ds.adapter.IlAbstractListModelAdapter
IlAbstractListModelAdapter.Element
 
Field Summary
protected  IlListDataSource _lds
           
protected  IlListDataSourceEditor _ldse
           
 
Fields inherited from class ilog.ds.adapter.IlAbstractListModelAdapter
_ds2model, _lm, _model2ds
 
Fields inherited from class ilog.ds.adapter.IlAbstractAdapter
_dispatchListeners, _events, _frozenEvents, _inBatchedEvents, _inTransaction, _isFrozen, _syncStrategy
 
Constructor Summary
IlListDS2AbstractListModelAdapter()
           
 
Method Summary
 boolean containsDSElement(Object element)
           
 boolean containsElement(Object dsElement)
           
 void contentsChanged(ListDataEvent e)
           
protected abstract  Object createElement(Map properties)
          Method called to create an element in the list model.
protected  void dispatchBatchedEvent(EventObject event)
           
 void elementChange(ElementEvent e)
          ListDSListener implementation
 Object getDSElement(Object element)
           
 Object getElement(Object dsElement)
           
 IlListDataSource getListDataSource()
          Updates an element in the data source
 IlListDataSourceEditor getListDataSourceEditor()
          Gets the IlListDataSourceEditor in use by this adapter.
protected abstract  void internalElementAdded(ElementEvent evt)
          Internal code called in the Swing event thread
protected abstract  void internalElementRemoved(ElementEvent evt)
           
protected abstract  void internalElementUpdated(ElementEvent evt)
           
 void intervalAdded(ListDataEvent e)
           
 void intervalRemoved(ListDataEvent e)
           
 void plugDataSource(IlDataSource dataSource)
           
 void plugDataSourceEditor(IlDataSourceEditor dataSourceEditor)
           
 void setListDataSource(IlListDataSource lds)
          Sets the IlListDataSource to use.
 void setListDataSourceEditor(IlListDataSourceEditor ldse)
          Sets the IlListDataSource to use.
 void unplugDataSource(IlDataSource dataSource)
           
 void unplugDataSourceEditor(IlDataSourceEditor dataSourceEditor)
           
protected abstract  void updateElement(Object element, Map properties)
          Method called to update an element in the list model.
 
Methods inherited from class ilog.ds.adapter.IlAbstractListModelAdapter
dataSourceChange, getModel, getSynchronizationObject, setModel
 
Methods inherited from class ilog.ds.adapter.IlAbstractAdapter
addDispatchListener, addDSEvent, clearDSEvents, dispatchBatchedEvents, endBatch, firePostDispatchBatchedEventsEvent, firePreDispatchBatchedEventsEvent, GetColor, getSynchronizationStrategy, internalDataSourceChange, isFrozen, isInBatchedEvents, isInTransaction, postDispatchBatchedEvents, preDispatchBatchedEvents, removeDispatchListener, setFrozen, setSynchronizationStrategy, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_lds

protected IlListDataSource _lds

_ldse

protected IlListDataSourceEditor _ldse
Constructor Detail

IlListDS2AbstractListModelAdapter

public IlListDS2AbstractListModelAdapter()
Method Detail

containsDSElement

public boolean containsDSElement(Object element)

getDSElement

public Object getDSElement(Object element)

containsElement

public boolean containsElement(Object dsElement)

getElement

public Object getElement(Object dsElement)

createElement

protected abstract Object createElement(Map properties)
Method called to create an element in the list model.
Parameters:
properties - The properties from the data source
Returns:
the newly created Object, corresponding to the parameters.

updateElement

protected abstract void updateElement(Object element,
                                      Map properties)
Method called to update an element in the list model.
Parameters:
properties - The updated properties from the data source
dsElement - the Object to update

getListDataSource

public IlListDataSource getListDataSource()
Updates an element in the data source
Parameters:
dsElement - The element to update in the data source
element - The corresponding Object / protected abstract void updateDSElement(Object dsElement, Object element); /** Gets the IlListDataSource in use by this adapter.

getListDataSourceEditor

public IlListDataSourceEditor getListDataSourceEditor()
Gets the IlListDataSourceEditor in use by this adapter.

setListDataSource

public void setListDataSource(IlListDataSource lds)
Sets the IlListDataSource to use.

setListDataSourceEditor

public void setListDataSourceEditor(IlListDataSourceEditor ldse)
Sets the IlListDataSource to use.

elementChange

public void elementChange(ElementEvent e)
ListDSListener implementation
Specified by:
elementChange in interface ListDSListener
Following copied from interface: ilog.ds.ListDSListener
Parameters:
e - The event
See Also:
ElementEvent, IlListDataSource

internalElementAdded

protected abstract void internalElementAdded(ElementEvent evt)
Internal code called in the Swing event thread

internalElementUpdated

protected abstract void internalElementUpdated(ElementEvent evt)

internalElementRemoved

protected abstract void internalElementRemoved(ElementEvent evt)

dispatchBatchedEvent

protected void dispatchBatchedEvent(EventObject event)
Overrides:
dispatchBatchedEvent in class IlAbstractAdapter

contentsChanged

public void contentsChanged(ListDataEvent e)
Overrides:
contentsChanged in class IlAbstractListModelAdapter

intervalAdded

public void intervalAdded(ListDataEvent e)
Overrides:
intervalAdded in class IlAbstractListModelAdapter

intervalRemoved

public void intervalRemoved(ListDataEvent e)
Overrides:
intervalRemoved in class IlAbstractListModelAdapter

plugDataSource

public void plugDataSource(IlDataSource dataSource)
                    throws IllegalDataSourceException
Description copied from interface: IlPluggableAdapter
Verify data source type, adapter stores and listens to data source.

unplugDataSource

public void unplugDataSource(IlDataSource dataSource)
Description copied from interface: IlPluggableAdapter
Adapter cancels storing and stops listening to data source.

plugDataSourceEditor

public void plugDataSourceEditor(IlDataSourceEditor dataSourceEditor)
                          throws IllegalDataSourceEditorException
Description copied from interface: IlPluggableAdapter
Verify data source editor type, adapter stores data source editor.

unplugDataSourceEditor

public void unplugDataSourceEditor(IlDataSourceEditor dataSourceEditor)
Description copied from interface: IlPluggableAdapter
Adapter cancels storing of data source editor.