|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A table widget model where the programmer is in full control on what rows the table has, both at the client and at the server side. Rows may be added, replaced or removed. Every row may have an additional image displayed with the row. Rows are stored in an ordered collection and may be accessed either by a unique String key or by a zero based row index.
Besides managing the rows, a single or multiple selection state is controlled (interface ISelectable). The selected rows are identified by their String keys.
| Field Summary | |
static int |
S_LAST
The numeric highest style constant used in this class |
static int |
S_MULTI_SELECT
Specify this style constant in the constructor if you want the table to allow multi selection. |
static int |
S_ONE_WAY
A one way table has the property that its rows are never transmitted from client to server. |
| Method Summary | |
void |
clear()
Removes all rows from the table and deselects all rows. |
boolean |
containsKey(java.lang.String key)
Returns true if this table contains a row with the provided key. |
int |
getColumnCount()
Returns the number of columns in this table. |
TableRow |
getRow(int rowIndex)
Returns the table row at a provided zero based row index. |
TableRow |
getRow(java.lang.String key)
Returns the table row for a provided key. |
int |
indexOf(java.lang.String key)
Returns the index at which the row with the provided key is located or -1 if no row with key is here. |
boolean |
isOneWay()
Returns if this table is one way. |
void |
removeRow(int rowIndex)
Removes a row from this table at a provided index. |
boolean |
removeRow(java.lang.String key)
Removes a row with a particular key. |
void |
selectByModelIndex(int index)
Selects the row at the provided zero-based index. |
int |
size()
Returns the number of rows in this table. |
| Methods inherited from interface at.spardat.xma.mdl.ISelectable |
deselect, deselectAll, getSelected, getSelection, getSelectionCount, isMultiSelect, isSelected, isStrict, select |
| Field Detail |
public static final int S_MULTI_SELECT
public static final int S_ONE_WAY
You should mark a table as one way, if u know that the contents of the table is only produced at the server and only consumed (read) at the client side of XMA. This saves memory at the server and eliminates the neccessity to transfer the rows back to the server in stateless pages.
The row set of a one way table may be changed at the server side. Then the row information is transmitted to the client. If it is not changed at the server side, the row information at the client is not changed after a server side event but remaines unchanged.
The one way property applies only to the row information in this, not to the selection information.
With one way tables, the selection need not to be necessarely strict. The server may view an empty row set in the course of executing a server side event (because rows are not transmitted to the server), although there are rows at the client side. Therefore the only action that makes sense at the server side is to fill the table with rows.
public static final int S_LAST
| Method Detail |
public boolean isOneWay()
S_ONE_WAYpublic int size()
public boolean containsKey(java.lang.String key)
public int indexOf(java.lang.String key)
key - the key of the row that is looked up.
public TableRow getRow(java.lang.String key)
The returned TableRow may be used to query and modify the row. It must not be cached outside for later reuse because the returned row becomes invalid if the table is modified in other ways.
key - the key whose row is wanted
public TableRow getRow(int rowIndex)
The returned TableRow may be used to query and modify the row. It must not be cached outside for later reuse because the returned row becomes invalid if the table is modified in other ways.
rowIndex - the index of the row
java.lang.ArrayIndexOutOfBoundsException - if rowIndex invalidpublic void removeRow(int rowIndex)
rowIndex - the zero based row index.
java.lang.IndexOutOfBoundsException - if rowIndex invalid.public boolean removeRow(java.lang.String key)
Note that this method is of runtime order O(n). If performance matters, please use removeRow(int) instead.
key - the key whose row is to be removed.
public void clear()
public int getColumnCount()
public void selectByModelIndex(int index)
Note that this method selects using an index of the table-model. At the XMA client, if the table has been sorted, this need not necessarely correspond to be the index you see in the SWT-table.
index - zero based index of the row to select.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||