|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.ujoframework.swing.UjoTableModel<ROW>
public class UjoTableModel<ROW extends Ujo>
An Ujo implementation of TableModel.
| Field Summary | |
|---|---|
protected UjoProperty[] |
columns
Columns definition |
static int |
EVENT_REPAINT_HEADER
A repaint header event. |
protected java.util.List<ROW> |
rows
A data store |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
UjoTableModel(java.lang.Class ujoType)
Creates a new instance of UjoTableModel for all attributes. |
|
UjoTableModel(UjoProperty... columns)
Creates a new instance of UjoTableModel |
|
| Method Summary | |
|---|---|
void |
addRow(ROW row)
Add a row to end of the model. |
ROW |
cloneRow(int rowIndex,
int depth,
java.lang.Object context)
Clone row. |
ROW |
deleteRow(int rowIndex)
Delete row. |
void |
fireTableAllRowUpdated()
Fire an sing, that all rows was updated. |
void |
fireTableColumnUpdated(UjoProperty columnProp)
Fire an sing, that column was updated. |
void |
fireTableHeaderRepainted()
Repaint header |
UjoProperty |
getColumn(int columnIndex)
Convert columnIndex to a UjoProperty. |
java.lang.Class |
getColumnClass(int columnIndex)
Deprecated. Use a method with column type of UjoProperty instead of. |
java.lang.Class |
getColumnClass(UjoProperty column)
Returns the most specific superclass for all the cell values in the column. |
int |
getColumnCount()
Count of table columns. |
int |
getColumnIndex(UjoProperty column)
Returns a table column index. |
java.lang.String |
getColumnName(int columnIndex)
Column Name |
java.lang.String |
getColumnName(UjoProperty column)
Column Name |
ROW |
getRow(int rowIndex)
Returns a row by a parameter. |
int |
getRowCount()
Get Row Count |
int |
getRowIndex(ROW row)
Returns a table column index or -1 if the row was not found. |
ROW |
getRowLast()
Returns the lastRow of the model or null, if the model have got no rows. |
ROW |
getRowNullable(int rowIndex)
Returns a row by a parameter. |
protected UjoManager |
getUjoManager()
Returns an UjoManager |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Deprecated. Use a method with column type of UjoProperty instead of. |
java.lang.Object |
getValueAt(int rowIndex,
UjoProperty column)
Returns a value from the cell. |
protected void |
initData()
An Initialization |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Deprecated. Use a method with column type of UjoProperty instead of. |
boolean |
isCellEditable(int rowIndex,
UjoProperty column)
Is the cell editable? |
void |
setColumns(UjoProperty... columns)
Set columns into table |
void |
setRows(java.util.List<ROW> rows)
Assign a table rows |
void |
setValueAt(java.lang.Object value,
int rowIndex,
int columnIndex)
Deprecated. Use a method with column type of UjoProperty instead of. |
void |
setValueAt(java.lang.Object value,
int rowIndex,
UjoProperty column)
Set a value to a cell of table model. |
void |
sort(java.util.Comparator<Ujo> comparator)
Sort data by a Comparator object. |
void |
sort(UjoProperty... properties)
Sort data by a property list. |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int EVENT_REPAINT_HEADER
protected UjoProperty[] columns
protected java.util.List<ROW extends Ujo> rows
| Constructor Detail |
|---|
public UjoTableModel(UjoProperty... columns)
columns - Columns in a required order.public UjoTableModel(java.lang.Class ujoType)
| Method Detail |
|---|
protected void initData()
protected UjoManager getUjoManager()
public void setRows(java.util.List<ROW> rows)
public int getRowCount()
public int getColumnCount()
public UjoProperty getColumn(int columnIndex)
public void setColumns(UjoProperty... columns)
public final java.lang.Object getValueAt(int rowIndex,
int columnIndex)
public final void setValueAt(java.lang.Object value,
int rowIndex,
int columnIndex)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelpublic final java.lang.String getColumnName(int columnIndex)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModel
public final boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModelpublic final java.lang.Class getColumnClass(int columnIndex)
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModel
public ROW getRow(int rowIndex)
throws java.lang.IndexOutOfBoundsException
rowIndex -
java.lang.IndexOutOfBoundsExceptionpublic ROW getRowNullable(int rowIndex)
rowIndex - public ROW getRowLast()
public java.lang.Object getValueAt(int rowIndex,
UjoProperty column)
public void setValueAt(java.lang.Object value,
int rowIndex,
UjoProperty column)
public java.lang.String getColumnName(UjoProperty column)
public boolean isCellEditable(int rowIndex,
UjoProperty column)
public java.lang.Class getColumnClass(UjoProperty column)
public int getColumnIndex(UjoProperty column)
public int getRowIndex(ROW row)
public ROW deleteRow(int rowIndex)
public void addRow(ROW row)
public ROW cloneRow(int rowIndex,
int depth,
java.lang.Object context)
public void fireTableHeaderRepainted()
public void sort(UjoProperty... properties)
properties - Array of properties. A property value must be comparable.public void sort(java.util.Comparator<Ujo> comparator)
public void fireTableAllRowUpdated()
public void fireTableColumnUpdated(UjoProperty columnProp)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||