public class BaseValueTableModel extends java.lang.Object implements ValueTableModel
Constructor and Description |
---|
BaseValueTableModel()
Creates the base values table.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addColumnMapValues(java.lang.Object columnMapKey,
java.util.List columnList)
Adds the column map values.
|
protected void |
addFixedSizeRow(java.util.List columnList)
Adds the row.
|
protected void |
addReadOnlyColumn(java.lang.String columnName)
Adds a read-only column.
|
protected void |
addRow(java.util.List columnList)
Adds the row.
|
protected void |
appendErrorMessageString(java.lang.String str)
Appends to the error message string.
|
void |
clearErrorMessageString()
Clears any current error message.
|
void |
clearLists()
Clears the lists by setting them to empty immutable lists.
|
void |
clearRows()
Clears all rows and creates the lists if they have not already been created.
|
boolean |
columnsExist()
Determines if the columns exist.
|
protected java.util.Map |
createColumnMap()
Creates a new column map.
|
protected java.util.List |
createColumnNamesList()
Create a new column names list.
|
protected java.util.List |
createFixedSizeList(java.util.Collection c)
Create a new fixed size list.
|
protected java.util.List |
createFixedSizeList(int size)
Create a new emtpy fixed size list.
|
protected java.util.List |
createList()
Create a new list.
|
void |
createLists()
Creates new lists.
|
protected java.util.Map |
createMap()
Creates a new map.
|
protected java.util.List |
createRowsList()
Creates the new rows list.
|
java.lang.Class |
getColumnClass(int columnIndex)
Returns the
Class for all Object instances
in the specified column. |
int |
getColumnCount()
Returns the number of columns in the model.
|
int |
getColumnIndex(java.lang.String columnName)
Gets the column index for the specified column name.
|
protected java.lang.Object |
getColumnMapKey(java.util.List columnList)
Gets the column map key.
|
protected java.util.List |
getColumnMapValues(java.lang.Object columnMapKey)
Gets the column map values.
|
java.lang.String |
getColumnName(int columnIndex)
Returns the name of a column in the model.
|
protected java.util.List |
getColumnNames()
Gets an unmodifiable column names list.
|
protected java.lang.String |
getDefaultColumnName(int columnIndex)
Gets the default column name for the specified column.
|
boolean |
getErrorMessageFlag()
Returns the status of the error message.
|
java.lang.String |
getErrorMessageString()
Returns the current error message (if any).
|
java.lang.Object |
getRawValueAt(int rowIndex,
int columnIndex)
Returns the value (
Object ) at a particular cell in the
table. |
protected java.util.List |
getRow(int rowIndex)
Gets an unmodifiable row.
|
int |
getRowCount()
Returns the number of rows in the model.
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value (
Object ) at a particular cell in the
table. |
void |
importValues(ValueTableModel vtm)
Import the values from the value table model for all rows.
|
protected void |
importValues(ValueTableModel vtm,
int rowIndex)
Import the values from the value table model for the specifed row.
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns
true if the specified cell is editable, and
false if it is not. |
boolean |
isEditable()
Returns
true if the model is editable by default, and
false if it is not. |
protected boolean |
isNull(java.lang.Object valueObj)
Determines if the value is null.
|
protected void |
setColumnNames(int numColumns)
Set the column names list to the default values.
|
protected boolean |
setColumnNames(java.util.List l)
Sets the column names list.
|
protected void |
setColumnNames(ValueTableModel vtm)
Sets the column names list.
|
void |
setEditable(boolean flag)
Determines whether the model is editable by default.
|
protected void |
setErrorMessageString(java.lang.String str)
Sets the error message.
|
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
Sets the value at a particular cell in the table.
|
public void clearErrorMessageString()
public final void clearLists()
public void clearRows()
public boolean columnsExist()
public void createLists()
public java.lang.Class getColumnClass(int columnIndex)
Class
for all Object
instances
in the specified column.getColumnClass
in interface ValueTableModel
columnIndex
- the column index.public int getColumnCount()
getColumnCount
in interface ValueTableModel
public int getColumnIndex(java.lang.String columnName)
getColumnIndex
in interface ValueTableModel
columnName
- the column name.public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface ValueTableModel
columnIndex
- the column index.public boolean getErrorMessageFlag()
public java.lang.String getErrorMessageString()
public int getRowCount()
getRowCount
in interface ValueTableModel
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
Object
) at a particular cell in the
table.getValueAt
in interface ValueTableModel
rowIndex
- the row index.columnIndex
- the column index.public java.lang.Object getRawValueAt(int rowIndex, int columnIndex)
Object
) at a particular cell in the
table.rowIndex
- the row index.columnIndex
- the column index.public void importValues(ValueTableModel vtm)
importValues
in interface ValueTableModel
vtm
- the value table model.protected void importValues(ValueTableModel vtm, int rowIndex)
vtm
- the value table model.rowIndex
- the row index.createLists
public boolean isCellEditable(int rowIndex, int columnIndex)
true
if the specified cell is editable, and
false
if it is not.isCellEditable
in interface ValueTableModel
rowIndex
- the row index of the cell.columnIndex
- the column index of the cell.protected void addReadOnlyColumn(java.lang.String columnName)
columnName
- the column name.public final boolean isEditable()
true
if the model is editable by default, and
false
if it is not.public final void setEditable(boolean flag)
flag
- true if the model is editable, false otherwise.public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface ValueTableModel
aValue
- the value (null
permitted).rowIndex
- the row index.columnIndex
- the column index.protected void addRow(java.util.List columnList)
columnList
- the list of columns for the row.protected void addFixedSizeRow(java.util.List columnList)
columnList
- the list of columns for the row.protected java.lang.Object getColumnMapKey(java.util.List columnList)
columnList
- the list of columns for the row.protected void addColumnMapValues(java.lang.Object columnMapKey, java.util.List columnList)
columnMapKey
- the column map key.columnList
- the list of columns for the row.protected java.util.List getColumnMapValues(java.lang.Object columnMapKey)
columnMapKey
- the column map key.protected void appendErrorMessageString(java.lang.String str)
str
- the error message to append.protected java.util.List createFixedSizeList(int size)
size
- the size of the list.protected java.util.List createFixedSizeList(java.util.Collection c)
c
- the collection whose elements are to be placed into this list.protected java.util.Map createColumnMap()
protected java.util.List createColumnNamesList()
protected java.util.List createList()
protected java.util.Map createMap()
protected java.util.List createRowsList()
protected java.util.List getColumnNames()
protected java.lang.String getDefaultColumnName(int columnIndex)
columnIndex
- the column index.protected java.util.List getRow(int rowIndex)
rowIndex
- the row index.protected boolean isNull(java.lang.Object valueObj)
valueObj
- the value object.protected void setColumnNames(int numColumns)
numColumns
- the number of columns.createLists
protected boolean setColumnNames(java.util.List l)
l
- the column names list.createLists
protected void setColumnNames(ValueTableModel vtm)
vtm
- the value table model.createLists
protected void setErrorMessageString(java.lang.String str)
str
- the error message text to set.