public class IlpTableListModel extends IlpAbstractTableModel implements ListModel, ListDataListener
Note: This list model should fire a
ListDataEvent
when:
listenerList
Constructor and Description |
---|
IlpTableListModel()
Default constructor.
|
IlpTableListModel(ListModel model,
IlpExtendedAttributeGroup attributeGroup)
Creates a model using the specified list model and attribute model.
|
Modifier and Type | Method and Description |
---|---|
void |
addListDataListener(ListDataListener l)
Add a listener to the list that is notified each time a change
to the data model occurs.
|
void |
contentsChanged(ListDataEvent e)
Called when the underlying model has changed.
|
protected void |
fireContentsChanged(Object source,
int index0,
int index1)
IlpTableListModel is a List model.
|
protected void |
fireIntervalAdded(Object source,
int index0,
int index1)
AbstractListModel subclasses must call this method after
one or more elements are added to the model.
|
protected void |
fireIntervalRemoved(Object source,
int index0,
int index1)
AbstractListModel subclasses must call this method after
one or more elements are removed from the model.
|
Object |
getElementAt(int index)
Returns the value at the specified index.
|
ListModel |
getModel()
Retrieves the underlying list model.
|
IlpTableRow |
getRow(int rowIndex)
Returns the row at the given index.
|
int |
getRowCount()
Returns the number of rows in the model.
|
int |
getRowIndex(IlpTableRow row)
Returns the index of the specified row.
|
int |
getSize()
Returns the length of the list.
|
void |
intervalAdded(ListDataEvent e)
Called when the underlying model has changed.
|
void |
intervalRemoved(ListDataEvent e)
Called when the underlying model has changed.
|
void |
removeListDataListener(ListDataListener l)
Remove a listener from the list of those notified each time a
change to the data model occurs.
|
void |
setModel(ListModel model)
Sets the underlying list model.
|
getAttributeGroup, getColumn, getColumnClass, getColumnCount, getColumnIndex, getColumnName, getColumns, getValueAt, setAttributeGroup
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
public IlpTableListModel()
public IlpTableListModel(ListModel model, IlpExtendedAttributeGroup attributeGroup)
model
- The list model this table model uses; can be
null
.attributeGroup
- The attribute model this table model uses; can be
null
.public int getSize()
public Object getElementAt(int index)
getElementAt
in interface ListModel
public void addListDataListener(ListDataListener l)
addListDataListener
in interface ListModel
l
- the ListDataListenerpublic void removeListDataListener(ListDataListener l)
removeListDataListener
in interface ListModel
l
- The ListDataListener to be removed.public void intervalAdded(ListDataEvent e)
intervalAdded
in interface ListDataListener
e
- A ListDataEvent
encapsulating the event information.public void intervalRemoved(ListDataEvent e)
intervalRemoved
in interface ListDataListener
e
- A ListDataEvent
encapsulating the event information.public void contentsChanged(ListDataEvent e)
contentsChanged
in interface ListDataListener
e
- A ListDataEvent encapsulating the event information.public int getRowCount()
JTable
object uses this method to determine how many rows it
should display. This method should be fast, as it
is called frequently during rendering.getRowCount
in interface TableModel
public ListModel getModel()
ListModel
; can be null
.public void setModel(ListModel model)
model
- The underlying list model; can be null
.public IlpTableRow getRow(int rowIndex)
getRow
in interface IlpTableModel
rowIndex
- The index of the row to retrieve.IndexOutOfBoundsException
- if index is negative or greater than or
equal to the number of rows.public int getRowIndex(IlpTableRow row)
getRowIndex
in interface IlpTableModel
row
- The row whose index has to be found.protected void fireContentsChanged(Object source, int index0, int index1)
protected void fireIntervalAdded(Object source, int index0, int index1)
source
- The ListModel that changed, typically "this".index0
- One end of the new interval.index1
- The other end of the new interval.EventListenerList
,
IlpDefaultListModel
protected void fireIntervalRemoved(Object source, int index0, int index1)
source
- The ListModel that changed, typically "this".index0
- One end of the new interval.index1
- The other end of the new interval.EventListenerList
,
IlpDefaultListModel
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.