|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
com.ehsbe.commons.gui.PropertyTableModel
public class PropertyTableModel
A simple Table model for properties.
Field Summary |
---|
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
PropertyTableModel(Map<?,?> props,
String keyName,
String valueName)
Create a new (n,2) table model, where the keys in the Map represent the first column and the values the second column. |
Method Summary | |
---|---|
boolean |
isCellEditable(int row,
int column)
Per contract a value cell is always editable to allow copy operations. |
boolean |
isEditable()
Check, whether the content of value cells is allowed to be changed. |
void |
setEditable(boolean editable)
Set, whether the content of value cells is allowed to be changed. |
void |
setValueAt(Object o,
int row,
int column)
Sets the value only, if the table is editable. |
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyTableModel(Map<?,?> props, String keyName, String valueName)
props
- table to copy to a Object[][2] array. null
will be treated as { {"" , ""} }.keyName
- header name for the key column.
Might be null
.valueName
- header name for the value column.
Might be null
.setEditable(boolean)
,
isEditable()
Method Detail |
---|
public void setEditable(boolean editable)
false
.
editable
- If true
the content of value cells are
changeablepublic boolean isEditable()
true
if content of value cells are changeablepublic boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class DefaultTableModel
row
- column
-
true
for a value cell, otherwise false
.public void setValueAt(Object o, int row, int column)
setValueAt
in interface TableModel
setValueAt
in class DefaultTableModel
o
- row
- column
- setEditable(boolean)
,
isEditable()
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |