public class ClientBrowseModel extends java.lang.Object implements BrowseModel
BrowseModel
used by
the Browse
widget. The implementation is just forwards all
requests to the remote side using ServerExports interface.Modifier and Type | Field and Description |
---|---|
private int |
browseId
ID of the associated browse widget.
|
private WidgetConfig[] |
editorConfigsCache
Cache of editing widgets' configurations.
|
Constructor and Description |
---|
ClientBrowseModel(int browseId)
Construct an instance of adapter class using specified query ID and
reference to server interface.
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrentRow()
Get current row in the model.
|
WidgetConfig[] |
getEditorsConfigs()
Get configurations of editors (fill-ins, toggle-boxes or combo-boxes) used for in-browse
editing.
|
int |
getRowCount()
Get the number of rows iterated by the query (for preselect queries - matches result size,
for adaptive queries - matches the size of the part of the result set the query has already
iterated over).
|
int |
getRowCount(int startRow)
Get number of available rows starting from the given one.
|
BrowseRow[] |
getRows(char searchChar,
int searchColumn,
int viewportTopRow,
int viewportBottomRow,
int rowDisplayTriggerId,
ScreenBuffer[] sb)
This function is used when search by key is performed in a browse.
|
BrowseRow[] |
getRows(int startRowIndex,
int count,
boolean forward,
int rowDisplayTriggerId,
ScreenBuffer[] sb,
RowDisplayStrategy displayStrategy)
Retrieves several subsequent rows from the database.
|
boolean |
isRowAvailable(int rowIndex)
Determines if the specified browse row is "available", i.e.
|
void |
moveColumn(int src,
int dest)
Implements the MOVE-COLUMN() widget method.
|
int |
setCurrentRow(int rowIndex)
Inform server about current row in the browse.
|
void |
updateRow(int rowIndex,
int[] cellIndices,
BaseDataType[] cellValues,
boolean onlyNotifyRowReleased)
Updates selected cells in the given row.
|
private int browseId
private WidgetConfig[] editorConfigsCache
public ClientBrowseModel(int browseId)
browseId
- ID of the browse widget to forward request to.public WidgetConfig[] getEditorsConfigs()
getEditorsConfigs
in interface BrowseModel
null
if the
column is not editable. Return value is null
if the browse is
read-only.public int getRowCount()
getRowCount
in interface BrowseModel
public int getRowCount(int startRow)
getRowCount
in interface BrowseModel
startRow
- Initial row to start count rows from.public BrowseRow[] getRows(int startRowIndex, int count, boolean forward, int rowDisplayTriggerId, ScreenBuffer[] sb, RowDisplayStrategy displayStrategy)
getRows
in interface BrowseModel
startRowIndex
- Index of the first row to retrieve (0-based).count
- Maximum count of rows to return. -1
for no limit.forward
- true
if rows are retrieved in the forward direction,
false
if rows are retrieved in the backward direction.rowDisplayTriggerId
- Trigger ID of the ROW-DISPLAY trigger. -1
if there is no ROW-DISPLAY
trigger for this browse.sb
- Screen buffer for the ROW-DISPLAY trigger. null
if there is no
ROW-DISPLAY trigger for this browse.displayStrategy
- Specifies type of action for which rows are fetched and defines how rows are
iterated / displayed.null
is returned.public BrowseRow[] getRows(char searchChar, int searchColumn, int viewportTopRow, int viewportBottomRow, int rowDisplayTriggerId, ScreenBuffer[] sb)
getRows
in interface BrowseModel
searchChar
- Character to be searched for. Search is performed using only the first character
(in the visual data representation) in the current column. Specifying a character
puts this function in the search mode. This parameter is null
for
non-search mode.searchColumn
- For search mode: 0-based index of the column to be searched.viewportTopRow
- For search mode: 0-based index (in the result set) of the top row in the current
view.viewportBottomRow
- For search mode: 0-based index (in the result set) of the bottom row in the
current view.rowDisplayTriggerId
- Trigger ID of the ROW-DISPLAY trigger. -1
if there is no ROW-DISPLAY
trigger for this browse.sb
- Screen buffer for the ROW-DISPLAY trigger. null
if there is no
ROW-DISPLAY trigger for this browse.null
is returned.public void updateRow(int rowIndex, int[] cellIndices, BaseDataType[] cellValues, boolean onlyNotifyRowReleased) throws DataValidationException
updateRow
in interface BrowseModel
rowIndex
- Index of the row to update.cellIndices
- Cells for update indexes.cellValues
- Cells for update new values.onlyNotifyRowReleased
- Only notify server that the row has been released. Data is not updated.DataValidationException
- New values don't passed database validation rules.public int setCurrentRow(int rowIndex)
setCurrentRow
in interface BrowseModel
rowIndex
- 0-based index of the current row.public int getCurrentRow()
getCurrentRow
in interface BrowseModel
public boolean isRowAvailable(int rowIndex)
isRowAvailable
in interface BrowseModel
rowIndex
- 0-base index of the target row in the browse model.true
if the row is "available", i.e. it is not deleted.public void moveColumn(int src, int dest)
Repositions a column in the browse widget.
moveColumn
in interface BrowseModel
src
- 0-based position of the column to be moved.dest
- 0-based position to which the column is moved.