org.viewaframework.binding.swing.list
Class ListBindingModel<U>

java.lang.Object
  extended by org.viewaframework.binding.swing.list.ListBindingModel<U>
Type Parameters:
U -
All Implemented Interfaces:
EventListener, ListSelectionListener, ListModel, Observable, ObservableModel<U>

public class ListBindingModel<U>
extends Object
implements ListModel, ListSelectionListener, ObservableModel<U>

Author:
Mario Garcia

Field Summary
static String SELECTED_ITEM
           
 
Constructor Summary
ListBindingModel(JList jlist)
           
ListBindingModel(JList jlist, EventList<U> list)
           
 
Method Summary
 void addElement(Object obj)
           
 void addListDataListener(ListDataListener l)
           
 void addPropertyChangeListener(PropertyChangeListener listener)
          This method adds listeners registering all modifications made to registered properties.
 boolean contains(U element)
           
 void firePropertyChange(PropertyChangeEvent evt)
          Fires an event of a specific property
 Object getElementAt(int index)
           
 EventList<U> getModelList()
           
 List<PropertyChangeListener> getPropertyChangeListeners()
          Returns a list of PropertyChangeListener objects
 BeanAdapter<U> getSelectedElementAdapter()
           
 Object getSelectedItem()
           
 int getSize()
           
 void insertElementAt(Object obj, int index)
           
 void removeElement(Object obj)
           
 void removeElementAt(int index)
           
 void removeListDataListener(ListDataListener l)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
          This method removes listeners registering all modifications made to registered properties.
 void setModelList(EventList<U> modelList)
           
 void setSelectedItem(Object anItem)
           
 void valueChanged(ListSelectionEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTED_ITEM

public static final String SELECTED_ITEM
See Also:
Constant Field Values
Constructor Detail

ListBindingModel

public ListBindingModel(JList jlist)

ListBindingModel

public ListBindingModel(JList jlist,
                        EventList<U> list)
Parameters:
list -
Method Detail

addElement

public void addElement(Object obj)

addListDataListener

public void addListDataListener(ListDataListener l)
Specified by:
addListDataListener in interface ListModel

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: Observable
This method adds listeners registering all modifications made to registered properties.

Specified by:
addPropertyChangeListener in interface Observable

contains

public boolean contains(U element)
Specified by:
contains in interface ObservableModel<U>

firePropertyChange

public void firePropertyChange(PropertyChangeEvent evt)
Description copied from interface: Observable
Fires an event of a specific property

Specified by:
firePropertyChange in interface Observable
Parameters:
evt - Triggered event

getElementAt

public Object getElementAt(int index)
Specified by:
getElementAt in interface ListModel

getModelList

public EventList<U> getModelList()
Specified by:
getModelList in interface ObservableModel<U>

getPropertyChangeListeners

public List<PropertyChangeListener> getPropertyChangeListeners()
Description copied from interface: Observable
Returns a list of PropertyChangeListener objects

Specified by:
getPropertyChangeListeners in interface Observable
Returns:
PropertyChangeListener list

getSelectedElementAdapter

public BeanAdapter<U> getSelectedElementAdapter()
Specified by:
getSelectedElementAdapter in interface ObservableModel<U>

getSelectedItem

public Object getSelectedItem()

getSize

public int getSize()
Specified by:
getSize in interface ListModel

insertElementAt

public void insertElementAt(Object obj,
                            int index)

removeElement

public void removeElement(Object obj)

removeElementAt

public void removeElementAt(int index)

removeListDataListener

public void removeListDataListener(ListDataListener l)
Specified by:
removeListDataListener in interface ListModel

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: Observable
This method removes listeners registering all modifications made to registered properties.

Specified by:
removePropertyChangeListener in interface Observable

setModelList

public void setModelList(EventList<U> modelList)
Specified by:
setModelList in interface ObservableModel<U>

setSelectedItem

public void setSelectedItem(Object anItem)

valueChanged

public void valueChanged(ListSelectionEvent e)
Specified by:
valueChanged in interface ListSelectionListener


Copyright © 2010. All Rights Reserved.