|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
org.norvelle.textcite.gui.adapter.ListModelAdapter
public class ListModelAdapter
ListModelAdapter An adapter to separate our data model cleanly from the GUI layer. Provides a mapping between the ListModel methods and the methods of our data model objects.
Field Summary | |
---|---|
protected ListModelAdaptee |
model
The data source that will serve as the model for the JList. |
protected java.lang.Object |
selectedItem
A data provider to a JList has to maintain state about which item is currently selected. |
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
ListModelAdapter(ListModelAdaptee model)
|
Method Summary | |
---|---|
void |
destroy()
We make sure that the adapted class removes all references to the adaptor, so as not to cause memory leaks. |
void |
fireContentsChanged(java.lang.Object sender,
java.lang.Object data,
int pos,
int pos2)
Just hand on the ContentsChanged signal to the JList that we're serving as the model for. |
void |
fireIntervalAdded(java.lang.Object sender,
java.lang.Object data,
int pos,
int pos2)
Just hand on the IntervalAdded signal to the JList that we're serving as the model for. |
void |
fireIntervalRemoved(java.lang.Object sender,
java.lang.Object data,
int pos,
int pos2)
Just hand on the IntervalRemoved signal to the JList that we're serving as the model for. |
java.lang.Class |
getAdapteeClass()
Returns the class of the adapted object. |
java.lang.Object |
getElementAt(int pos)
|
java.lang.String |
getId()
|
java.lang.Object |
getSelectedItem()
|
int |
getSize()
|
void |
setSelectedItem(java.lang.Object selitem)
|
Methods inherited from class javax.swing.AbstractListModel |
---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
---|
addListDataListener, removeListDataListener |
Field Detail |
---|
protected ListModelAdaptee model
protected java.lang.Object selectedItem
Constructor Detail |
---|
public ListModelAdapter(ListModelAdaptee model)
Method Detail |
---|
public void destroy()
public java.lang.Class getAdapteeClass()
public java.lang.Object getElementAt(int pos) throws java.lang.ArrayIndexOutOfBoundsException
getElementAt
in interface javax.swing.ListModel
java.lang.ArrayIndexOutOfBoundsException
public int getSize()
getSize
in interface javax.swing.ListModel
public java.lang.Object getSelectedItem()
getSelectedItem
in interface javax.swing.ComboBoxModel
public void setSelectedItem(java.lang.Object selitem)
setSelectedItem
in interface javax.swing.ComboBoxModel
public void fireContentsChanged(java.lang.Object sender, java.lang.Object data, int pos, int pos2)
fireContentsChanged
in interface ListModelChangeListener
data
- TODOpublic void fireIntervalRemoved(java.lang.Object sender, java.lang.Object data, int pos, int pos2)
fireIntervalRemoved
in interface ListModelChangeListener
data
- TODOpublic void fireIntervalAdded(java.lang.Object sender, java.lang.Object data, int pos, int pos2)
fireIntervalAdded
in interface ListModelChangeListener
data
- TODOpublic java.lang.String getId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |