|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The GridModel interface specifies the methods the Grid will use to interrogate a tabular data model.
The Grid can be set up to display any data model which implements the GridModel interface with a couple of lines of code:
GridModel myData = new MyTableModel(); Grid table = new Grid(myData);
Method Summary | |
int |
getColumnCount()
Returns the number of columns in the model. |
int |
getItemCount()
Returns the number of items this model contains |
int |
getPreferredColumnWidth(int columnIndex)
Returns the preferred width of the column with index columnIndex. |
int |
getPreferredRowHeight(int rowIndex)
Returns the preferred height of the row with index rowIndex. |
int |
getRowCount()
Returns the number of rows in the model. |
Object |
getSelected(int rowIndex,
int colIndex)
Returns the value at the current cell |
String |
getValidChars(int rowIndex,
int colIndex)
Returns the chars that are allowed to be entered into this cell Only makes sense for cells that are editable |
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value for the cell at columnIndex and rowIndex. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns true if the cell at rowIndex and columnIndex is editable. |
boolean |
isHeader(int rowIndex)
Returns if the row is a header. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Sets the value in the cell at columnIndex and rowIndex to aValue. |
Method Detail |
public int getColumnCount()
public int getItemCount()
public int getPreferredColumnWidth(int columnIndex)
columnIndex
- the column which is queried for its widthpublic int getPreferredRowHeight(int rowIndex)
rowIndex
- the row which is queried for its heightpublic int getRowCount()
public Object getSelected(int rowIndex, int colIndex)
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedpublic String getValidChars(int rowIndex, int colIndex)
rowIndex
- the row whose valid chars are requestedcolIndex
- the column whose valid chars are requestedpublic Object getValueAt(int rowIndex, int columnIndex)
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedpublic boolean isCellEditable(int rowIndex, int columnIndex)
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedpublic boolean isHeader(int rowIndex)
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
aValue
- the new valuerowIndex
- the row whose value is to be changedcolumnIndex
- the column whose value is to be changed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |