public abstract class Browse<O extends OutputManager<?>> extends FixedSizeContainer<O> implements WidgetWithConfig<BrowseConfig>, FocusListener, KeyListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
Browse.InsertRowInfo
Container for storing information between new row insertion stages.
|
protected static class |
Browse.RowLeaveResult
Result of ROW-LEAVE trigger execution containing result of its execution and information about specific
actions that took place during the trigger execution.
|
protected static class |
Browse.SelectedRow
Container which holds row index and row availability (i.e.
|
class |
Browse.SelectionSet
Set of the selected rows for multi-selection.
|
| Modifier and Type | Field and Description |
|---|---|
protected Widget |
activeEditor
Reference to the active in-place editor if edit is in progress.
|
private boolean |
awaitingEndError
Waiting for END-ERROR key after edit mode validation error
|
protected BrowseModel |
browseModel
A data model instance.
|
protected BrowseTriggerStateHandler |
browseStateHandler
The browse state handler
|
static int |
CACHE_SIZE
The size of data cache in screen pages.
|
Color |
colorCommon
Terminal attribute for normal text.
|
Color |
colorCurrent
Terminal color for current text.
|
protected Color |
colorHSep
Terminal color for normal text in data area when separators are
active.
|
private int |
columnEntryTriggerDepth
Depth of column ENTRY triggers invocation (when we have APPLY "ENTRY" in a column ENTRY trigger).
|
private BrowseColumnConfig[] |
columnsCache
Cache of all columns.
|
protected boolean |
columnsInUpdate
Indicates that the column update procedure is in progress (i.e.
|
protected BrowseConfig |
config
Component attribute container.
|
protected int |
currColumn
Index of current column.
|
private int |
currentRow
0-based index of the current row in the browse model.
|
private boolean |
currentRowAvail
Determines if the current row was available (could be fetched) at the moment it has become
the current row.
|
protected RowDisplayStrategy |
currentRowDisplayStrategy
If we are getting new rows, specifies type of action for which browse rows are fetched and
defines how rows are iterated / displayed.
|
protected boolean |
currRowSelected
Determines if the current row is selected (single-selection mode only).
|
protected BaseDataType[] |
currRowUpdates
An updated data for the current row.
|
protected BrowseRow[] |
dcData
Cached rows from the data model.
|
protected boolean |
drawLabels
Draw labels.
|
protected BrowseRow |
editedRow
Contents and cached text of the edited row.
|
protected java.lang.Integer |
editingExistingRowBefore
If editing is active, the index (in the browse model) of the closest exiting row before the
currently edited new row.
|
private boolean |
firstEditing
true if there has been no in-cell editing. |
protected boolean |
hadDraw
Set to true if browse was drawn at least once.
|
protected boolean |
hadRowSelected
Determines if a row was selected before regardless of current selection
|
protected int |
ilFirstScrollCol
The minimal positive value of
scrollColumn. |
protected int |
ilLabelsHeight
The height (in character rows) of the labels area not including the
separator line.
|
private boolean |
initialDataSetObtained
true if the rows data set was already fetched for the first time. |
protected java.lang.Integer |
initialRow
If the query was repositioned before the rows data set was fetched for the first time, then
this variable keeps the current row.
|
protected boolean |
inRowLeaveTrigger
true if we are in a ROW-LEAVE trigger. |
protected boolean |
insertingRow
INSERT-ROW consists of two stages. |
protected Browse.InsertRowInfo |
insertRowInfo
Information to be passed between the stages of
INSERT-ROW. |
protected BrowseRow[] |
intermediateDcData
Cache of current rows supplemented with "intermediate" rows (i.e.
|
protected boolean |
keepEditingColumn
If
INSERT-ROW is happening and this variable is true, keep the current editing column
when the new row is added rather than reset it to the first editable column. |
protected BrowseRow |
lastRowSelected
Last row that was selected, null if no selection was made but still
holds the reference even if deselected or not in the browse anymore
|
protected boolean |
layoutNotificationSent
true if server has been notified that layout on the client side has been performed. |
private static CentralLogger |
LOG
logger
|
protected boolean |
navigable
After initial enabling of browse it becomes navigable.
|
protected int |
NEW_ROWS_NUMERATION_START
Index of the first added new row.
|
private int |
newRowNumber
Next unique row number for a new row.
|
private java.util.Map<java.lang.Integer,java.lang.Integer> |
ordinalToVisibleMap
Map of columns' 0-based ordinals among all columns to 0-based ordinals of these
columns among visible columns.
|
protected double |
originalHeight
Height of browse as it was passed to
AbstractContainer.setSize(double, double). |
protected double |
originalWidth
Width of browse as it was passed to
AbstractContainer.setSize(double, double). |
protected boolean |
pendingExtraRowFetch
If
true, then the browse will fetch an extra row on the next scroll operation
in order to determine if one- or multi-page scrolling mode should take place. |
protected boolean |
pendingRowLeaveSave
This flag is related to handling of APPLY LASTKEY (or APPLY navigation-event) statement inside ROW-LEAVE
trigger.
|
protected boolean |
pseudoFocus
This variable is used to reproduce special drawing behavior for case
when query is initialized after browse is displayed first time.
|
protected boolean |
queryClosed
Flag which helps to distinguish if
queryRepositioned(boolean, int) was caused by
query opening or repositioning. |
private boolean |
queryInitialized
true if an initial query was assigned to the browse. |
protected java.lang.String[] |
rcLabels
Rendered columns labels area.
|
protected int |
rowCountAssessment
The number that allows to assess if the total number or rows in the result set is more or
less than the page size.
|
private int |
rowEntryTriggers
Count the number of currently invoked ROW-ENTRY triggers
|
protected boolean |
savingRow
true if we are in the process of saving of the edited row. |
protected int |
scrollColumn
The data model index of the scroll anchor column.
|
protected Browse.SelectionSet |
selectedRowIndices
Indexes of selected rows in
Integer form. |
boolean |
separatorQuirk
Set to
true when separators need to be underscored. |
private BrowseColumnConfig[] |
visibleColumnsCache
Cache of visible columns.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
Browse(WidgetId id,
BrowseConfig cfg)
Constructs the Browse widget.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptTrigger(int eventCode)
Tests if the target event can be triggered or not.
|
protected abstract void |
addEditor(Widget editor)
Add editor widget to the browse.
|
protected int |
addNewRow(int rowIndex,
BaseDataType[] rowData,
int viewportRow,
boolean after)
Add new row to the cache.
|
protected boolean |
advanceCurrRowOrSelection(boolean advanceSelection,
boolean forward,
boolean handleEditing,
int rowIndex)
Works in two modes:
Advance current row - make the row before or after the current row the new
current row.
Advance selection - deselected all rows and make the row before or after the
specified row selected.
|
protected boolean |
advanceRowSelection(boolean forward)
Worker for
selectNextRow() and selectPreviousRow(). |
void |
afterConfigUpdate(BrowseConfig beforeUpdate)
The method is called after the configuration associated with the
owner changes.
|
void |
applyEnhancedConfigClient()
Run client-side part of the code which should be executed after an enhanced configuration is applied to
the browse.
|
int |
calcDown(int rowHeightPixels)
Calculate DOWN value for the browse basing on the given row height.
|
static boolean |
cellStartsWith(java.lang.String cellText,
char searchChar)
Returns
true if the visual representation of the cell content starts with the
given character. |
protected boolean |
checkChuiRowInView()
For ChUI: if the current row is not in the view, set the top row in the view as the
current row.
|
void |
checkDeleteEntryRowIndex()
Check that the current row can be deleted with DELETE-RESULT-LIST-ENTRY: the row should be
existing and in the view.
|
protected void |
cleanupEditor(Widget editor)
Clean up editor widget.
|
boolean |
clearWidget()
Clear widget state on CLEAR FRAME call for the parent frame.
|
protected abstract void |
columnToView(int visibleColumnIndex)
Setups scrolling to fully (as possible) show the given column.
|
void |
completeTrigger(int eventCode)
Manages the internal state after the trigger is finished.
|
protected void |
conditionalPendingExtraRowFetch()
If the top row in the view is the first row in the result set, set the
pendingExtraRowFetch flag, which makes browse fetch an extra row on the next scroll
in order to determine if one- or multi-page scrolling mode should take place. |
BrowseConfig |
config()
Provide access to the attributes stored in the widget.
|
protected FillIn |
createEditingFillIn(boolean useValue,
BaseDataType value)
Create fill-in editor widget for the current column.
|
protected Widget |
createEditor(boolean useValue,
BaseDataType value)
Create editor fill-in for the current column.
|
Widget<O> |
currentFocus()
Returns the same as
getDefaultFocus() because focus placement
inside BROWSE can't be switched from initial component until subcomponent
creation or deletion. |
protected BrowseRow |
dcGetRow(int rowIndex)
Returns the cached row with the given index.
|
protected BaseDataType[] |
dcGetRowData(int rowIndex)
Returns the row data with the given index.
|
protected int |
dcGetRowIndex(int rowIndex)
Calculate row index for internal cache.
|
private void |
dcUpdateRow(int rowIndex,
int[] cellIndices,
BaseDataType[] cellValues,
boolean updateModel,
boolean rowInView,
BrowseRow editedRowData)
Updates row in the cache and the model.
|
Widget<O> |
defaultFocus()
Returns this component directly if there is no in-place editor.
|
void |
deselectAll()
Remove all selections.
|
void |
deselectFocusedRow()
Deselect row which is currently in focus.
|
boolean |
deselectSelectedRow(int rowIndex)
Implements the DESELECT-SELECTED-ROW() widget method.
|
void |
destroy()
Destroy this widget.
|
protected void |
displayErrorMessage(java.lang.String message)
Display browse-related error message.
|
void |
doLayout()
Lay out the browse.
|
abstract void |
draw()
Draws the widget: border, header, selection marks and line, internal
FillIn etc.
|
abstract void |
drawCaret()
Sets position of terminal's cursor.
|
void |
executePendingRefresh(boolean queryReopened,
boolean repositionBeforeReopen,
int repositionedRow)
Execute pending refresh when REFRESHABLE is turned on.
|
void |
finishStopEdit()
Stops the current editor.
|
void |
fireDefaultAction()
Fires the DefaultAction event.
|
void |
fireValueChanged()
Fires the ValueChanged event.
|
boolean |
focusTraversable()
This component will receive an input focus when Tab or Shift-Tab
is pressed.
|
protected static java.lang.String |
generateQuestionMarks(BrowseColumnConfig columnConfig,
BaseDataType var)
Generate question marks that indicate that the cell value cannot be displayed using the
current format.
|
protected ComboBox |
getActiveComboBox()
Get active editor (assumes it is a combo-box).
|
protected Widget |
getActiveEditor()
Returns the active in-place editor if edit is in progress.
|
protected FillIn |
getActiveFillIn()
Get active editor (assumes it is a fill-in).
|
protected ToggleBox |
getActiveToggleBox()
Get active editor (assumes it is a toggle-box).
|
abstract int |
getBrowseColumnY()
Get value of
column.Y attribute for the columns of this browse: vertical offset of the
current row from the top of the browse, in pixels for GUI or in chars for ChUI. |
protected int |
getCachedRowNumber(BrowseRow[] rowCache,
int rowIndex)
Get the browse model index of the data row at the specified row index in the specified
row cache.
|
int |
getCachedRowNumber(int viewportIndex)
Get the browse model index of the data row positioned at the specified viewport row.
|
int |
getCachedRowNumberWithIntermediate(int viewportIndex)
Get the browse model index of the data row in the row cache supplemented with "intermediate"
rows (
intermediateDcData), positioned at the specified viewport row. |
int |
getCacheSize()
Get the number of rows in the cache (which matches the number of rows in the viewport).
|
int |
getCacheSizeWithIntermediate()
Get the number of rows in the cache supplemented with "intermediate" rows
(
intermediateDcData), which matches the number of rows in the viewport. |
static java.lang.String |
getCellText(BrowseColumnConfig columnConfig,
BaseDataType var)
Get cell text to render.
|
static java.lang.String |
getCellTextNoError(BrowseColumnConfig columnConfig,
BaseDataType var)
Get cell text to render, without raising error.
|
BrowseColumnConfig |
getColumnCfg(int columnOrdinal)
Return
BrowseColumnConfig for specified index. |
int |
getColumnCount()
Get the number of columns.
|
protected BrowseColumnConfig[] |
getColumns()
Return information about all columns regardless of their visibility.
|
java.lang.String |
getColumnText(int columnOrdinal)
Get text value of the given column in current row.
|
BaseDataType |
getColumnValue(int columnOrdinal)
Get value of the given column in current row.
|
BrowseColumnConfig |
getCurrentColumn()
Get the currently editing column.
|
int |
getCurrentRow()
Get the current row.
|
protected Browse.SelectedRow |
getCurrentRowAsSelected()
Get the current row as
Browse.SelectedRow object which
takes into account its availability (see currentRowAvail). |
static DisplayFormat |
getDisplayFormat(BrowseColumnConfig colCfg)
Get display format which corresponds to format string and data type
stored in configuration.
|
int |
getDown()
Return number of potential data rows in the
Browse. |
protected int |
getEdgeExistingRow(boolean first)
Get first or last existing (not new) row in the view.
|
protected WidgetConfig |
getEditorConfig(int columnOrdinal)
Get configuration of the editor (fill-in, toggle-box or combo-box) used for in-browse
editing for the target column.
|
protected int |
getEditorCursorOffset()
Return the cursor offset from the left bound of the current in-cell editor.
|
protected BaseDataType |
getEditorValue()
Get value of the editor widget.
|
private int |
getFirstEditableColumn()
Get the first editable column in the browse.
|
protected int |
getFirstExistingRow()
Get first existing (not new) row in the view.
|
integer |
getFocusedRow()
Implements the FOCUSED-ROW attribute getter.
|
Widget |
getFocusedWidget()
Returns the widget which corresponds the FOCUS handle if this browse is focused.
|
int[] |
getIdsOfColumnWidgets()
Get widget IDs of the browse column widgets.
|
BrowseColumnConfig[] |
getInvisibleColumns()
Return information about invisible columns.
|
static java.lang.String[] |
getLabelVar(BrowseColumnConfig colCfg)
Return label as array of strings.
|
protected int |
getLastAvailableSelectedRow(boolean includeNewRows)
Get last (in the order of selection) "available" (not deleted on the moment of selection)
selected row.
|
protected int |
getLastExistingRow()
Get last existing (not new) row in the view.
|
int |
getMaximalSelectedRowIndex()
Get the maximal row index (in the browse model) among the selected rows,
|
BrowseModel |
getModel()
Get currently used
BrowseModel. |
protected int |
getNewRowsBefore(int baseViewportRow)
Get the number of new rows in the viewport before the given base viewport row.
|
BrowseColumnConfig |
getNextColumn(BrowseColumnConfig column)
Return reference to next column relative to given column.
|
protected int |
getNumberForLastRow()
Get a big number that can be used in
getRows(int, int, boolean, RowDisplayStrategy)
to make it return the last row in the result set. |
protected int |
getPageSize()
Get page size used for Page Up / Page Down.
|
BrowseColumnConfig |
getPrevColumn(BrowseColumnConfig column)
Return reference to previous column relative to given column.
|
int |
getRepositionedRow()
Get repositioned row.
|
private int |
getRowDeletionShift(int baseRow)
Get the number of non-new selected rows before the given base row.
|
protected int |
getRowDisplayTriggerId()
Get ID of the ROW-DISPLAY trigger for this browse.
|
protected BrowseRow[] |
getRows(char searchChar,
int searchColumn,
int viewportTopRow,
int viewportBottomRow)
This function is used when search by key is performed in a browse.
|
protected BrowseRow[] |
getRows(int startRowIndex,
int count,
boolean forward,
RowDisplayStrategy displayStrategy)
Retrieves several subsequent rows from the database.
|
protected ScreenBuffer[] |
getScreenBufferForTrigger(int triggerId)
Get screen buffer that can be used for trigger invocation on server side.
|
protected int |
getScrollRow()
Get the index of the row on the top of the page.
|
int |
getSelectedRowIndex(int selIndex)
Get the index (in the browse model) of the given selected row.
|
int |
getSelectedRowIndex(int selIndex,
boolean ignoreNotAvail,
boolean newAsAvail)
Get the index (in the browse model) of the given selected row.
|
int[] |
getSelectedRowIndexes()
Retrieve the row indexes of the selected rows in the given browse widget.
|
int |
getSelectedRowsCount()
Returns the count of selected rows.
|
static BrowseTextAlignment |
getTextAlign(BrowseColumn column)
Get browse column text alignment.
|
static BrowseTextAlignment |
getTextAlign(BrowseColumnConfig columnConfig)
Get browse column text alignment.
|
BaseDataType |
getValue()
Getting the BaseDataType object representing the current value.
|
protected BaseDataType |
getValue(int columnOrdinal)
Get value for the specified column.
|
protected BaseDataType |
getValue(int columnOrdinal,
boolean useSelection)
Get value for the specified column.
|
int |
getViewportRow()
Get the index of the current row in the viewport.
|
int |
getViewportRow(int rowIndex)
Get the index of the specified row in the viewport.
|
protected BrowseColumnConfig |
getVisibleColumnCfg(int visibleColumnIndex)
Return
BrowseColumnConfig for specified index. |
int |
getVisibleColumnCount()
Get the number of visible columns.
|
protected BrowseColumnConfig[] |
getVisibleColumns()
Return information about visible columns.
|
protected boolean |
goDown()
Scroll one row up and adjust current row.
|
protected boolean |
goDown(boolean handleEditing,
boolean fireValueChanged,
boolean startFromSave)
Scroll one row down and adjust current row.
|
protected boolean |
goDownWithSelection(int rowIndex)
Deselect all rows and select the row after the given one.
|
protected boolean |
goUp(boolean handleEditing)
Scroll one row up and adjust current row.
|
protected boolean |
goUp(boolean handleEditing,
boolean fireValueChanged,
boolean startFromSave)
Scroll one row up and adjust current row.
|
protected boolean |
goUpWithSelection(int rowIndex)
Deselect all rows and select the row before the given one.
|
protected void |
handleTabKey()
Handle TAB key press.
|
boolean |
hasFocusable(boolean next,
Widget<O> exclude)
Reports if there is at least 1 focusable column that is not the
current column.
|
boolean |
hasFocusable(Widget<O> exclude)
Reports if there is at least 1 focusable component that is not the
given component.
|
boolean |
hasRowMarkers()
If the browse has row markers drawn.
|
boolean |
hasRows()
Gets a value that indicates whether the browse contains one or more rows (including new
rows).
|
protected boolean |
incrementalScroll(int rowCount)
Scroll browse by the specified number of rows.
|
protected boolean |
incrementalScroll(int rowCount,
boolean forceTrailingSpace,
boolean incrementalRowDisplay,
boolean triggeredByScrollbar)
Scroll browse by the specified number of rows.
|
protected abstract void |
initEditorConfig(BaseConfig cfg)
Initialize editor widget config.
|
void |
initialize(WidgetId id,
BrowseConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
void |
initQueryAssigned()
Second stage of the initialization of the Browse widget which is
performed only when query is initially assigned.
|
protected BrowseRow[] |
insertEditingRow(BrowseRow[] serverData,
boolean forward,
int maxSize,
int lastRow,
boolean allowBeforeFirst)
If a new row is being edited, add this row into the given result set if it should be in this
set.
|
boolean |
insertRow(boolean after)
Inserts a blank row in an updateable browse before or after the last selected row.
|
void |
insertRowSecondPart()
Second part of
insertRow(boolean) processing, which is usually executed after the trigger
containing the INSERT-ROW call, finishes. |
boolean |
invokeLeaveCellTrigger(WidgetId nextFocus)
Invoke the LEAVE trigger for the currently editable column.
|
boolean |
invokeRowEntryTrigger()
Invoke ROW-ENTRY trigger.
|
boolean |
invokeRowEntryTrigger(WidgetId leaveWidgetId)
Invoke ROW-ENTRY trigger.
|
Browse.RowLeaveResult |
invokeRowLeaveTrigger(WidgetId nextId)
Invoke ROW-LEAVE trigger.
|
protected boolean |
isAggressiveCurrentRowSelection()
Returns
true if the current row of the single-selection browse is selected on
FOCUS-GAINED and some other events. |
private boolean |
isAnyRowSelected()
Returns
true if the browse has any selected row, false otherwise. |
boolean |
isConditionalReposition()
Returns reposition mode set be SET-REPOSITIONED-ROW.
|
boolean |
isCurrentRowInView()
Determine if the current row is in the view.
|
boolean |
isCurrentRowModified()
Return status of the updates of the current row.
|
boolean |
isEditing()
Returns
true if editing is in progress. |
boolean |
isEditorComboBox()
Returns
true if the current editor is a combo-box. |
protected boolean |
isEditorFillIn()
Returns
true if the current editor is a fill-in. |
protected boolean |
isEditorModified()
Returns
true if the widget value was modified. |
protected boolean |
isEditorToggleBox()
Returns
true if the current editor is a toggle-box. |
boolean |
isEditPossible()
Determine if in-browse editing is possible.
|
protected boolean |
isFirstBrowseRow()
Determines if the current row is the first browse row, i.e.
|
protected boolean |
isFirstLastRowCopyQuirk()
Determine if this browse should have the following quirk: is a new row is inserted before
the first row or after the last row, the value of the current column is copied from the
first/last row to the new row.
|
boolean |
isFocusedRowSelected()
Return
true if row which has focus is selected. |
boolean |
isInColumnEntryTrigger()
Returns
true if an column ENTRY trigger is running. |
boolean |
isInsertingRow()
Returns the current stage of insert-row operation.
|
boolean |
isLayoutMode()
Returns
true if browse layout mode is active. |
boolean |
isModified(int columnOrdinal)
Check if the value in specified column in current row is changed.
|
protected boolean |
isNewEditingRowOutOfTheView()
Returns
true if there is a new editing row which is out of the view. |
boolean |
isNewRow()
Returns
true if the current row is a new row and is not present in the
database. |
boolean |
isNewRow(int newRowIndex)
Returns
true if the given row is a new row and is not present in the
database. |
protected boolean |
isNoEdit()
Checks if entering edit mode is prevented while updating browse content on enhanced dynamic sort
and filtering.
|
protected boolean |
isOnePageScrollingMode()
4GL has two scrolling modes: "one-page" scrolling mode which is used if the total number
of rows is less or equal the page size and the "multi-page" mode.
|
protected boolean |
isRefreshedOnEnable()
Determines if browse refreshed on browse widget enabling.
|
boolean |
isRowInView(int rowIndex)
Determines if the specified row is in the viewport.
|
boolean |
isRowSelected(int rowIndex)
Returns is given row selected.
|
boolean |
isSavingRow()
Returns
true if we are in the process of saving of the edited row. |
boolean |
isSelectedRowAvailable(int selIndex,
boolean newAsAvailable)
Determines if the specific selected row was available (could be fetched) at the moment of
its selection.
|
boolean |
isSelectionMultiple()
Returns selection mode state.
|
protected boolean |
isViewportEdge(int rowIndex,
boolean forward)
Determines if the specified row is the first or last row in the view.
|
protected Browse.RowLeaveResult |
leaveRow()
Release current row (finish editing and commit).
|
protected Browse.RowLeaveResult |
leaveRow(boolean startFromSave)
Release current row (finish editing and commit).
|
protected Browse.RowLeaveResult |
leaveRow(boolean startFromSave,
WidgetId nextId)
Release current row (finish editing and commit).
|
void |
moveColumn(int srcIndex,
int destIndex)
Implements the client side of the MOVE-COLUMN() widget method.
|
boolean |
needsInsertRowContinueOnEntry(BrowseColumn entryColumn)
Returns
true if we need to perform the second stage of INSERT-ROW immediately,
as a reaction to browse column "entry" event. |
void |
nextFocus()
This method is called from the in-place editor when it need to initiate
switching to the next widget.
|
protected int |
nextNewRowNumber()
Get next unique row number for a new row.
|
protected void |
notifyBrowseScrolled()
Notify that the browse has been scrolled (i.e.
|
void |
notifyColumnsUpdated()
Notify the browse that some columns have been added to it or visibility of columns has been
changed.
|
abstract void |
notifyColumnsUpdated(boolean refreshData)
Notify the browse that some columns have been added to it or visibility of columns has been
changed.
|
void |
notifyKeyPressedInEditor(KeyInput key)
Notify the browse that the key was pressed when the editor is in focus.
|
private void |
notifyRowReleased()
Notify server that the row has been released.
|
void |
onFocusGained(FocusEvent event)
Handle situation when
Browse widget receives the focus. |
void |
onFocusLost(FocusEvent fe_)
Handle situation when
Browse widget loses the focus. |
void |
onKeyPressed(KeyInput event)
Process key event.
|
void |
onKeyTyped(KeyInput event)
Handles ' ' key in R/O mode: fires ValueChanged event.
|
protected java.lang.Integer |
ordinalToVisible(int columnOrdinal)
Get 0-based index of the column among the visible columns.
|
void |
parentFrameViewed()
Notify browse that the parent frame became visible.
|
protected void |
populateColumnsCache()
Populate cache of columns using updated
BrowseConfig.columnIds. |
void |
prevFocus()
This method is called from the in-place editor when it need to initiate
switching to the previous widget.
|
void |
processEvent(Event evt)
Intercept special events.
|
void |
queryClosed()
Reset the cache and redisplay.
|
void |
queryRepositioned(boolean repositionError,
int targetRepositionRow)
Notify the browse that the underlying query has been repositioned.
|
void |
refresh(boolean deleteCurrentRowMode)
Refresh the browse cache and redisplay the browse.
|
void |
refreshAfterDeletion(int rowIndex)
Refresh the browse after some of its rows were deleted.
|
protected abstract void |
refreshColumnAttributes(BrowseColumnConfig config,
CellAttributes attributes)
Refresh column attributes which are cell-specific (like @BGCOLOR@ or @FGCOLOR@) for the
specific column, with the cell data from the rows cache.
|
protected void |
refreshColumnsAttributes()
Refresh column attributes which are cell-specific (like @BGCOLOR@ or @FGCOLOR@) for all
columns, with the cell data from the rows cache.
|
void |
refreshCurrentRow(BrowseRow row)
Refresh the current browse row using the provided data.
|
void |
refreshScrollRow(boolean leaveOnRowInView,
boolean preserveViewportRow)
Refresh scroll row in the browse and redisplay.
|
void |
refreshScrollRow(boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError,
int targetRepositionRow,
boolean leaveOnOnePageMode)
Refresh scroll row in the browse and redisplay.
|
void |
refreshScrollRow(int scrollRow,
boolean leaveOnRowInView,
boolean preserveViewportRow)
Refresh scroll row in the browse and redisplay.
|
void |
refreshScrollRow(int scrollRow,
boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError)
Refresh scroll row in the browse and redisplay.
|
void |
refreshScrollRow(int scrollRow,
boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError,
int targetRepositionRow,
boolean leaveOnOnePageMode)
Refresh scroll row in the browse and redisplay.
|
protected Browse.RowLeaveResult |
releaseCurrentRow()
Finishes editing and commits row to model if some updates are available.
|
private Browse.RowLeaveResult |
releaseCurrentRow(boolean updateModel,
boolean triggerRowLeave,
boolean startFromSave)
Finishes editing and commits row to model if some updates are available.
|
private Browse.RowLeaveResult |
releaseCurrentRow(boolean updateModel,
boolean triggerRowLeave,
boolean startFromSave,
WidgetId nextId)
Finishes editing and commits row to model if some updates are available.
|
void |
removeFromSelection(int deletedRowIndex)
Remove given row(s) from the set of selected rows.
|
void |
requestFocus()
Requesting the focus to the
Browse. |
void |
requestFocus(boolean force,
boolean mouse)
Request focus.
|
protected void |
resetColumnsCache()
Reset cached information about columns.
|
void |
resetColUpdatesInCurrentRow(int col)
Reset current row updates for a column.
|
void |
resetFirstEditing()
Set
firstEditing flag to false. |
private void |
resetModifiedFlags()
Reset the modified flags.
|
void |
rowEntryCreated(int newRowId)
Performs client-side actions after a new row has been added to the backing result set
using CREATE-RESULT-LIST-ENTRY.
|
void |
rowEntryDeleted(int deletedRowId)
Performs client-side actions after a row has been deleted from the backing result set
using DELETE-RESULT-LIST-ENTRY.
|
private boolean |
saveCurrentRow(boolean updateModel)
Saves the current row into cache and data model.
|
void |
scrollToCurrentRow()
Scrolls a browse (if necessary) to bring the currently selected row into view.
|
protected void |
scrollToEditableRow()
Scroll to the editable row if it is out of the view.
|
protected boolean |
scrollToRow(int scrollRow)
Scroll to the specified row (all records are refreshed).
|
protected boolean |
scrollToRow(int scrollRow,
boolean setAsCurrentRow)
Scroll to the specified row (all records are refreshed).
|
protected boolean |
scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows)
Scroll to the specified row (all records are refreshed).
|
protected boolean |
scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode)
Scroll to the specified row (all records are refreshed).
|
protected boolean |
scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode,
boolean honorRepositionedRow)
Scroll to the specified row (all records are refreshed).
|
protected boolean |
scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode,
boolean honorRepositionedRow,
boolean allowStartEdit)
Scroll to the specified row (all records are refreshed).
|
protected boolean |
scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode,
boolean honorRepositionedRow,
boolean allowStartEdit,
int oneTimeRepositionedRow,
boolean updateSelection)
Scroll to the specified row (all records are refreshed).
|
void |
scrollToSelectedRow(int selectedRowIndex)
Scrolls a browse (if necessary) to bring the specified selected row into view.
|
void |
selectAll()
Select all rows.
|
void |
selectFocusedRow()
Select row which is currently in focus.
|
boolean |
selectNextRow()
Implements the SELECT-NEXT-ROW() widget method.
|
boolean |
selectPreviousRow()
Implements the SELECT-PREV-ROW() widget method.
|
boolean |
selectRow(int rowIndex)
Implements the SELECT-ROW() widget method.
|
private void |
setColumnEditMode(boolean mode)
Changes the flag indicating the browse column is in editing mode.
|
void |
setColumnValue(int columnOrdinal,
BaseDataType value,
java.lang.String fmt)
Set value for the given column in current row.
|
void |
setCurrentColumn(int columnOrdinal)
Set the currently editing column.
|
void |
setCurrentColumnId(BrowseColumn column)
Set
BrowseConfig.currentColumnID, which effectively updates CURRENT-COLUMN on the
server side. |
protected void |
setCurrentRow(int currRow)
Set the current row.
|
private void |
setCurrentRow(int currRow,
boolean allowDeletedRow)
Set the current row.
|
protected void |
setCurrentRow(int currRow,
boolean updateSelection,
boolean allowDeletedRow)
Set the current row.
|
protected boolean |
setCurrentRowSelected()
Select current row for single-selection case.
|
protected void |
setEditorCursorOffset(int cursorOffset)
Set the cursor offset for the current in-cell editor, if there's an active editor and it is of
a type which has a cursor.
|
void |
setEditorReadOnly(boolean readOnly)
If browse is in editing mode, set editor in 4GL READ-ONLY mode.
|
protected void |
setEditorValue(BaseDataType value)
Set value of the editor widget.
|
void |
setEnabled(boolean enabled)
Enable/disable widget.
|
void |
setHighlighted(boolean highlighted)
Tracks the highlighted state of the component.
|
void |
setIntermediateRows(BrowseRow[] rows)
Set "intermediate" rows (i.e.
|
void |
setKeepEditingColumn()
If
INSERT-ROW is happening, keep the current editing column when the new row is added rather
than reset it to the first editable column. |
void |
setReadOnly(boolean readOnly)
Set READ-ONLY attribute.
|
void |
setSelectionMultiple(boolean multiple)
Switch multiple selection on and off.
|
void |
show()
Show widget.
|
boolean |
startEdit()
Creates an editor for the current cell and adds it to the browse.
|
protected boolean |
startEdit(boolean updateSelection)
Creates an editor for the current cell and adds it to the browse.
|
protected boolean |
startEdit(boolean updateSelection,
boolean sendEntry)
Creates an editor for the current cell and adds it to the browse.
|
boolean |
startEdit(WidgetId prevFocus)
Creates an editor for the current cell and adds it to the browse.
|
protected boolean |
startEdit(WidgetId prevFocus,
boolean updateSelection,
boolean useValue,
BaseDataType value)
Creates an editor for the current cell and adds it to the browse.
|
protected boolean |
startEdit(WidgetId prevFocus,
boolean updateSelection,
boolean useValue,
BaseDataType value,
boolean sendEntry)
Creates an editor for the current cell and adds it to the browse.
|
protected abstract void |
startEditOnFocusGained(Widget prevFocus)
Starts editing for the editable browse on focus gained event.
|
void |
startTrigger(int eventCode)
Manages the internal state before the trigger is started.
|
protected boolean |
stopEdit(boolean undo,
boolean validate)
Finishes edit and destroys an editor.
|
boolean |
stopEdit(WidgetId nextFocus)
Finishes edit and destroys an editor.
|
protected boolean |
stopEdit(WidgetId nextFocus,
boolean undo,
boolean validate)
Finishes edit and destroys an editor.
|
protected boolean |
stopEdit(WidgetId nextFocus,
boolean undo,
boolean validate,
boolean skipCellLeave)
Finishes edit and destroys an editor.
|
protected void |
switchCurrentRowSelection()
For browse with multiple selection: select current row if it is not selected or deselect if
it is selected.
|
protected void |
switchToNextCell()
Switches in-line editor to the next editable cell.
|
(package private) void |
switchToPrevCell()
Switches in-line editor to the previous editable cell.
|
void |
toggleSelectedRows(boolean select,
int start,
int end)
For multi-selection browse, select or deselect the range of rows.
|
protected void |
triggerOffEnd(boolean noRowsTriggers)
Triggers the OFF-END event when the browse has an open query.
|
protected void |
triggerOffEnd(boolean noRowsTriggers,
boolean triggeredByScrollbar)
Triggers the OFF-END event when the browse has an open query.
|
void |
undoValue()
Undo editing operation results and reset everything to initial state.
|
boolean |
undoValue(boolean startEdit)
Undo editing operation results and reset everything to initial state.
|
protected boolean |
updateColumn(int columnOrdinal,
BaseDataType var)
Update specified cell in current row.
|
protected void |
updateLabelsHeight()
Update height of the labels area.
|
protected void |
updateMaxDataGuess(boolean lastReached)
Update MAX-DATA-GUESS value which holds estimated number of rows.
|
boolean |
valid()
Browse behaves like simple component in this regard.
|
protected boolean |
validateEditorValue()
Run validation for the current editor.
|
private boolean |
validateStopEdit(boolean undo,
boolean validate)
Validates current editor.
|
protected int |
visibleToOrdinal(int visibleColumnIndex)
Get 0-based index of the column among all columns (i.e.
|
minimumSizeadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, cycleFocus, deregisterSelectedWidget, detach, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, height, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setHidden, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwidgetsAsListacceptsEscAsAnyKey, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, defaultMousePtr, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setHidden, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetListener, validateDisplayValue, windowpublic static final int CACHE_SIZE
private static final CentralLogger LOG
protected final int NEW_ROWS_NUMERATION_START
protected BrowseModel browseModel
protected boolean currRowSelected
protected boolean hadRowSelected
protected BrowseRow lastRowSelected
protected int currColumn
protected BaseDataType[] currRowUpdates
null then no updates are available for the corresponding
cell.
Updates come from cell editing or by setting column SCREEN-VALUE.protected Browse.SelectionSet selectedRowIndices
Integer form. Used only in
multiple selection mode. This mode is active if and only if this member
is not null.protected int scrollColumn
0
means the absence of horizontal scrolling. Otherwise this column will
occupy the right part of the view window.protected int ilLabelsHeight
protected int ilFirstScrollCol
scrollColumn.protected BrowseRow[] dcData
protected java.lang.String[] rcLabels
protected BrowseConfig config
protected boolean drawLabels
protected BrowseTriggerStateHandler browseStateHandler
private int currentRow
private boolean currentRowAvail
private boolean awaitingEndError
private int newRowNumber
protected boolean hadDraw
protected boolean pseudoFocus
protected int rowCountAssessment
-1 if the query is closed or we haven't got
any rows yet.protected boolean pendingExtraRowFetch
true, then the browse will fetch an extra row on the next scroll operation
in order to determine if one- or multi-page scrolling mode should take place.public boolean separatorQuirk
true when separators need to be underscored.protected double originalWidth
AbstractContainer.setSize(double, double). Used to recalculate
size variables when a new column is added.protected double originalHeight
AbstractContainer.setSize(double, double). Used to recalculate
size variables when a new column is added.protected BrowseRow editedRow
protected boolean savingRow
true if we are in the process of saving of the edited row.protected boolean layoutNotificationSent
true if server has been notified that layout on the client side has been performed.
Used for enhanced initialization.public Color colorCurrent
protected Color colorHSep
protected Widget activeEditor
protected Browse.InsertRowInfo insertRowInfo
INSERT-ROW.protected java.lang.Integer editingExistingRowBefore
-1 if the new row is first row in the result
set. null if a new row is not being edited.public Color colorCommon
private BrowseColumnConfig[] columnsCache
private BrowseColumnConfig[] visibleColumnsCache
private java.util.Map<java.lang.Integer,java.lang.Integer> ordinalToVisibleMap
protected RowDisplayStrategy currentRowDisplayStrategy
protected BrowseRow[] intermediateDcData
protected boolean navigable
protected java.lang.Integer initialRow
protected boolean columnsInUpdate
dcData contents and
the new set of columns.protected boolean insertingRow
INSERT-ROW consists of two stages. The first stage is executed immediately and the second -
when the trigger finishes. This flag is true if we're between these stages.protected boolean keepEditingColumn
INSERT-ROW is happening and this variable is true, keep the current editing column
when the new row is added rather than reset it to the first editable column.protected boolean queryClosed
queryRepositioned(boolean, int) was caused by
query opening or repositioning.private boolean initialDataSetObtained
true if the rows data set was already fetched for the first time.private int rowEntryTriggers
private int columnEntryTriggerDepth
private boolean queryInitialized
true if an initial query was assigned to the browse.private boolean firstEditing
true if there has been no in-cell editing.protected boolean inRowLeaveTrigger
true if we are in a ROW-LEAVE trigger.protected boolean pendingRowLeaveSave
If UP, DOWN, ENTER, TAB or SHIFT-TAB has been pressed, then, if inside the corresponding ROW-LEAVE trigger APPLY LASTKEY is called, then, for the first APPLY call, only the actions starting from row saving are performed (save row, reposition to new row, start edit). And this set of actions is NOT performed for the parent action after ROW-LEAVE finishes. This can be represented by this pseudo-code:
stop edit
-- ROW-LEAVE starts --
pendingRowLeaveSave = true
any in-trigger logic
-- start APPLY LASTKEY --
if (pendingRowLeaveSave)
{
pendingRowLeaveSave = false
save row
reposition to new row
start edit
}
-- end of APPLY LASTKEY --
any in-trigger logic
-- ROW-LEAVE ends --
RowLeaveResult.rowSaved = !pendingRowLeaveSave
if (!RowLeaveResult.rowSaved)
{
save row
reposition to new row
start edit
}
public Browse(WidgetId id, BrowseConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.BrowseConfig) to finish the widget initialization.
id - The widget's ID.cfg - Configuration data.public void notifyColumnsUpdated()
public abstract void notifyColumnsUpdated(boolean refreshData)
refreshData - true to refresh row data, false to only update UI.protected abstract void refreshColumnAttributes(BrowseColumnConfig config, CellAttributes attributes)
config - Column config to be updated.attributes - Cell attributes data from the rows cache.protected abstract void startEditOnFocusGained(Widget prevFocus)
prevFocus - Previously focused widget or null.protected int getScrollRow()
0 if there are no rows.protected boolean isNoEdit()
falsepublic boolean isLayoutMode()
true if browse layout mode is active.false.public void afterConfigUpdate(BrowseConfig beforeUpdate)
The implemented logic must be idempotent - the method must produce the same results if executed once or multiple times not relying on any particular call sequence or related state. This is necessary so that the method can be repeated or retried as often as necessary without causing unintended effects
afterConfigUpdate in interface ConfigOwner<BrowseConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public int getCurrentRow()
0 is also returned if there are no rows.protected Browse.SelectedRow getCurrentRowAsSelected()
Browse.SelectedRow object which
takes into account its availability (see currentRowAvail).protected int getCachedRowNumber(BrowseRow[] rowCache, int rowIndex)
rowCache - Cache of rows: dcData or intermediateDcData.rowIndex - 0-based index of the row in the given row cache.-1 if there is no row with the specified index.public int getCachedRowNumber(int viewportIndex)
viewportIndex - 0-based index of the target row in the viewport.-1 if there are
no rows or there is no data row at the specified viewport row.public int getCachedRowNumberWithIntermediate(int viewportIndex)
intermediateDcData), positioned at the specified viewport row.viewportIndex - 0-based index of the target row in the viewport.-1 if there are
no rows or there is no data row at the specified viewport row.public int getCacheSize()
public int getCacheSizeWithIntermediate()
intermediateDcData), which matches the number of rows in the viewport.public int getViewportRow()
public int getViewportRow(int rowIndex)
rowIndex - 0-based index of the target row in the browse model.0 if the row out
of the current view.public int calcDown(int rowHeightPixels)
rowHeightPixels - Row height in pixels.public void setIntermediateRows(BrowseRow[] rows)
BrowseWidget.getRows(int, int, boolean, int, ScreenBuffer[], RowDisplayStrategy)),
so these rows can be drawn if a pause occurs in ROW-DISPLAY trigger.rows - Rows to set.protected boolean incrementalScroll(int rowCount)
rowCount - Number of rows to scroll. Positive count to scroll forward, negative to scroll
backward.true if at least one row was obtained from the server.protected boolean incrementalScroll(int rowCount,
boolean forceTrailingSpace,
boolean incrementalRowDisplay,
boolean triggeredByScrollbar)
rowCount - Number of rows to scroll. Positive count to scroll forward, negative to scroll
backward.forceTrailingSpace - If number rows returned by server is less than expected, then remaining rows will be
spaces (i.e. (DOWN - rowCount) current rows in view are dropped
unconditionally).incrementalRowDisplay - true if an incremental row display strategy is used.triggeredByScrollbar - true if the function is triggered by a scrollbar.true if at least one row was obtained from the server.protected BrowseRow[] insertEditingRow(BrowseRow[] serverData, boolean forward, int maxSize, int lastRow, boolean allowBeforeFirst)
serverData - Existing rows (order of rows is from top to bottom for any scrolling direction).forward - true for forward scrolling direction, false for backward.maxSize - Maximum allowed size of the resulting set.lastRow - For forward scrolling: last existing row before the rows from the result set.
For backward scrolling: first existing row after the rows from the result set.allowBeforeFirst - If true, the edited row can take the first position in the result set
(for its scrolling direction).public void initialize(WidgetId id, BrowseConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<BrowseConfig>id - The widget's ID.cfg - The config used to initialize this widget.public void destroy()
destroy in interface Widget<O extends OutputManager<?>>destroy in class AbstractContainer<O extends OutputManager<?>>public static DisplayFormat getDisplayFormat(BrowseColumnConfig colCfg)
DisplayFormat.public static java.lang.String[] getLabelVar(BrowseColumnConfig colCfg)
public static boolean cellStartsWith(java.lang.String cellText,
char searchChar)
true if the visual representation of the cell content starts with the
given character.cellText - Cell text.searchChar - Target character.true if visual representation of the cell content starts with the
given character.public void setEnabled(boolean enabled)
AbstractWidgetsetEnabled in interface Widget<O extends OutputManager<?>>setEnabled in class AbstractWidget<O extends OutputManager<?>>enabled - New enabled state.Widget.setEnabled(boolean)public void setHighlighted(boolean highlighted)
setHighlighted in interface Widget<O extends OutputManager<?>>setHighlighted in class AbstractWidget<O extends OutputManager<?>>highlighted - New highlighted state.public void initQueryAssigned()
public BaseDataType getValue()
public void onFocusGained(FocusEvent event)
Browse widget receives the focus.
When a help string is defined for the browse it will be displayed on the status line. This method also sets the selected attribute on.
onFocusGained in interface FocusListenerevent - Reference to the event.public void onFocusLost(FocusEvent fe_)
Browse widget loses the focus.
This method clears the focused flag.
onFocusLost in interface FocusListenerfe_ - Reference to the event.public void undoValue()
public boolean undoValue(boolean startEdit)
startEdit - true to call startEdit() after the value has been undone.true if the edit was stopped.public boolean valid()
true.public void requestFocus()
Browse.requestFocus in interface Widget<O extends OutputManager<?>>requestFocus in class FixedSizeContainer<O extends OutputManager<?>>public void requestFocus(boolean force,
boolean mouse)
requestFocus in interface Widget<O extends OutputManager<?>>requestFocus in class FixedSizeContainer<O extends OutputManager<?>>force - When true the method will set focus on this widget unconditionally.mouse - If true then the focus request was caused by a mouse event.public void setReadOnly(boolean readOnly)
readOnly - New value for the attribute.public void selectAll()
public void deselectAll()
public void toggleSelectedRows(boolean select,
int start,
int end)
start and end to -1.select - true to select the range of rows. false to deselect the range of rows.start - The first row in the range (inclusive).end - The last row in the range (inclusive).public void selectFocusedRow()
public boolean selectRow(int rowIndex)
Selects the specified row if it is currently in the browse viewport. In a single-select browse, the previously selected row is deselected. No rows are deselected in a multiple-select browse.
rowIndex - 0-based row index in the browse viewport.true if the row with the given index exist in the browse viewport.public void deselectFocusedRow()
public int getVisibleColumnCount()
public int getColumnCount()
public boolean deselectSelectedRow(int rowIndex)
Deselects the nth selected row in a browse.
Progress maintains a numbered list of selected rows, starting at 1. When the DESELECT-SELECTED-ROW(n) method is encountered, Progress searches this list to find the nth selected row.
rowIndex - 0-based index of the row (in the list of selected rows) to deselect.true if the row is successfully deselected.public static BrowseTextAlignment getTextAlign(BrowseColumn column)
column - Target browse column.public static BrowseTextAlignment getTextAlign(BrowseColumnConfig columnConfig)
columnConfig - Config of the target browse column.public static java.lang.String getCellText(BrowseColumnConfig columnConfig, BaseDataType var) throws DisplayFormatCheckException
columnConfig - Config of the browse column the cell belongs to.var - Cell data.DisplayFormatCheckException - Data is incompatible with format.public static java.lang.String getCellTextNoError(BrowseColumnConfig columnConfig, BaseDataType var)
columnConfig - Config of the browse column the cell belongs to.var - Cell data.protected static java.lang.String generateQuestionMarks(BrowseColumnConfig columnConfig, BaseDataType var)
columnConfig - Config of the browse column the cell belongs to.var - Cell data.public BrowseConfig config()
config in interface Widget<O extends OutputManager<?>>config in interface ConfigOwner<BrowseConfig>config in class AbstractWidget<O extends OutputManager<?>>public abstract void drawCaret()
drawCaret in interface Widget<O extends OutputManager<?>>drawCaret in class AbstractWidget<O extends OutputManager<?>>public abstract void draw()
draw in interface Widget<O extends OutputManager<?>>draw in class AbstractContainer<O extends OutputManager<?>>public boolean focusTraversable()
focusTraversable in interface Widget<O extends OutputManager<?>>focusTraversable in class AbstractContainer<O extends OutputManager<?>>true if this component is enabled and visible.public Widget<O> currentFocus()
getDefaultFocus() because focus placement
inside BROWSE can't be switched from initial component until subcomponent
creation or deletion.currentFocus in interface Container<O extends OutputManager<?>>currentFocus in class AbstractContainer<O extends OutputManager<?>>Container.currentFocus()public Widget<O> defaultFocus()
defaultFocus in interface Container<O extends OutputManager<?>>defaultFocus in class AbstractContainer<O extends OutputManager<?>>Container.defaultFocus()public boolean hasFocusable(boolean next,
Widget<O> exclude)
next - true if this must search for a next focusable
widget, false for a previous focusable widget.exclude - This is ignored since the current column is internally known
by the browse.true if there is at least one other column
that can be focused.public boolean hasFocusable(Widget<O> exclude)
hasFocusable in interface Container<O extends OutputManager<?>>hasFocusable in class AbstractContainer<O extends OutputManager<?>>exclude - A component to ignore or null if any focusable
component will do.true if there is at least one other component
that can be focused.public void nextFocus()
nextFocus in interface Container<O extends OutputManager<?>>nextFocus in class AbstractContainer<O extends OutputManager<?>>Container.nextFocus()public void prevFocus()
prevFocus in interface Container<O extends OutputManager<?>>prevFocus in class AbstractContainer<O extends OutputManager<?>>Container.prevFocus()public boolean isSelectionMultiple()
public void setSelectionMultiple(boolean multiple)
multiple - true enable multiple selection,
false - disable multiple selection.public boolean isRowSelected(int rowIndex)
rowIndex - 0-based row's index in browse model.public integer getFocusedRow()
1 is returned,public int getSelectedRowsCount()
public int getSelectedRowIndex(int selIndex)
selIndex - 0-based position of the row in the list of selected rows. -1 for the
last selected row.ErrorConditionException - If selIndex is invalid or if there are no "available" rows.public void checkDeleteEntryRowIndex()
ErrorConditionException - If the current row is not existing or not in the view.public int getSelectedRowIndex(int selIndex,
boolean ignoreNotAvail,
boolean newAsAvail)
selIndex - 0-based position of the row in the list of selected rows. -1 for the
last selected row.ignoreNotAvail - If true then exception is not raised if the selected row is not
available.newAsAvail - Count new rows as "available". Affects error handling.ErrorConditionException - If selIndex is invalid or if there are no "available" rows and
ignoreNotAvail parameter is not specified.public int[] getSelectedRowIndexes()
ErrorConditionException - If selIndex is invalid or if there are no "available" rows.public int getMaximalSelectedRowIndex()
-1
if there are no selected rows.public void fireDefaultAction()
public void fireValueChanged()
public void startTrigger(int eventCode)
startTrigger in interface Widget<O extends OutputManager<?>>eventCode - The event codepublic void completeTrigger(int eventCode)
completeTrigger in interface Widget<O extends OutputManager<?>>eventCode - The event codepublic boolean acceptTrigger(int eventCode)
acceptTrigger in interface Widget<O extends OutputManager<?>>eventCode - The target events codepublic boolean isCurrentRowModified()
true if current row is modified and
false otherwise.public void resetColUpdatesInCurrentRow(int col)
col - a column ordinal.public void refreshCurrentRow(BrowseRow row)
row - Container with the new data for the current row. If an BrowseRow.data element
is null, corresponding cell shouldn't be refreshed.public void rowEntryCreated(int newRowId)
newRowId - 0-based index of the newly created row in the browse model. Replaces the old
negative row id of the current new row.public void rowEntryDeleted(int deletedRowId)
deletedRowId - 0-based index of the deleted row in the browse model.public boolean isCurrentRowInView()
true if the current row is the view.public boolean isNewRow()
true if the current row is a new row and is not present in the
database.true if the current row is a new row and false otherwise.public boolean isNewRow(int newRowIndex)
true if the given row is a new row and is not present in the
database.newRowIndex - 0-based index of the target row in the browse model (new rows have specific negative
indexes).true if the given row is a new row and false otherwise.public abstract int getBrowseColumnY()
column.Y attribute for the columns of this browse: vertical offset of the
current row from the top of the browse, in pixels for GUI or in chars for ChUI. The value is the same
for all columns in the browse.column.Y attribute for the columns of this browse.public boolean insertRow(boolean after)
throws ErrorConditionException
after - true if the row is added after the last selected row.
false if the row is added before the last selected row.true if the row was successfully added.ErrorConditionException - In specific cases when row cannot be added. The exception contains proper 4GL error
code.public void insertRowSecondPart()
insertRow(boolean) processing, which is usually executed after the trigger
containing the INSERT-ROW call, finishes.public boolean needsInsertRowContinueOnEntry(BrowseColumn entryColumn)
true if we need to perform the second stage of INSERT-ROW immediately,
as a reaction to browse column "entry" event.entryColumn - The column which received an "entry" event.public boolean isFocusedRowSelected()
true if row which has focus is selected.true if row which has focus is selected and
false otherwise.public int getDown()
Browse.
Amount of available data can be less that number of rows which
potentially can be displayed by the Browse.public BrowseModel getModel()
BrowseModel.BrowseModel used by
Browse.public BrowseColumnConfig getPrevColumn(BrowseColumnConfig column)
column - Base column.public BrowseColumnConfig getNextColumn(BrowseColumnConfig column)
column - Base column.public int[] getIdsOfColumnWidgets()
public boolean isSelectedRowAvailable(int selIndex,
boolean newAsAvailable)
selIndex - 0-based position of the row in the list of selected rows. If -1 is
passed then all of the selected rows are checked for availability.newAsAvailable - Count new rows as "available".true if the specific selected row was available (could be fetched) at
the moment of its selection.
If -1 is passed then true is returned if at least one
of the selected rows is available.public void doLayout()
doLayout in interface Container<O extends OutputManager<?>>doLayout in class AbstractContainer<O extends OutputManager<?>>public Widget getFocusedWidget()
public void setEditorReadOnly(boolean readOnly)
readOnly - true to set editor in 4GL READ-ONLY mode.public BrowseColumnConfig getColumnCfg(int columnOrdinal)
BrowseColumnConfig for specified index.columnOrdinal - 0-based index of the column among all columns (i.e. column ordinal).BrowseColumn instance or null in
case of invalid index.public boolean isEditorComboBox()
true if the current editor is a combo-box.protected BrowseColumnConfig getVisibleColumnCfg(int visibleColumnIndex)
BrowseColumnConfig for specified index.visibleColumnIndex - 0-based index of the column among the visible columns.BrowseColumn instance or null in
case of invalid index.protected Widget getActiveEditor()
null.public boolean isEditing()
true if editing is in progress.true if editing is in progress.protected FillIn getActiveFillIn()
isEditorFillIn() to check if the active editor is a fill-in, otherwise
ClassCastException may be thrown.java.lang.ClassCastException - if the active editor is not a fill-in.protected ToggleBox getActiveToggleBox()
isEditorToggleBox() to check if the active editor is a toggle-box, otherwise
ClassCastException may be thrown.java.lang.ClassCastException - if the active editor is not a toggle-box.protected ComboBox getActiveComboBox()
isEditorComboBox() to check if the active editor is a combo-box, otherwise
ClassCastException may be thrown.java.lang.ClassCastException - if the active editor is not a combo-box.protected boolean isEditorFillIn()
true if the current editor is a fill-in.protected boolean isEditorToggleBox()
true if the current editor is a toggle-box.protected BaseDataType getEditorValue()
DataContainer.getValue().protected boolean isEditorModified()
true if the widget value was modified. See
DataContainer.isModified().true if the widget value was modified.protected void setEditorValue(BaseDataType value)
DataContainer.setValue(BaseDataType).value - value of the editor widget to set.protected boolean isNewEditingRowOutOfTheView()
true if there is a new editing row which is out of the view.protected abstract void columnToView(int visibleColumnIndex)
visibleColumnIndex - 0-based index of the column among the visible columns.public boolean startEdit()
public boolean startEdit(WidgetId prevFocus)
prevFocus - The previous focused widget, which will lose focus.true if editing was on and ENTRY triggered allowed it to stop.public boolean stopEdit(WidgetId nextFocus)
nextFocus - The widget which will be focused next.true if editing was stopped; false
if we were not in edit mode or validation failed.protected boolean stopEdit(boolean undo,
boolean validate)
undo - true if the value in the cell is undone rather than committed.validate - true to perform validation.true if editing was stopped; false
if we were not in edit mode or validation failed.protected boolean stopEdit(WidgetId nextFocus, boolean undo, boolean validate)
nextFocus - The widget which will be focused next.undo - true if the value in the cell is undone rather than committed.validate - true to perform validation.true if editing was stopped; false
if we were not in edit mode or validation failed.protected boolean stopEdit(WidgetId nextFocus, boolean undo, boolean validate, boolean skipCellLeave)
nextFocus - The widget which will be focused next.undo - true if the value in the cell is undone rather than committed.validate - true to perform validation.skipCellLeave - true to skip invocation of cell LEAVE trigger even if the cell
value is committed.true if editing was stopped; false
if we were not in edit mode or validation failed.private boolean validateStopEdit(boolean undo,
boolean validate)
undo - true if the value in the cell is undone rather than committed.validate - true to perform validation.true if validation passed or we were not in edit mode.protected boolean checkChuiRowInView()
true if the the top row in the view has been set as the current row.public void finishStopEdit()
public boolean isInColumnEntryTrigger()
true if an column ENTRY trigger is running.true if an column ENTRY trigger is running.public boolean isInsertingRow()
public void setKeepEditingColumn()
INSERT-ROW is happening, keep the current editing column when the new row is added rather
than reset it to the first editable column.protected WidgetConfig getEditorConfig(int columnOrdinal)
columnOrdinal - 0-based ordinal of the target column.null if the column
is not editable.protected boolean validateEditorValue()
true if no validation for the current column or validation was
successful.protected abstract void initEditorConfig(BaseConfig cfg)
cfg - Editor widget config.protected abstract void addEditor(Widget editor)
editor - Editor widget.protected void cleanupEditor(Widget editor)
editor - Editor widget.protected int addNewRow(int rowIndex,
BaseDataType[] rowData,
int viewportRow,
boolean after)
rowIndex - 0-based index of the row in the browse model or -1 if an empty row is
generated.rowData - Row cache data. null to generate an empty row.viewportRow - 0-based index of the base row in the viewport.after - true if the row will be inserted after the base row. false
if before the base row.protected boolean startEdit(boolean updateSelection)
updateSelection - For multi-selection browse: if true, current row becomes the only
selected row.true if editing was on and ENTRY triggered allowed it to stop.protected boolean startEdit(boolean updateSelection,
boolean sendEntry)
updateSelection - For multi-selection browse: if true, current row becomes the only
selected row.sendEntry - Its true value permits to emit the row-entry event.true if editing was on and ENTRY triggered allowed it to stop.protected boolean startEdit(WidgetId prevFocus, boolean updateSelection, boolean useValue, BaseDataType value)
prevFocus - The previous focused widget, which will lose focus.updateSelection - For multi-selection browse: if true, current row becomes the only
selected row.useValue - Use the specified value for the editor instead of getting it from the browse cache.value - Value to use in the editor. Can be null (valid value). Set
useValue to true if you want to use this parameter.true if editing was on and ENTRY triggered allowed it to stop.protected boolean startEdit(WidgetId prevFocus, boolean updateSelection, boolean useValue, BaseDataType value, boolean sendEntry)
prevFocus - The previous focused widget, which will lose focus.updateSelection - For multi-selection browse: if true, current row becomes the only
selected row.useValue - Use the specified value for the editor instead of getting it from the browse cache.value - Value to use in the editor. Can be null (valid value). Set
useValue to true if you want to use this parameter.sendEntry - Its true value permits to emit the row-entry event.true if editing was on and ENTRY triggered allowed it to stop.protected Widget createEditor(boolean useValue, BaseDataType value)
useValue - Use the specified value for the editor instead of getting it from the browse cache.value - Value to use in the editor. Can be null (valid value). Set
useValue to true if you want to use this parameter.protected FillIn createEditingFillIn(boolean useValue, BaseDataType value)
useValue - Use the specified value for the editor instead of getting it from the browse cache.value - Value to use in the editor. Can be null (valid value). Set
useValue to true if you want to use this parameter.protected void displayErrorMessage(java.lang.String message)
message - Message to display.protected boolean updateColumn(int columnOrdinal,
BaseDataType var)
columnOrdinal - 0-based index of the cell to update.var - New value of the cell.true if column value was changed.void switchToPrevCell()
protected void switchToNextCell()
protected boolean isFirstLastRowCopyQuirk()
falseprivate void setColumnEditMode(boolean mode)
mode - TRUE when editing mode is ON, FALSE otherwise.private boolean saveCurrentRow(boolean updateModel)
updateModel - true if data model is updated. Otherwise only cache is updated.private void notifyRowReleased()
private void resetModifiedFlags()
protected Browse.RowLeaveResult releaseCurrentRow()
private Browse.RowLeaveResult releaseCurrentRow(boolean updateModel, boolean triggerRowLeave, boolean startFromSave)
updateModel - true if data model is updated. Otherwise only cache is updated and
validation does NOT take place.triggerRowLeave - true to trigger ROW-LEAVE event.startFromSave - true if row leaving procedure execution should start from row save step, i.e. row
save, reposition to new row and start edit is executed, while stop edit and ROW-LEAVE trigger
invocation is omitted.private Browse.RowLeaveResult releaseCurrentRow(boolean updateModel, boolean triggerRowLeave, boolean startFromSave, WidgetId nextId)
updateModel - true if data model is updated. Otherwise only cache is updated and
validation does NOT take place.triggerRowLeave - true to trigger ROW-LEAVE event.startFromSave - true if row leaving procedure execution should start from row save step, i.e. row
save, reposition to new row and start edit is executed, while stop edit and ROW-LEAVE trigger
invocation is omitted.nextId - ID of the next focusable widget.protected BaseDataType[] dcGetRowData(int rowIndex)
rowIndex - Row's index in model.protected BrowseRow dcGetRow(int rowIndex)
rowIndex - Row's index in model.public boolean hasRowMarkers()
BrowseWidget.hasRowMarkers().true if the browse has row markers drawn.private void dcUpdateRow(int rowIndex,
int[] cellIndices,
BaseDataType[] cellValues,
boolean updateModel,
boolean rowInView,
BrowseRow editedRowData)
throws DataValidationException
rowIndex - 0-based row's index in model.cellIndices - Indexes of cells to update.cellValues - New values of cells to update.updateModel - true if data model is updated. Otherwise only cache is updated.rowInView - true if the edited row is in view.editedRowData - Data of the edited row before editing has started.DataValidationException - New values don't passed database validation rules.public void onKeyPressed(KeyInput event)
onKeyPressed in interface KeyListenerevent - Reference to keyboard event.public void processEvent(Event evt)
processEvent in interface Widget<O extends OutputManager<?>>processEvent in class AbstractWidget<O extends OutputManager<?>>evt - Event to process.Widget.processEvent(com.goldencode.p2j.ui.client.event.Event)public void onKeyTyped(KeyInput event)
onKeyTyped in interface KeyListenerevent - Event which triggered this call.KeyListener.onKeyTyped(KeyInput)public void notifyKeyPressedInEditor(KeyInput key)
key - The key which was pressed in the editor.protected void switchCurrentRowSelection()
protected int getPageSize()
protected void setCurrentRow(int currRow)
currRow - New current row (0-based index in the browse model).private void setCurrentRow(int currRow,
boolean allowDeletedRow)
currRow - New current row (0-based index in the browse model).allowDeletedRow - If true, then currRow becomes the current row even
if it doesn't exist in the result set anymore. If false then the next
available row becomes the current row if the currRow doesn't exist.protected void setCurrentRow(int currRow,
boolean updateSelection,
boolean allowDeletedRow)
currRow - New current row (0-based index in the browse model).updateSelection - true if selection should be adjusted.allowDeletedRow - If true, then currRow becomes the current row even
if it doesn't exist in the result set anymore. If false then the next
available row becomes the current row if the currRow doesn't exist.protected void refreshColumnsAttributes()
protected boolean isAggressiveCurrentRowSelection()
true if the current row of the single-selection browse is selected on
FOCUS-GAINED and some other events.protected void handleTabKey()
public int getRepositionedRow()
public boolean isConditionalReposition()
true if reposition mode is "CONDITIONAL", false if
reposition mode is "ALWAYS".public BrowseColumnConfig getCurrentColumn()
currColumn value or null if not editing..public void setCurrentColumn(int columnOrdinal)
columnOrdinal - Column ordinal in the browse definition (0-based). Count includes invisible columns too.public void setCurrentColumnId(BrowseColumn column)
BrowseConfig.currentColumnID, which effectively updates CURRENT-COLUMN on the
server side.column - New current column.public java.lang.String getColumnText(int columnOrdinal)
columnOrdinal - 0-based index of the column among all columns.public void removeFromSelection(int deletedRowIndex)
deletedRowIndex - 0-based index of the deleted row in the browse model. -1 if all selected rows are
deleted.private int getRowDeletionShift(int baseRow)
baseRow - 0-based index of the base row in the browse model.protected BaseDataType getValue(int columnOrdinal)
columnOrdinal - 0-based column ordinal.protected BaseDataType getValue(int columnOrdinal, boolean useSelection)
columnOrdinal - 0-based column ordinal.useSelection - true to get the value from the last selected row, where applicable. false to
get the value from the current row.public BaseDataType getColumnValue(int columnOrdinal)
columnOrdinal - 0-based index of the column among the columns.public void setColumnValue(int columnOrdinal,
BaseDataType value,
java.lang.String fmt)
columnOrdinal - 0-based index of the column among all columns.value - The value for the cell.fmt - The format under which the value should be formatted.public boolean isModified(int columnOrdinal)
columnOrdinal - 0-based index of the column.true if value is changed.public void refresh(boolean deleteCurrentRowMode)
deleteCurrentRowMode - true if this function is used for update on DELETE-CURRENT-ROW.
false if this function is used for update on REFRESH.public void show()
show in interface Widget<O extends OutputManager<?>>show in class AbstractWidget<O extends OutputManager<?>>public void executePendingRefresh(boolean queryReopened,
boolean repositionBeforeReopen,
int repositionedRow)
queryReopened - true if there is a pending query reopening.repositionBeforeReopen - true if the last pending reposition was before the last pending
reopening.repositionedRow - 0-based index of the last row the query was repositioned to. -1 if
there is no repositioned row.public void refreshScrollRow(boolean leaveOnRowInView,
boolean preserveViewportRow)
leaveOnRowInView - If the current row is in the viewport, do not update the scroll row.preserveViewportRow - Try to preserve the current viewport row (i.e. the row at the same position in
the viewport becomes the current row after refresh).public void refreshScrollRow(int scrollRow,
boolean leaveOnRowInView,
boolean preserveViewportRow)
scrollRow - New scroll row.leaveOnRowInView - If the current row is in the viewport, do not update the scroll row.preserveViewportRow - Try to preserve the current viewport row (i.e. the row at the same position in
the viewport becomes the current row after refresh).public void refreshScrollRow(boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError,
int targetRepositionRow,
boolean leaveOnOnePageMode)
leaveOnRowInView - If the current row is in the viewport, do not update the scroll row.preserveViewportRow - Try to preserve the current viewport row (i.e. the row at the same position in
the viewport becomes the current row after refresh).repositioned - If the browse is refreshed because the query was repositioned.repositionError - For reposition mode - if an error has happened during reposition.targetRepositionRow - For reposition mode - row used as the target for reposition. If it was deleted,
reposition with fetching may end up on a different row.leaveOnOnePageMode - If the number of rows in the browse is less or equal DOWN, do not re-fetch rows.public void refreshScrollRow(int scrollRow,
boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError)
scrollRow - New scroll row.leaveOnRowInView - If the current row is in the viewport, do not update the scroll row.preserveViewportRow - Try to preserve the current viewport row (i.e. the row at the same position in
the viewport becomes the current row after refresh).repositioned - If the browse is refreshed because the query was repositioned.repositionError - For reposition mode - if an error has happened during reposition.public void refreshScrollRow(int scrollRow,
boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError,
int targetRepositionRow,
boolean leaveOnOnePageMode)
scrollRow - New scroll row.leaveOnRowInView - If the current row is in the viewport, do not update the scroll row.preserveViewportRow - Try to preserve the current viewport row (i.e. the row at the same position in
the viewport becomes the current row after refresh).repositioned - If the browse is refreshed because the query was repositioned.repositionError - For reposition mode - if an error has happened during reposition.targetRepositionRow - For reposition mode - row used as the target for reposition. If it was deleted,
reposition with fetching may end up on a different row.leaveOnOnePageMode - If the number of rows in the browse is less or equal DOWN, do not re-fetch rows.public void refreshAfterDeletion(int rowIndex)
rowIndex - 0-based index of the deleted row in the browse model. -1 if all of the
selected rows were deleted.protected int getEditorCursorOffset()
-1 if there's no active editor, or the editor is not of
a type which has a cursor.protected void setEditorCursorOffset(int cursorOffset)
cursorOffset - 0-based cursor offset from the left bound of the editor.protected BrowseRow[] getRows(int startRowIndex, int count, boolean forward, RowDisplayStrategy displayStrategy)
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.displayStrategy - Specifies type of action for which rows are fetched and defines how rows are
iterated / displayed.null is returned.protected BrowseRow[] getRows(char searchChar, int searchColumn, int viewportTopRow, int viewportBottomRow)
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.null is returned.protected int getRowDisplayTriggerId()
-1 if there is no
such trigger.protected ScreenBuffer[] getScreenBufferForTrigger(int triggerId)
triggerId - ID of the trigger.null if no valid trigger ID is specified.protected void conditionalPendingExtraRowFetch()
pendingExtraRowFetch flag, which makes browse fetch an extra row on the next scroll
in order to determine if one- or multi-page scrolling mode should take place.public void queryClosed()
public void queryRepositioned(boolean repositionError,
int targetRepositionRow)
repositionError - For reposition mode - if an error has happened during reposition.targetRepositionRow - For reposition mode - row used as the target for reposition. If it was deleted,
reposition with fetching may end up on a different row.public boolean selectNextRow()
Deselects all currently selected rows in a browse and selects the row after the deselected row.
This method also repositions the query to the new row and copies the record into the database buffer. The browse automatically scrolls to the selected row if it is out of view.
This method is intended for use with a browse that supports the selection of a single row at a time (MULTIPLE attribute is set to FALSE). If more than one row is selected when you execute this method, all of the selected rows are deselected and the record after the last selected row becomes the selected row.
true on success.public boolean selectPreviousRow()
Deselects all currently selected rows in a browse and selects the row before the deselected row.
This method also repositions the query to the new row and copies the record into the database buffer.The browse automatically scrolls to the selected row if it is out of view.
This method is intended for use with a browse that supports the selection of a single row at a time (MULTIPLE attribute is set to FALSE). If more than one row is selected when you execute this method, all of the selected rows are deselected and the record before the last selected row becomes the selected row.
true on success.public void moveColumn(int srcIndex,
int destIndex)
Repositions a column in a browse widget.
srcIndex - 0-based position of the column to be moved (column ordinal).destIndex - 0-based position to which the column is moved (column ordinal).public void applyEnhancedConfigClient()
public boolean isSavingRow()
true if we are in the process of saving of the edited row.true if we are in the process of saving of the edited row.public boolean clearWidget()
clearWidget in interface Widget<O extends OutputManager<?>>clearWidget in class AbstractWidget<O extends OutputManager<?>>true.public void scrollToCurrentRow()
The position of the scrolled row is the first row in the browse viewport, unless the current row is already visible. In this case, the current row remains in the original position.
ErrorConditionException - if a numbered error occurs.public void scrollToSelectedRow(int selectedRowIndex)
selectedRowIndex - Selected row within the browse. A numbered list of selected rows, starting at 1 is
maintained. When the SCROLL-TO-SELECTED-ROW(n) method is encountered,
the list is iterated to find the nth selected row.ErrorConditionException - if a numbered error occurs.protected int getNewRowsBefore(int baseViewportRow)
baseViewportRow - 0-based index of the base row in the viewport.protected boolean advanceRowSelection(boolean forward)
selectNextRow() and selectPreviousRow().forward - If true then it corresponds selectNextRow(). If
false - selectPreviousRow().true on success.protected boolean isViewportEdge(int rowIndex,
boolean forward)
rowIndex - 0-based row index in the browse model.forward - true to check if it is the last row, false to check if it
is the first row.true if the specified row is the first (if forward is
true) or last (if forward is false) row in
the view. If the page is not full then the last row on the page is NOT considered to
be the last row in the view.protected boolean advanceCurrRowOrSelection(boolean advanceSelection,
boolean forward,
boolean handleEditing,
int rowIndex)
advanceSelection - true for selection mode. false for current row mode.forward - true to advance to the next row. false to advance to the
previous row.handleEditing - true to handle start/stop editing. For current row mode only.rowIndex - 0-based index of the row which should be used as a base for selection advancing (i.e.
the row before or after it will be selected). For selection mode only.true if current/selected row has changed.protected int getLastAvailableSelectedRow(boolean includeNewRows)
includeNewRows - Include new rows in the search (consider them "available").-1 if there
are no "available" selected rows.public boolean isRowInView(int rowIndex)
rowIndex - Index of the target row in the browse model.true if the specified row is in the viewport.protected boolean goUp(boolean handleEditing)
handleEditing - If true then do startEdit()/stopEdit(com.goldencode.p2j.ui.WidgetId) calls.true if the current row has changed.protected boolean goUp(boolean handleEditing,
boolean fireValueChanged,
boolean startFromSave)
handleEditing - If true then do startEdit()/stopEdit(com.goldencode.p2j.ui.WidgetId) calls.fireValueChanged - If true then VALUE-CHANGED event is fired if current row has changed.startFromSave - true if row leaving procedure execution should start from row save step, i.e. row
save, reposition to new row and start edit is executed, while stop edit and ROW-LEAVE trigger
invocation is omitted.true if the current row has changed.protected boolean goDown()
true if the current row has changed.protected boolean goDown(boolean handleEditing,
boolean fireValueChanged,
boolean startFromSave)
handleEditing - If true then do startEdit()/stopEdit(com.goldencode.p2j.ui.WidgetId) calls.fireValueChanged - If true then VALUE-CHANGED event is fired if current row has changed.startFromSave - true if row leaving procedure execution should start from row save step, i.e. row
save, reposition to new row and start edit is executed, while stop edit and ROW-LEAVE triggertrue if the current row has changed.protected boolean goUpWithSelection(int rowIndex)
rowIndex - 0-based index of the base row in the browse mode, the previous row before it will be
selected.true if there are rows before the given one.protected boolean goDownWithSelection(int rowIndex)
rowIndex - 0-based index of the base row in the browse mode, the next row after it will be
selected.true if there are rows after the given one.protected boolean isOnePageScrollingMode()
true if "one-page" scrolling mode is active. false if
"multi-page" scrolling mode is active.protected boolean isRefreshedOnEnable()
trueprotected boolean scrollToRow(int scrollRow)
scrollRow - The new scroll row (i.e. the first row in the viewport).true if we got any rows from the server.protected boolean scrollToRow(int scrollRow,
boolean setAsCurrentRow)
scrollRow - The new scroll row (i.e. the first row in the viewport).setAsCurrentRow - Set the new scroll row as the current row.true if we got any rows from the server.protected boolean scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows)
scrollRow - The new scroll row (i.e. the first row in the viewport).setAsCurrentRow - Set the new scroll row as the current row.leaveOnNoRows - Return if there are no rows in the result set (otherwise cache will be cleared).true if we got any rows from the server.protected boolean scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode)
scrollRow - The new scroll row (i.e. the first row in the viewport).setAsCurrentRow - Set the new scroll row as the current row.leaveOnNoRows - Return if there are no rows in the result set (otherwise cache will be cleared).ignoreOnePageScrollingMode - Perform scroll as if the browse is in multiple-pages scrolling mode.true if we got any rows from the server.protected boolean scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode,
boolean honorRepositionedRow)
scrollRow - The new scroll row (i.e. the first row in the viewport).setAsCurrentRow - Set the new scroll row as the current row.leaveOnNoRows - Return if there are no rows in the result set (otherwise cache will be cleared).ignoreOnePageScrollingMode - Perform scroll as if the browse is in multiple-pages scrolling mode.honorRepositionedRow - Honor repositioned row set by SET-REPOSITIONED-ROW.true if we got any rows from the server.protected boolean scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode,
boolean honorRepositionedRow,
boolean allowStartEdit)
scrollRow - The new scroll row (i.e. the first row in the viewport).setAsCurrentRow - Set the new scroll row as the current row.leaveOnNoRows - Return if there are no rows in the result set (otherwise cache will be cleared).ignoreOnePageScrollingMode - Perform scroll as if the browse is in multiple-pages scrolling mode.honorRepositionedRow - Honor repositioned row set by SET-REPOSITIONED-ROW.allowStartEdit - Allow to start editing for the first scroll.true if we got any rows from the server.protected boolean scrollToRow(int scrollRow,
boolean setAsCurrentRow,
boolean leaveOnNoRows,
boolean ignoreOnePageScrollingMode,
boolean honorRepositionedRow,
boolean allowStartEdit,
int oneTimeRepositionedRow,
boolean updateSelection)
scrollRow - The new scroll row (i.e. the first row in the viewport).setAsCurrentRow - Set the new scroll row as the current row.leaveOnNoRows - Return if there are no rows in the result set (otherwise cache will be cleared).ignoreOnePageScrollingMode - Perform scroll as if the browse is in multiple-pages scrolling mode.honorRepositionedRow - Honor repositioned row set by SET-REPOSITIONED-ROW.allowStartEdit - Allow to start editing for the first scroll.oneTimeRepositionedRow - 0-based repositioned row used for this scroll action. -1 if not
specified.updateSelection - true if selection should be adjusted.true if we got any rows from the server.protected void updateLabelsHeight()
protected int nextNewRowNumber()
protected boolean isFirstBrowseRow()
true if we cannot scroll higher current row.protected int getFirstExistingRow()
-1 if there are no existing rows.protected int getLastExistingRow()
-1 if there are no existing rows.protected int getEdgeExistingRow(boolean first)
first - true to look for the first row. false to look for the last
row.-1 if there are no existing rows.public void parentFrameViewed()
public boolean isEditPossible()
true if there is at least one editable column.public BrowseColumnConfig[] getInvisibleColumns()
protected int dcGetRowIndex(int rowIndex)
rowIndex - Index in the model.public boolean invokeLeaveCellTrigger(WidgetId nextFocus)
nextFocus - The next focusable widget.true if the LEAVE trigger allows the leave.public boolean invokeRowEntryTrigger()
true if there is no ROW-ENTRY trigger or it has returned normally.
false if NO-APPLY has been returned by the trigger.public boolean invokeRowEntryTrigger(WidgetId leaveWidgetId)
leaveWidgetId - ID of the widget left.true if there is no ROW-ENTRY trigger or it has returned normally.
false if NO-APPLY has been returned by the trigger.public boolean hasRows()
true if the browse contains one or more rows.public void resetFirstEditing()
firstEditing flag to false.public Browse.RowLeaveResult invokeRowLeaveTrigger(WidgetId nextId)
nextId - The ID of the next focusable widget.protected Browse.RowLeaveResult leaveRow()
protected Browse.RowLeaveResult leaveRow(boolean startFromSave)
startFromSave - true if row leaving procedure execution should start from row save step, i.e. row
save, reposition to new row and start edit is executed, while stop edit and ROW-LEAVE trigger
invocation is omitted.protected Browse.RowLeaveResult leaveRow(boolean startFromSave, WidgetId nextId)
startFromSave - true if row leaving procedure execution should start from row save step, i.e. row
save, reposition to new row and start edit is executed, while stop edit and ROW-LEAVE trigger
invocation is omitted.nextId - ID of the next focusable widget.protected void scrollToEditableRow()
private int getFirstEditableColumn()
visible columns or
-1 if there is no editable column.protected BrowseColumnConfig[] getVisibleColumns()
protected BrowseColumnConfig[] getColumns()
protected void resetColumnsCache()
protected void updateMaxDataGuess(boolean lastReached)
lastReached - true if the last row in the browse model has been reached.protected void notifyBrowseScrolled()
protected java.lang.Integer ordinalToVisible(int columnOrdinal)
columnOrdinal - Column ordinal, i.e. 0-based index of the column among all columnsnull if the
column is not visible.protected int visibleToOrdinal(int visibleColumnIndex)
visibleColumnIndex - 0-based index of the column among the visible columns.protected void populateColumnsCache()
BrowseConfig.columnIds.protected int getNumberForLastRow()
getRows(int, int, boolean, RowDisplayStrategy)
to make it return the last row in the result set.protected boolean setCurrentRowSelected()
protected void triggerOffEnd(boolean noRowsTriggers)
noRowsTriggers - true triggers off-end even when the browse is empty.protected void triggerOffEnd(boolean noRowsTriggers,
boolean triggeredByScrollbar)
noRowsTriggers - true triggers off-end even when the browse is empty.triggeredByScrollbar - true if the function is triggered by a scrollbar.private boolean isAnyRowSelected()
true if the browse has any selected row, false otherwise.