public abstract class Browse<O extends OutputManager<?>> extends FixedSizeContainer<O> implements WidgetWithConfig<BrowseConfig>, FocusListener, KeyListener
Modifier and Type | Class and Description |
---|---|
protected static class |
Browse.SelectedRow
Container which holds row index and row availability (i.e.
|
Widget.ZOrderClass
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.
|
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.
|
protected java.lang.String |
columnHelp
Help message for current column.
|
private BrowseColumnConfig[] |
columnsCache
Cache of collected columns.
|
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 int |
editedRowIndex
0-based index of the current edited row in the browse model.
|
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.
|
protected boolean |
hadDraw
Set to true if browse was drawn at least once.
|
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.
|
protected BrowseRow[] |
intermediateDcData
Cache of current rows supplemented with "intermediate" rows (i.e.
|
protected int |
NEW_ROWS_NUMERATION_START
Index of the first added new row.
|
private int |
newRowNumber
Next unique row number for a new row.
|
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 |
pseudoFocus
This variable is used to reproduce special drawing behavior for case
when query is initialized after browse is displayed first time.
|
protected java.lang.String[] |
rcLabels
Rendered columns labels area.
|
protected int |
rowCountAssessment
The number that allows to assess if the total number or rows is more or less than the page
size.
|
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 java.util.LinkedHashSet<Browse.SelectedRow> |
selectedRowIndices
Indexes of selected rows in
Integer form. |
boolean |
separatorQuirk
Set to
true when separators need to be underscored. |
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
Browse(WidgetId id,
BrowseConfig cfg)
Constructs the Browse widget.
|
Modifier and Type | Method and Description |
---|---|
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() . |
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 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 cellColumn)
Setups scrolling to fully (as possible) show the given column.
|
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 BaseDataType[] |
dcGetRow(int rowIndex)
Returns the data row 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 |
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 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).
|
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.
|
(package private) BrowseColumnConfig |
getColumn(int columnIndex)
Return
BrowseColumn for specified index. |
int |
getColumnCount()
Get the number of columns.
|
protected BrowseColumnConfig[] |
getColumns()
Return information about columns.
|
java.lang.String |
getColumnText(int ordinal)
Get text value of the given column in current row.
|
BaseDataType |
getColumnValue(int ordinal)
Get value of the given column in current row.
|
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 BaseDataType |
getEditorValue()
Get value of the editor widget.
|
protected int |
getFirstExistingRow()
Get first existing (not new) row in the view.
|
int |
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.
|
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.
|
Widget<O> |
getLegacyWidget()
The method returns the legacy widget representing this widget.
|
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 |
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.
|
BaseDataType |
getValue()
Getting the BaseDataType object representing the current value.
|
protected BaseDataType |
getValue(int index)
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 boolean |
goDown(boolean handleEditing)
Scroll one row up and adjust current row.
|
protected boolean |
goDown(boolean handleEditing,
boolean fireValueChanged)
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)
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.
|
protected boolean |
incrementalScroll(int rowCount)
Scroll browse by the specified number of rows.
|
protected boolean |
incrementalScroll(int rowCount,
boolean forceTrailingSpace,
boolean incrementalRowDisplay)
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.
|
protected boolean |
invokeRowLeaveTrigger()
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. |
boolean |
isConditionalReposition()
Returns reposition mode set be SET-REPOSITIONED-ROW.
|
boolean |
isCurrentRowModified()
Return status of the updates of the current row.
|
boolean |
isEditing()
Returns
true if editing is in progress. |
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. |
protected 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 |
isModified(int ordinal)
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 |
isOnePageScrollingMode()
4GL has two scrolling modes: "one-page" scrolling mode which is used if the total number
of rows is less or equal page size and the "normal" mode.
|
protected boolean |
isRefreshedOnEnable()
Determines if browse refreshed on browse widget enabling.
|
static boolean |
isRightAligned(BrowseColumn column)
Determine if the browse column is right-aligned.
|
protected 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 boolean |
leaveRow()
Invoke ROW-LEAVE trigger and release the current row.
|
void |
moveColumn(int srcIndex,
int destIndex)
Implements the client side of the MOVE-COLUMN() widget method.
|
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.
|
abstract void |
notifyColumnsUpdated()
Notify the browse that some columns have been added to it.
|
void |
notifyColumnsUpdated(boolean resetColumns)
Notify the browse that some columns have been added to it.
|
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.
|
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.
|
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)
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)
Refresh scroll row in the browse and redisplay.
|
protected boolean |
releaseCurrentRow()
Finishes editing and commits row to model if some updates are available.
|
private boolean |
releaseCurrentRow(boolean updateModel)
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.
|
protected static java.lang.String |
renderCell(java.lang.String screen,
BrowseColumnConfig col,
int colWidth,
int scroll)
Renders the screen value into a cell.
|
void |
requestFocus()
Requesting the focus to the
Browse . |
protected void |
resetColumnsCache()
Reset cached information about columns.
|
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.
|
void |
setColumnValue(int ordinal,
BaseDataType value)
Set value for the given column in current row.
|
void |
setCurrentColumn(BrowseColumnConfig currentColumn)
Set current column to specified one.
|
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.
|
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 |
setReadOnly(boolean readOnly)
Set READ-ONLY attribute.
|
void |
setSelectionMultiple(boolean multiple)
Switch multiple selection on and off.
|
void |
show()
Show widget.
|
protected void |
startEdit()
Creates an editor for the current cell and adds it to the browse.
|
protected void |
startEdit(boolean updateSelection)
Creates an editor for the current cell and adds it to the browse.
|
protected void |
startEdit(boolean updateSelection,
boolean useValue,
BaseDataType value)
Creates an editor for the current cell and adds it to the browse.
|
protected boolean |
stopEdit(boolean undo)
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 |
undoValue()
Undo editing operation results and reset everything to initial state.
|
void |
undoValue(boolean startEdit)
Undo editing operation results and reset everything to initial state.
|
private boolean |
updateColumn(int index,
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.
|
minimumSize
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, cycleFocus, detach, dimension, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, height, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, normalizeZOrder, prepareWidgets, processKeyEvent, remove, repaint, replace, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setHidden, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
afterConfigUpdate
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, defaultMousePtr, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setHidden, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, supportsCustomMousePointer, topLevelWindow, window
public static final int CACHE_SIZE
protected final int NEW_ROWS_NUMERATION_START
protected BrowseModel browseModel
protected boolean currRowSelected
protected int currColumn
protected BaseDataType[] currRowUpdates
null
then no updates are available for the corresponding
cell.protected java.util.LinkedHashSet<Browse.SelectedRow> 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
private int currentRow
private boolean currentRowAvail
private boolean awaitingEndError
private int newRowNumber
protected java.lang.String columnHelp
protected boolean hadDraw
protected boolean pseudoFocus
protected int rowCountAssessment
-1
if the query is closed or we haven't got any rows yet;page size + 1
if the number of rows is more than the page size.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 int editedRowIndex
protected boolean savingRow
true
if we are in the process of saving of the edited row.public Color colorCurrent
protected Color colorHSep
protected Widget activeEditor
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
protected RowDisplayStrategy currentRowDisplayStrategy
protected BrowseRow[] intermediateDcData
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 abstract void notifyColumnsUpdated()
protected int getScrollRow()
0
if there are no rows.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)
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.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)
AbstractWidget
setEnabled
in interface Widget<O extends OutputManager<?>>
setEnabled
in class AbstractWidget<O extends OutputManager<?>>
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 FocusListener
event
- Reference to the event.public void onFocusLost(FocusEvent fe_)
Browse
widget loses the focus.
This method clears the focused flag.
onFocusLost
in interface FocusListener
fe_
- Reference to the event.public void undoValue()
public void undoValue(boolean startEdit)
startEdit
- true
to call startEdit()
after the value has been undone.public boolean valid()
true
.public void requestFocus()
Browse
.requestFocus
in interface Widget<O extends OutputManager<?>>
requestFocus
in class FixedSizeContainer<O extends OutputManager<?>>
public void setReadOnly(boolean readOnly)
readOnly
- New value for the attribute.public void selectAll()
public void deselectAll()
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 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 boolean isRightAligned(BrowseColumn column)
column
- Target browse column.true
if the target column is right-aligned.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.protected static java.lang.String renderCell(java.lang.String screen, BrowseColumnConfig col, int colWidth, int scroll)
screen
- Screen value.col
- Column to render.colWidth
- The full width for formatting.scroll
- Scrolling correction. Means the number of characters which
should be erased from the left (if positive) or from the right
(if negative). This scroll differs from the scroll in
DisplayFormat.formatScreenValue()
because it
means the scroll of the whole browse column not the scroll of
screen value inside the column.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 int 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 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 boolean isCurrentRowModified()
true
if current row is modified and
false
otherwise.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 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 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 void setCurrentColumn(BrowseColumnConfig currentColumn)
currentColumn
- Reference to BrowseColumn
instance of specified
column.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.BrowseColumnConfig getColumn(int columnIndex)
BrowseColumn
for specified index.columnIndex
- Column index, 0-based.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 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 cellColumn)
cellColumn
- The cell's column index in model.protected void startEdit()
protected boolean stopEdit(boolean undo)
undo
- true
if the value in the cell is undone rather than committed.true
if editing was stopped; false
if we were not in edit mode.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 void startEdit(boolean updateSelection)
updateSelection
- For multi-selection browse: if true
, current row becomes the only
selected row.protected void startEdit(boolean updateSelection, boolean useValue, BaseDataType value)
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.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.private boolean updateColumn(int index, BaseDataType var)
index
- 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()
false
private boolean saveCurrentRow(boolean updateModel)
updateModel
- true
if data model is updated. Otherwise only cache is updated.private void notifyRowReleased()
protected boolean releaseCurrentRow()
true
if all actions were successful.private boolean releaseCurrentRow(boolean updateModel)
updateModel
- true
if data model is updated. Otherwise only cache is updated.true
if all actions were successful.protected BaseDataType[] 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 KeyListener
event
- 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 KeyListener
event
- 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 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 java.lang.String getColumnText(int ordinal)
ordinal
- The column ordinal.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 index)
index
- The 0-based column index.public BaseDataType getColumnValue(int ordinal)
ordinal
- The column ordinal.public void setColumnValue(int ordinal, BaseDataType value)
ordinal
- The column ordinal.value
- The value for the cell.public boolean isModified(int ordinal)
ordinal
- The column ordinal.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)
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.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)
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.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 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.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.destIndex
- 0-based position to which the column is moved.public void notifyColumnsUpdated(boolean resetColumns)
resetColumns
- If true
columns cache in browse model is reset.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 Widget<O> getLegacyWidget()
getLegacyWidget
in interface Widget<O extends OutputManager<?>>
null
if none found.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.protected 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(boolean)
calls.true
if the current row has changed.protected boolean goUp(boolean handleEditing, boolean fireValueChanged)
handleEditing
- If true
then do startEdit()
/stopEdit(boolean)
calls.fireValueChanged
- If true
then VALUE-CHANGED event is fired if current row has changed.true
if the current row has changed.protected boolean goDown(boolean handleEditing)
handleEditing
- If true
then do startEdit()
/stopEdit(boolean)
calls.true
if the current row has changed.protected boolean goDown(boolean handleEditing, boolean fireValueChanged)
handleEditing
- If true
then do startEdit()
/stopEdit(boolean)
calls.fireValueChanged
- If true
then VALUE-CHANGED event is fired if current row has changed.true
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.protected boolean isRefreshedOnEnable()
true
protected 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.protected boolean isEditPossible()
true
if there is at least one editable column.protected int dcGetRowIndex(int rowIndex)
rowIndex
- Index in the model.protected boolean invokeRowLeaveTrigger()
true
if there is no ROW-LEAVE trigger or it has returned normally.
false
if NO-APPLY has been returned by the trigger.protected boolean leaveRow()
true
if ROW-LEAVE trigger returned normally (if it exists) and row
release was successful.protected void scrollToEditableRow()
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()