|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.openswing.swing.table.model.client.VOListTableModel
Title: OpenSwing Framework
Description: TableModel based on a ValueObject list.
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Constructor Summary | |
VOListTableModel(VOListAdapter fieldAdapter,
VOListTableModelListener modelListener)
|
Method Summary | |
void |
addObject(ValueObject object)
Add a ValueObject to TableModel. |
void |
clear()
Remove all ValueObjects from the data vector. |
void |
clearModified()
Reset the modification flag for this model. |
java.util.ArrayList |
getChangedRowIndexes()
|
int[] |
getChangedRowNumbers()
|
java.util.ArrayList |
getChangedRows()
|
java.lang.Class |
getColumnClass(int column)
|
int |
getColumnCount()
|
java.lang.String |
getColumnName(int column)
|
int |
getColumnType(int column)
|
java.util.Vector |
getDataVector()
|
java.lang.Object |
getField(int row,
java.lang.String attributeName)
Get value within a value object, for the specified attribute name. |
int |
getMode()
|
ValueObject |
getObjectForRow(int row)
|
java.util.ArrayList |
getOldVOsChanged()
|
int |
getRowCount()
|
int |
getRowForObject(ValueObject object)
|
java.lang.Object |
getValueAt(int row,
int column)
|
java.lang.Class |
getValueObjectType()
|
void |
insertObjectAt(ValueObject object,
int row)
Insert a ValueObject at the specified position in the data vector. |
boolean |
isCellEditable(int row,
int column)
|
boolean |
isModified()
|
void |
removeObjectAt(int row)
Remove the ValueObject at the specified position from the data vector. |
void |
setField(int row,
java.lang.String attributeName,
java.lang.Object value)
Set value within a value object, for the specified attribute name. |
void |
setMode(int mode)
Set the current edit grid mode; default value: READONLY. |
boolean |
setValue(java.lang.Object value,
int row,
int column)
Set the value at the specified row and column in the TableModel, only if: - the grid is editable and the value is valid (i.e. |
void |
setValueAt(java.lang.Object value,
int row,
int column)
Set the value at the specified row and column in the TableModel. |
void |
updateObjectAt(int row)
Notify the model that the ValueObject at the given row has been updated. |
void |
updateObjectAt(ValueObject object,
int row)
Update TableModel with the ValueObject. |
void |
updateValueObjectsAt(int[] rowNumbers,
ValueObject[] objects)
Update ValueObjects into TableModel for the specified rows. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VOListTableModel(VOListAdapter fieldAdapter, VOListTableModelListener modelListener)
fieldAdapter
- adapter che collega modello dati e value objectMethod Detail |
public final java.lang.String getColumnName(int column)
column
- index of the column
public final int getColumnType(int column)
column
- index of the column
public final void addObject(ValueObject object)
object
- ValueObject
to addpublic final void insertObjectAt(ValueObject object, int row)
object
- ValueObject
to addrow
- row at which to insert the objectpublic final void updateObjectAt(int row)
row
- row of the updated objectpublic final void clear()
public final void removeObjectAt(int row)
row
- row of the object to removepublic final int getRowCount()
public final int getColumnCount()
public final java.lang.Object getValueAt(int row, int column)
row
- row indexcolumn
- column index
public final ValueObject getObjectForRow(int row)
row
- row index
ValueObject
represented in the given rowgetRowForObject(org.openswing.swing.message.receive.java.ValueObject)
public final int getRowForObject(ValueObject object)
object
- ValueObject
to locate
getObjectForRow(int)
public final boolean isModified()
true
if modifications have been made, and false
otherwiseclearModified()
public final void clearModified()
isModified()
public final java.lang.Class getColumnClass(int column)
column
- column index
Class
object for the specified columnpublic final void updateObjectAt(ValueObject object, int row)
object
- new ValueObjectrow
- row indexpublic final java.util.Vector getDataVector()
public final boolean isCellEditable(int row, int column)
row
- row indexcolumn
- column index
true
if the cell at the given row and column is editable and
false
otherwise. The editable state is based on FieldAdapter and on current grid edit mode.public final void setMode(int mode)
mode
- current edit grid modepublic final int getMode()
public final void setValueAt(java.lang.Object value, int row, int column)
row
- row indexcolumn
- column indexvalue
- new object for the specified coordinatespublic final java.lang.Object getField(int row, java.lang.String attributeName)
row
- row index
public final void setField(int row, java.lang.String attributeName, java.lang.Object value)
row
- row indexvalue
- new Object to set onto ValueObjectpublic final boolean setValue(java.lang.Object value, int row, int column)
true
)
- the grid is in read only mode
row
- row indexcolumn
- column indexvalue
- new object for the specified coordinates
true
if value being setted is valid, false
otherwisepublic final java.util.ArrayList getChangedRows()
public final java.util.ArrayList getChangedRowIndexes()
public final int[] getChangedRowNumbers()
public final void updateValueObjectsAt(int[] rowNumbers, ValueObject[] objects)
rowNumbers
- row indexes in TableModelobjects
- ValueObject to update into TableModelpublic final java.lang.Class getValueObjectType()
public final java.util.ArrayList getOldVOsChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |