|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.glaivestone.mv.swing.AbstractListHolder | +--com.glaivestone.mv.swing.TableHolder
A table holder is a value holder model which manages both the data model and the selection model for a list of values presented as tabular data in rows and column. Each value in the list corresponds to a row in the table.
Data elements must be instances of TableRow
.
The mapping from the value into a set of column values for rendering that value is provided either by the owner of the table or by a subclass with a point of view on the type of values it holds.
Field Summary |
Fields inherited from class com.glaivestone.mv.swing.AbstractListHolder |
DEFAULT_SELECTION_MODE, MULTI_SELECT_MODE, NOT_FOUND_INDEX, SINGLE_SELECT_MODE |
Constructor Summary | |
TableHolder()
Create a new single-select mode table holder with an empty data model |
|
TableHolder(javax.swing.table.DefaultTableModel dataModel,
javax.swing.ListSelectionModel selectionModel)
Create a new table holder with the specified data and selection models. |
|
TableHolder(int selectionMode)
Create a new table holder with an empty data model which is configured for the specified selection mode. |
Method Summary | |
static java.util.Vector |
asVector(java.lang.Object[] values)
|
boolean |
contains(java.lang.Object aValue)
Answer whether the specified value is contained in the list. |
static javax.swing.table.DefaultTableModel |
createDefaultDataModel()
Create a new instance of the default table data model. |
java.lang.Object |
get(int index)
Answer the value at the specified row position in the table data. |
javax.swing.table.TableModel |
getDataModel()
Answer the data model which holds the table rows. |
java.lang.Object |
getRow(int index)
Answer the row at the specified position in the table data. |
int |
indexOf(java.lang.Object aValue)
Answer the index of the specified value in the list. |
void |
setColumnNames(java.util.List columnNames)
Set the column names of the table. |
void |
setColumnNames(java.lang.String[] columnNames)
Set the column names of the table. |
void |
setData(java.util.List columnNames,
java.util.List rows)
Set the column names and rows of the table. |
void |
setData(java.lang.String[] columnNames,
java.util.List rows)
Set the column names and rows of the table. |
int |
size()
Answer the number of rows in the table. |
Methods inherited from class com.glaivestone.mv.swing.AbstractListHolder |
add, addAll, clear, clearSelection, createDefaultSelectionModel, createDefaultSelectionModel, getSelectedIndex, getSelectedValue, getSelectedValues, getSelectionModel, getSelectionSize, getValues, hasSelection, isMultiSelect, isSingleSelect, remove, remove, selectAll, selectIndex, selectIndex, selectIndices, selectIndices, selectValue, selectValue, selectValues, selectValues, setMultiSelect, setSingleSelect |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TableHolder()
public TableHolder(int selectionMode)
public TableHolder(javax.swing.table.DefaultTableModel dataModel, javax.swing.ListSelectionModel selectionModel)
Method Detail |
public static java.util.Vector asVector(java.lang.Object[] values)
public static javax.swing.table.DefaultTableModel createDefaultDataModel()
public boolean contains(java.lang.Object aValue)
contains
in class AbstractListHolder
public java.lang.Object get(int index)
get
in class AbstractListHolder
java.lang.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= size()).public javax.swing.table.TableModel getDataModel()
public java.lang.Object getRow(int index)
java.lang.IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index >= size()).public int indexOf(java.lang.Object aValue)
indexOf
in class AbstractListHolder
public void setColumnNames(java.lang.String[] columnNames)
public void setColumnNames(java.util.List columnNames)
public void setData(java.lang.String[] columnNames, java.util.List rows)
public void setData(java.util.List columnNames, java.util.List rows)
public int size()
size
in class AbstractListHolder
|
GFL 1.1 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |