public class ThinClient extends java.lang.Object implements ClientExports, StateSynchronizer, Watcher, CloseListener, AdvanceListener, FlushListener
Modifier and Type | Class and Description |
---|---|
private class |
ThinClient.HidingProcessor
Widget/frame hiding processor
|
static class |
ThinClient.TriggerResult
Container for the flags related to trigger processing.
|
private static class |
ThinClient.WaitForOp
Container for data related to wait-for loops.
|
Modifier and Type | Field and Description |
---|---|
private ComboBox |
activeComboBox
Combo-box with active drop-down.
|
private boolean |
afterChoose
Force automatic clearing.
|
private int |
alertBoxActive
Counter of nested (just in case) alert boxes.
|
private boolean |
authMode
Authentication mode flag.
|
private java.lang.Runnable |
cleanupBlock
Pause cleanup block.
|
private java.lang.Object |
cleanupSynchronizer
Synchronization object for pause/Ctrl-C handling.
|
private java.util.logging.Logger |
clientLog
The client log
|
private java.util.logging.FileHandler |
clientLogFile
The client log file
|
private boolean |
condExit
Set to
true when condition exception may be thrown. |
private int |
conditionalFrameId
Tracks the frame ID associated with the conditional up or down.
|
private int |
conditionalUpDown
Tracks any conditional up or down that must be applied.
|
private BlockingOperation |
currentBlockingOp
Track the type of the current blocking operation.
|
private EventList |
currentEventList
Current active wait list.
|
private int |
currentStream
Tracks the id of the current output stream (-1 for interactive).
|
private boolean |
cursorVisible
Cache of the cursor visibility.
|
private java.lang.Thread |
dedicatedThread
When running in the server process, this is the user's thread.
|
private java.util.Set<java.lang.Integer> |
deferredCleanup
Tracks pseudo-terminals which need deferred cleanup processing.
|
private EnvironmentDaemon |
ed
Environment handling daemon.
|
private java.util.Stack<Widget> |
editingFocus
Stack of prior focus before an editing block started.
|
private java.util.Deque<Frame> |
editingFrames
Stack of frames targeted by editing blocks.
|
private static java.lang.String |
END_ERR_MSG
Exception message used in END-ERROR key processing.
|
private java.util.Stack<EventList> |
eventLists
Stack of event lists saved between editing blocks.
|
private FocusManager |
focusManager
FocusManager instance. |
private FillIn |
focusToRestoreFillIn
Saving the last focused widget before choose()
|
private boolean |
forceWipeScreen
Force wiping of the screen from PUT SCREEN artifacts on next frame
hiding.
|
private FileSystemDaemon |
fsd
File system daemon.
|
private int |
functionKey
Contains the action code of the last key input event.
|
private boolean |
hadPause
Flags if the current operation had an implicit or explicit pause.
|
private boolean |
hadReset
Track resetTerminal usage in editing blocks.
|
private boolean |
helpActive
Track HELP function activity
|
private boolean |
honorPBH
Flag that determines if pause before hide mode is active.
|
private java.util.Stack<MouseHoverAction> |
hovers
Active hovers stack
|
private boolean |
ignoreNextStopEditing
Control editing mode processing.
|
private ConditionException |
immediateException
An exception which causes all trigger processing recursions to be
terminated.
|
private boolean |
implicitApplyNoTrigger
Track APPLY with implicit target usage and there is no focus.
|
private boolean |
inEditingBlock
Track editing block usage.
|
private boolean |
inEnable
If
true then enable(..) function is being run. |
private int |
inputActive
Track input mode.
|
private java.lang.String |
inputDefaultText
Default status message displayed when input operation is active.
|
private boolean |
inRowDisplayTrigger
Flag indicating if a ROW-DISPLAY event is being executed.
|
private int |
interactions
Tracks the number of I/O interactions within the current block
|
private boolean |
is3D
THREE-D value for this session.
|
private java.lang.Boolean |
isDataEntryReturn
The state of SESSION:DATA-ENTRY-RETURN attribute
|
private int |
isGoPending
Number of times when we've found that the GO event is pending.
|
private boolean |
isImmediateDisplay
The state of SESSION:IMMEDIATE-DISPLAY attribute
|
private boolean |
isWaitState
wait-state flag
|
private boolean |
keep3DFillinBorder
The effective value of the keep3DFillinBorder environment variable.
|
private int |
lastActionCode
Contains the action code of the last key input event.
|
private int |
lastAppliedCode
The action code currently being applied by the apply() method.
|
private Editor |
lastEditorDisplayed
Track the last displayed and enabled editor widget.
|
private java.lang.Integer |
lastEvent
The ID of the last non-key event raised on client-side.
|
private java.lang.Integer |
lastEventX
The value of the LAST-EVENT:X attribute.
|
private java.lang.Integer |
lastEventY
The value of the LAST-EVENT:Y attribute.
|
private Frame |
lastExposedFrame
Last frame, which was made visible
|
private int |
lastKey
Last key received from the keyboard.
|
private Frame |
lastViewed
Last frame which was displayed.
|
private boolean |
leaveSent
Tracks the LEAVE event sent status
|
private LibraryDaemon |
libd
Library manager daemon.
|
private static ContextLocal<ThinClient> |
local
Context local instance of this class.
|
private java.util.Optional<MousePtrWrapper> |
lockedMousePointer
Locked mouse pointer
|
private static java.util.logging.Logger |
LOG
Logger.
|
protected boolean |
messageClearQuirk
Flag which controls behavior of message clear quirk simulation.
|
private MemoryDaemon |
mmd
Memory manager daemon.
|
private static java.lang.Object |
modToken
Token used to authenticate with the dispatcher when registering APIs.
|
private java.util.Map<java.lang.String,MousePtrWrapper> |
mousePointers
Custom mouse pointers by name
|
private boolean |
needPause
Pause before hide state flag.
|
private int |
nesting
External procedure call nesting.
|
(package private) boolean |
nextViewDisplay
false has no effect. |
(package private) boolean |
nextViewRefresh
false has no effect. |
private java.util.Stack<java.lang.Boolean> |
oldcursor
Stores the state of the cursor at the time input mode was activated.
|
private OsPropertiesDaemon |
ospd
OS properties daemon.
|
private java.util.Map<java.lang.Integer,PageElement> |
pageElements
Tracks all page elements which are active.
|
private static java.lang.String |
PBE_DEFAULT_TEXT
Default pause before end message text.
|
private static java.lang.String |
PBH_DEFAULT_TEXT
Default pause before hide message text.
|
private ProcessDaemon |
pd
Process daemon.
|
private Widget |
pendingFocus
Save pending focus (to which will be adjusted to on the next wait-for
loop.
|
private Widget |
pendingFocusApply
Save pending focus, when focus is disabled or hidden.
|
private KeyInput |
postponedValueChanged
Postponed VALUE-CHANGED event from BROWSE.
|
private MouseHoverAction |
recentlyHovered
Most recent hovers action
|
private CoordinatesConversion |
redirectedConversion
The coordinates conversion implementation used when the output is redirected.
|
private java.util.Map<java.lang.Integer,RedirectedTerminal> |
redirections
Tracks pseudo-terminals used for redirecting output to a stream.
|
private boolean |
refreshQuirk
Control behavior of some wipe-out quirks.
|
private java.util.ArrayList<java.lang.Integer> |
removedFrames
List of frames which should be deleted at server.
|
private java.util.Map<java.lang.Integer,java.lang.Integer> |
rowDisplayEvents
Current registered ROW-DISPLAY events.
|
private java.util.Stack<java.lang.Integer> |
savedInsStateInitials
The stack of saved insert indicator states.
|
private java.util.Stack<java.lang.Integer> |
savedInsStates
The stack of saved insert indicator states.
|
private StreamDaemon |
sd
Stream daemon (provides access to streams by id).
|
private ServerExports |
server
Server exports
|
private SigintWaiter |
sigintThread
Waiter thread for SIGINT incoming.
|
private boolean |
skipCaretDraw
Flag indicating if caret draw is skipped on next cursor positioning,
after a wait-for loop iteration.
|
private java.util.Map<PageElement,java.util.Set<Stream>> |
streamMap
Tracks the streams in which a given page element is registered.
|
private java.lang.String |
textPBH
Text displayed while processing pause before hide.
|
private int |
timePBH
Pause before hide time for automatic frame hiding.
|
private OutputManager |
tk
Reference to
Toolkit instance. |
private java.util.Stack<java.lang.Boolean> |
triggerHadWaitFor
Contains true if the last trigger (on this level) did execute a nested
wait-for loop.
|
private int |
triggerNesting
Level of nesting (recursion) that exists with trigger processing.
|
private java.util.Stack<java.lang.Integer> |
triggerNestingByWaitFor
Contains levels of trigger nesting relative to active WAIT-FOR cycles.
|
private java.util.Stack<java.lang.Boolean> |
triggerResultNoApply
Contains true if the last trigger result (on this level) returned
no-apply.
|
private TypeAhead |
typeAhead
Key reader and type ahead buffer processor.
|
private boolean |
underWindows
Flag indicating if the client is running in windows compatibility mode.
|
private java.lang.String |
validationError
Validation message from last failed validation operation.
|
boolean |
viewDisplay
This view displays frame data
|
(package private) boolean |
viewInProgress
This flag is on for the duration of view operation
|
boolean |
viewRefresh
This view refreshes the frame including decorations
|
private java.util.Deque<ThinClient.WaitForOp> |
waitForFrames
Stack of frames targeted by WAIT-FOR statements.
|
private java.util.ArrayList<java.lang.Integer> |
wrappedFrames
List of DOWN frames which were wrapped.
|
private java.util.Map<MousePointer,MousePtrWrapper> |
wrappers
Map pre-defined pointers to corresponding wrappers
|
CLEAR_AND_QUEUE, IGNORE, QUEUE
Modifier | Constructor and Description |
---|---|
private |
ThinClient(boolean single)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activateBatchMode(boolean on)
Changes the activation flag for batch mode driver if loaded.
|
void |
activateConfigUpdates()
Inform the client-side that it can start sending the config updates.
|
void |
activateTooltipForWidget(int wId)
Activates tootip feature for particular widget.
|
ComboBox<?> |
activeComboBox()
Get the combo-box with active drop-down.
|
private boolean |
adjustFocusBeforeProcessing(boolean explicit,
Widget saveFocus,
Widget focusFrame,
int focusState,
boolean frameChangeEvent)
Adjust focus before processing event.
|
private void |
adjustFocusForTriggerMode(Widget pending,
boolean isPendingValid)
Adjust focus when processing nested triggers.
|
void |
adjustFontTableSize(int numEntries)
Set the number of entries in the font-table.
|
private boolean |
advanceCursor(int steps,
boolean noPause,
Frame frame)
Advance DOWN cursor.
|
ScreenBuffer[] |
apply(int widgetId,
int eventCode,
ScreenBuffer[] inbuf,
EventList eventList,
boolean explicit)
Applies the encoded event to the widget currently in focus in the given
frame, or directly to the specified widget.
|
void |
apply(long resId,
int eventCode,
EventList eventList)
Apply this event to a non-widget resource.
|
void |
applyChanges(java.io.Serializable changes)
Called by the protocol driver upon reading a message that contains
state changes that need to be applied to this side of the connection.
|
private void |
applyWorker(Event event)
Applies the encoded event to the widget currently in focus in the given
frame, or directly to the specified widget.
|
void |
bell()
Rings a bell on the terminal.
|
int |
calcBrowseDown(int browseId,
int rowHeightPixels)
Calculate DOWN value for the browse basing on the given row height.
|
private boolean |
checkBreak(long resourceId,
int evtCode)
Check active
EventList instance for exit conditions for this event and resource pair. |
private boolean |
checkBreak(Widget widget,
int evtCode,
boolean isKey)
Check active
EventList instance for exit conditions
for this event and widget pair. |
private boolean |
checkForSystemEvent(KeyInput key)
Check if the given event can be treated by the focused widget on its own.
|
private void |
checkHelpText(Widget focus)
Check help text and restore it if necessary.
|
ChooseData |
choose(int frameId,
ChooseData c,
EventList wl)
Performs CHOOSE processing.
|
boolean |
chooseColor(int colorNum,
int windowId)
Change the specified color, in the user's environment.
|
java.lang.String |
chooseFile(int windowId,
java.lang.String path,
java.lang.String title,
boolean findDirectories,
boolean saveAs,
boolean askOverwrite,
boolean mustExist,
boolean createTestFile,
boolean returnToStartDir,
boolean useFilename,
java.lang.String defaultExtension,
java.lang.String initialDir,
java.lang.String[] filters,
int initialFilter)
Displays the
File Selection dialog box and prompt the user to select a file with
configured constraints set by the options of the SYSTEM-DIALOG PRINTER-SETUP
statement. |
boolean |
chooseFont(int fontNum,
int windowId,
boolean ansiOnly,
boolean fixedOnly)
Change the specified font, in the user's environment.
|
private ChooseData |
chooseWorker(ChooseData c,
EventList wl,
Frame frame,
Widget[] comps,
int toFocusId)
CHOOSE processor.
|
void |
cleanupPseudoTerminal(int id)
Called when a stream is closed to ensure that any terminal resources
associated with that id are cleaned up.
|
private void |
cleanupQueue()
Process events internally if there are no interactive requests from the
server.
|
ScreenBuffer[] |
clear(int frameId,
boolean noPause)
Clears the data and colors for all fill-in fields of the frame.
|
ScreenBuffer[] |
clearAll(int frameId,
boolean noPause)
Clears all occurrences for the down frame and resets the current display
position to the top of the frame.
|
private ScreenBuffer |
clearAll(int frameId,
boolean noPause,
boolean resolveBuffer)
Clears all occurrences for the down frame and resets the current display
position to the top of the frame.
|
private void |
clearFrame(int frameId,
boolean conditional,
Frame frame,
boolean down)
Clear frame.
|
void |
clearSavedInsState()
Clears saved insert mode.
|
private void |
clearTerminal()
Clears all content from the terminal.
|
(package private) ScreenBuffer |
clearWorker(Frame frame,
boolean noPause,
boolean clearAll,
boolean resolveBuffer)
Clear specified frame widgets.
|
void |
clientLog(java.lang.String message,
java.lang.String[] stack)
Write message and stack trace to the client log
|
private Widget |
computeFocus(boolean frameAsTarget)
Compute the next focus in a wait-for loop.
|
void |
conditionalLineRefresh(Rectangle rect)
Conditionally refresh specified horizontal lice described by provided
rectangle.
|
void |
conditionalRefresh(Rectangle rect)
Conditionally refresh specified rectangle not occupied by frames.
|
boolean |
continueEditing(boolean hadNext)
Checks to see whether a pending GO event is about to end the editing block.
|
private MousePtrWrapper |
createMousePointer(byte[] data,
java.lang.String ptrName)
Create mouse pointer from the binary data
|
MousePtrWrapper |
createPtrWrapper(MousePointer ptr)
Create wrapper for the pre-defined cursor
|
void |
deactivateTooltipForWidget(int wId)
Deactivates tootip feature for particular widget.
|
void |
debug(int id,
java.lang.String message)
Utility method for debugging, can be used to include information from the server-side
to the client-side log
|
java.lang.Boolean |
deleteEditorLine(int id)
Delete the line of text in which the targeted editor's cursor currently resides.
|
void |
deregisterPageElement(int frameId,
boolean header)
Deregister (remove) the frame as a header or footer from the stream
that is the current redirected terminal output destination.
|
void |
deregisterPageElement(int frameId,
boolean header,
int streamId)
Deregister (remove) the frame as a header or footer from the given
stream.
|
void |
deselectFocusedRow(int browseId)
Implements the DESELECT-FOCUSED-ROW() BROWSE widget
method.
|
void |
deselectRows(int browseId)
Implements the DESELECT-ROWS() BROWSE widget method.
|
boolean |
deselectSelectedRow(int browseId,
int rowIndex)
Implements the DESELECT-SELECTED-ROW() widget method.
|
void |
destroyFrame(int frameId)
Destroy the frame and free associated resources as needed.
|
void |
destroyMenu(int menuId)
Destroy the menu and free associated resources as needed.
|
void |
displayAndDown(int widgetId,
ScreenBuffer[] frameBuf,
int[] widgetIds,
int streamId,
boolean register,
boolean pageTop,
int windowId)
Support for the DISPLAY followed by DOWN combination.
|
void |
displayError(java.lang.String errmsg)
Displays the error message via current client side error writer.
|
void |
displayErrorMessage(java.lang.String text)
Displays an error message.
|
void |
displayErrorRedirected(java.lang.String errmsg)
Displays the error message via current client side error writer.
|
WidgetConfig[] |
down(int frameId,
int lines,
boolean cond,
int sid)
Positions the cursor on a new line in a down frame.
|
WidgetConfig[] |
down(int frameId,
int lines,
int streamId,
boolean cond,
boolean endOut)
Positions the cursor on a new line in a down frame.
|
private boolean |
downWorker(int frameId,
int steps,
boolean conditional,
boolean newStream,
boolean noPause)
Positions the cursor on a new line in a down frame.
|
boolean |
editorReadFile(int wId,
java.lang.String name)
Loads the file from the client side filesystem.
|
boolean |
editorSaveFile(int wId,
java.lang.String name)
Save the content in the widgets in the client side filesystem.
|
ScreenBuffer[] |
enable(int frameId,
int[] widgetId,
ScreenBuffer[] sb,
boolean enabled,
int windowId)
Enables/disables input for all specified field-level widgets of the
frame.
|
ScreenBuffer[] |
enable(int frameId,
int[] widgetId,
ScreenBuffer[] sb,
boolean enabled,
int windowId,
boolean resolveBuffer)
Enables/disables input for all specified field-level widgets of the
frame.
|
ScreenBuffer[] |
enable(int frameId,
int widgetId,
ScreenBuffer[] sb,
boolean enabled,
int windowId)
Enables/disables input for the specified field-level widget.
|
private void |
enableChooseWidgets(ChooseData c,
Widget[] list)
Enable widgets involved in CHOOSE.
|
private void |
enableFillInAutoZap(Widget widget)
Activate AUTO-ZAP mode for widget if it a FillIn instance.
|
private void |
enableWorker(int[] widgetId,
ScreenBuffer[] sb,
boolean enabled,
Widget focus,
Frame frame,
boolean preview,
int windowId)
Widget enabling worker.
|
boolean |
endFileDrop()
Terminates file dropping operation and clean up resources.
|
private void |
endOutput(int sid)
Force the given stream to output any buffered PUT or EXPORT content, so
long as the stream is not the terminal.
|
(package private) void |
endWidgetOutput()
Mark end of widget output.
|
private void |
enterChoose(ChooseData c,
Frame frame,
java.lang.Integer[] focusId,
Widget[] comps)
Start CHOOSE processing.
|
boolean |
eventBracket(boolean discard,
java.lang.Runnable code)
Execute the given code inside a new bracket of event processing which
starts with a
push() and ends with a pop() or
popTrash() even if the executed code throws an exception. |
boolean |
eventBracket(java.lang.Runnable code)
|
boolean |
eventDrawingBracket(Widget<?> widget,
boolean discard,
boolean flush,
java.lang.Runnable code)
Execute the given code inside a new bracket of event processing which
starts the toolkit capturing invalidation rectangles, then starts a new
event bracket with a
push() , executes the code and then ends with
a pop() (or popTrash() ) and finally disables invalidation
mode. |
(package private) boolean |
eventDrawingBracket(Widget<?> widget,
boolean discard,
java.lang.Runnable code)
Execute the given code inside a new bracket of event processing which
starts the toolkit capturing invalidation rectangles, then starts a new
event bracket with a
push() , executes the code and then ends with
a pop() (or popTrash() ) and finally disables invalidation
mode. |
boolean |
eventDrawingBracket(Widget<?> widget,
java.lang.Runnable code)
|
void |
executePendingRefresh(int browseId,
boolean queryReopened,
boolean repositionBeforeReopen,
int repositionedRow)
Execute pending refresh when REFRESHABLE is turned on.
|
private java.util.List<Frame> |
extractFrames(java.util.Deque<ThinClient.WaitForOp> waitForOps)
Extract the frames from the stack of wait-for event loops.
|
private void |
fixFocusedFrameZOrder()
Fix possible Z-ordering issues.
|
private void |
fixWaitForFocus(int cop,
Widget<?> saveFocus,
Widget<?> savePending,
int focusState,
int pendingState)
Fix the focus after a event loop has finished, regradless if a condition was raised or not.
|
private int |
flushNow(int steps,
Stream stream)
Perform immediate stream flush.
|
private int |
flushRedirected(Stream stream,
boolean bypass)
Flushes all buffered output to the redirected output stream (does
nothing if output is not redirected).
|
void |
flushStream(Stream out)
Push any pending output from the redirected terminal to the stream and
then flush the stream.
|
int |
fontTableSize()
Get the number of entries in the font-table.
|
void |
forceDeregisterPageElement(int frameId)
Deregister (remove) the frame either as a header or footer from all
streams in which it is registered.
|
void |
forceDeregisterPageElement(int frameId,
boolean header)
Deregister (remove) the frame as a header or footer from all streams
in which it is registered.
|
private void |
forceFrameDraw(RedirectedTerminal rt,
int frameId,
int streamId)
Force the given frame to output to the given stream in redirected mode.
|
int |
forceInteractive()
Switch the terminal into interactive mode if it is redirected.
|
static int |
frameIdFromWidgetId(int widgetId)
Retrieve the ID of the frame containing the widget with a given ID.
|
int |
getActiveFrame()
Returns the ID of the currently active frame.
|
Frame |
getActiveFrameInt()
Get reference to active frame.
|
int |
getBrowsePageRowCount(int browseId)
Get number of rows in the browse viewport set either by DOWN or SIZE options.
|
java.io.Serializable |
getChanges()
Called by the protocol driver to obtain the latest state that should
be sent to the other side of the connection.
|
character |
getClipboardValue()
Exposes the client's system clipboard to the server.
|
EventList |
getCurrentEventList()
Gets the current event list.
|
Stream |
getCurrentRedirection()
Get the stream to which the terminal is redirected or
null
if no redirection is currently in effect. |
int |
getCurrentRow(int browseId)
Get current row in the query.
|
NativeRectangle |
getDisplayBounds(int windowId)
Returns display size.
|
int |
getDisplayHeight(int windowId)
Returns display height in native.
|
int |
getDisplayWidth(int windowId)
Returns display width in native units.
|
private NativeRectangle |
getDisplayWorkArea(int windowId)
Returns an application-usable display area.
|
int |
getDisplayWorkAreaHeight(int windowId)
Returns the height of the application-usable display area.
|
int |
getDisplayWorkAreaWidth(int windowId)
Returns the width of the application-usable display area.
|
int |
getDisplayWorkAreaX(int windowId)
Returns the X coordinate of the application-usable display area.
|
int |
getDisplayWorkAreaY(int windowId)
Returns the Y coordinate of the application-usable display area.
|
java.lang.String |
getDroppedFile(int index)
Gets the name of the dropped file from internal 1-based list list.
|
private ScreenBuffer[] |
getEditableClientScreenBuffers(ScreenBuffer sbDefault)
Prepares the array of the screen buffers to pass to the server when calling the server
export methods to be able the screen buffer synchronization.
|
ScreenBuffer[] |
getEditableClientScreenBuffers(Widget widget)
Prepares the array of the screen buffers to pass to the server when calling the server
export methods to be able the screen buffer synchronization.
|
WidgetConfig[] |
getEditorsConfigs(int browseId)
Get configurations of widgets used for in-browse editing (fill-ins, toggle-boxes or
combo-boxes).
|
private Widget |
getEnablePendingFocus(Widget focus,
int[] widgetId,
boolean enabled)
Get widget which may receive focus after ENABLE.
|
EnvironmentDaemon |
getEnvironmentDaemon()
Get the
EnvironmentDaemon for this client. |
int |
getFirstTabItem(int frameId,
java.util.List<java.lang.Integer> widgetIDs)
Gets the first widget in the tab order from the widgets of specified list.
|
int |
getFocus()
Get ID of the widget which has the input focus.
|
int |
getFocusedRow(int browseId)
Implements the FOCUSED-ROW attribute getter.
|
FocusManager |
getFocusManager()
Get the focus manager.
|
int |
getFontHeightPixels(int fontNum)
Get the height in pixels, of the specified font.
|
java.lang.String |
getFontKey(int fontNum)
Resolve the font key associated with the given font, in the current window's font-table.
|
Frame |
getFrame(int frameId)
Get frame widget from the given frame ID.
|
double |
getFrameCol(int frameId)
Returns the column position of the upper-left corner of the frame
within its window (in coordinates that are relative to the containing
window).
|
int |
getFrameDown(int frameId)
Returns the number of iterations in a down frame.
|
int |
getFrameLine(Frame frame,
int pendingUpDown)
Returns the current logical line number in a frame.
|
int |
getFrameLine(int frameId,
int pendingUpDown)
Returns the current logical line number in a frame.
|
double |
getFrameRow(int frameId)
Returns the row position of the upper-left corner of the frame
within its window (in coordinates that are relative to the containing
window).
|
double |
getHeight(int frameId)
Returns the height of the specified frame (the
FRAME:HEIGHT-CHARS
attribute). |
java.lang.String |
getImageFileName(java.lang.String imageName)
Find the name of the image file in PROPATH appending possible exensions, if needed.
|
int |
getInputActive()
Get input active counter.
|
java.lang.String |
getInputDefaultText()
Resolve the input default text (if not already resolved) and return it.
|
static ThinClient |
getInstance()
Get the context-local instance of this class.
|
int |
getLastActionCode()
Returns the action code of the last key input event.
|
int |
getLastKey()
Get the last key, received form keyboard.
|
Frame |
getLastViewed()
Get the last viewed frame.
|
static java.lang.String |
getLocalFileName(java.lang.String name)
Locates a file name to load from local file system.
|
LowLevelBuffer |
getMemoryDaemon()
Get the
LowLevelBuffer implementation. |
int |
getMessageLines()
Returns the number of screen lines available for message display.
|
int |
getNextTabItem(int frameId,
int widgetId)
Gets the widget that is the next from specified in the tab order.
|
int |
getNumDroppedFiles()
Gets the number of the dropped files.
|
int |
getNumSelectedRows(int browseId)
Getter for the NUM-SELECTED-ROWS attribute.
|
OutputManager |
getOutputManager()
Get input active counter.
|
Widget |
getPendingFocus()
Get
pendingFocus widget. |
int |
getPixelsPerColumn()
Get the PIXELS-PER-COLUMN value for this client session.
|
int |
getPixelsPerRow()
Get the PIXELS-PER-ROW value for this client session.
|
int |
getRowCount(int browseId)
Get the number of rows iterated by the query (for preselect queries - matches result size,
for adaptive queries - matches the size of the part of the result set the query has already
iterated over).
|
int |
getRowCount(int browseId,
int startRow)
Get number of available rows starting from the given one.
|
int |
getRowDisplayTriggerId(int browseId)
Get ID of the ROW-DISPLAY trigger for the target browse.
|
BrowseRow[] |
getRows(int browseId,
char searchChar,
int searchColumn,
int viewportTopRow,
int viewportBottomRow,
int rowDisplayTriggerId,
ScreenBuffer[] sb)
This function is used when search by key is performed in a browse.
|
BrowseRow[] |
getRows(int browseId,
int startRowIndex,
int count,
boolean forward,
int rowDisplayTriggerId,
ScreenBuffer[] sb,
RowDisplayStrategy displayStrategy)
Retrieves several subsequent rows from the database.
|
int |
getSavedInsState()
Returns saved insert indicator state that should be applied to the next
focused fill-in, or
-1 if there is no state to apply. |
private ScreenBuffer |
getScreenBuffer(int frameId,
int size)
Generate a copy of the
ScreenBuffer instance for the given
frame. |
private ScreenBuffer |
getScreenBuffer(int frameId,
int size,
boolean force)
Generate a copy of the
ScreenBuffer instance for the given
frame. |
private ScreenBuffer |
getScreenBuffer(Widget widget)
Generate a copy of the
ScreenBuffer instance for the given
frame or for the frame in which the given widget is contained. |
double |
getScreenLines()
Returns the number of screen lines available for frame display (does
not include the message or status lines).
|
int |
getSelectedRowIndex(int browseId,
int n)
Retrieve the 0-based row index of the nth selected row in the
given browse widget.
|
int[] |
getSelectedRowIndexes(int browseId)
Retrieve the row indexes of the selected rows in the given browse widget.
|
int[] |
getSelection(int widgetId)
Request indexes of selected items in RadioSet, ComboBox or SelectionList
widgets.
|
ServerExports |
getServer()
Get the
ServerExports instance. |
java.lang.String |
getTerminalType()
Returns the terminal type.
|
java.lang.String |
getTextPBH()
Returns text displayed while processing pbh.
|
int |
getTextWidthPixels(java.lang.String txt,
int fontNum)
Get the width of the specified text, in pixels, using the specified font.
|
java.util.Map<java.lang.Integer,ColorRgb> |
getThemeSystemPalette()
Obtain the default system palette for current theme from client.
|
int |
getTimePBH()
Returns pause before hide time for automatic frame hiding.
|
int |
getTriggerNesting()
Get trigger nesting.
|
java.lang.String |
getValidationError()
Returns the last validation error message.
|
Widget |
getWidget(int componentId)
Get
Component instance for a given ID. |
Widget |
getWidget(WidgetId componentId)
Get
Component instance for a given ID. |
double |
getWidth(int frameId)
Returns the width of the specified frame (the
FRAME:WIDTH-CHARS
attribute). |
private void |
handleFillInEntry(int eventCode,
Widget inFocus)
Process event for
FillIn widgets. |
void |
handleNextPrevFrameEvents(Frame frame,
boolean nextFrame)
Execute the NEXT-FRAME or PREV-FRAME event, depending on flag.
|
private int |
handleOutstandingNextPrompt(int toFocusId,
int[] widgetIds)
Handle outstanding NEXT-PROMPT clause.
|
private boolean |
hasEnabledFrame()
Returns if the current window has at least one enabled frame.
|
boolean |
hide(int widgetId,
boolean noPause,
boolean hidden)
Makes the specified frame or widget invisible.
|
void |
hideAll(boolean noPause,
int windowId)
Hides all widgets and messages displayed in the message area.
|
private boolean |
hideFramesInt(Frame frame)
Internal method which hides frames if necessary and maintains global
flag.
|
void |
hideMessage(boolean noPause,
int windowId)
Hides all messages displayed in the message area.
|
void |
highlight(Widget widget,
boolean state)
Changes the highlighted state of the widget and repaints it.
|
private void |
honorConditionalUpDown()
Honor the deferred processing for a conditional up or down.
|
private boolean |
honorConditionalUpDown(boolean noPause)
Honor the deferred processing for a conditional up or down.
|
int |
idFromStream(Stream s)
Returns the stream ID associated with a given stream.
|
boolean |
independentEventDrawingBracket(Widget widget,
java.lang.Runnable code)
|
static void |
initClientLog(java.lang.String clientlog)
Initialize client log
|
static void |
initializePost(BootstrapConfig cfg,
Session session,
java.lang.Object context)
Initialize network services (must only be called after the user has been authenticated AND
after
initializePrep(com.goldencode.p2j.cfg.BootstrapConfig, com.goldencode.p2j.ui.client.driver.ScreenDriver, boolean) has been called). |
static void |
initializePrep(BootstrapConfig cfg,
ScreenDriver driver,
boolean single)
Initialize core UI services and create or re-create the singleton
instance of this class.
|
void |
inputClear()
Clears the type-ahead buffer if the input source is the keyboard.
|
java.lang.Boolean |
insertEditorFile(int id,
java.lang.String filePath)
Inserts the content of a file at the current cursor position of the targeted editor.
|
java.lang.Boolean |
insertEditorString(int id,
java.lang.String txt)
Inserts string at the current cursor position of the targeted editor.
|
boolean |
insertRow(int browseId,
boolean after)
Inserts a blank row in an updateable browse before or after the last selected row.
|
void |
invokeLater(java.lang.Runnable runnable)
Asynchronously executes the supplied runnable reference on the event thread.
|
void |
invokeLaterOS(java.lang.Runnable runnable)
Asynchronously executes the supplied runnable reference on the event thread.
|
java.lang.Object |
invokeOnServer(java.util.function.Supplier<ServerReturnValue> code)
Invoke the specified server-side code, while maintaining any changes in the trigger
registry.
|
ThinClient.TriggerResult |
invokeRowDisplayTrigger(int widgetId)
Check the
rowDisplayEvents map for a ROW-DISPLAY trigger
associated with this widget. |
ThinClient.TriggerResult |
invokeTriggers(Widget widget,
int evtCode,
boolean isKey)
Check active
EventList instance for triggers defined
for this event and widget pair and activate the first one found. |
ThinClient.TriggerResult |
invokeTriggers(Widget widget,
int evtCode,
boolean isKey,
java.lang.Integer eventX,
java.lang.Integer eventY)
Check active
EventList instance for triggers defined
for this event and widget pair and activate the first one found. |
private ThinClient.TriggerResult |
invokeTriggers(Widget widget,
long resourceId,
int evtCode,
boolean isKey)
Check active
EventList instance for triggers defined
for this event and widget pair and activate the first one found. |
ThinClient.TriggerResult |
invokeTriggers(Widget widget,
Widget other,
int evtCode,
boolean isKey)
Check active
EventList instance for triggers defined
for this event and widget pair and activate the first one found. |
private ThinClient.TriggerResult |
invokeTriggers(Widget widget,
Widget other,
long resourceId,
int evtCode,
boolean isKey)
Check active
EventList instance for triggers defined
for this event and widget pair and activate the first one found. |
private ThinClient.TriggerResult |
invokeTriggers(Widget widget,
Widget other,
long resourceId,
int evtCode,
boolean isKey,
java.lang.Integer eventX,
java.lang.Integer eventY)
Check active
EventList instance for triggers defined
for this event and widget pair and activate the first one found. |
boolean |
is3D()
Get the THREE-D value for this client session.
|
boolean |
isAfterChoose()
Is to force automatic clearing.
|
boolean |
isBatchInBackground()
Checks if the client is running in batch background mode.
|
boolean |
isChui()
Checks whether the CHUI is up and running on the client.
|
boolean |
isCurrentRowModified(int browseId)
Returns
true if the current browse row is modified. |
static boolean |
isDataEntryReturn()
Get the state of SESSION:DATA-ENTRY-RETURN attribute.
|
boolean |
isEmbedded()
Check the client type: embedded or not.
|
private boolean |
isEmpty(int[] widgetId)
Check if array of widget IDs is empty.
|
boolean |
isGoPending()
Checks whether a GO event is pending for this editing operation
(either an
editing block or a wait-for ). |
boolean |
isHonorPBH()
Returns true if pause before hide mode is active.
|
boolean |
isInBatchMode()
Checks if the client is running in batch mode.
|
boolean |
isInEditingBlock()
Returns if processing is in editing block.
|
boolean |
isInEnable()
Returns
true if enable(..) function is being
run. |
boolean |
isKeep3DFillinBorder()
Get the Keep3DFillinBorder environment value for this client session.
|
static boolean |
isMousePointerLocked()
Check if mouse pointer is locked
|
(package private) boolean |
isNeedPause()
Get current value of the
needPause flag. |
boolean |
isNewRow(int browseId)
Returns
true if the current row is a new row and is not present in the
database. |
boolean |
isRedirected()
Reports if the terminal is currently redirected to a stream.
|
boolean |
isRedirected(Stream s)
Reports if the terminal is currently redirected to the specified stream.
|
private boolean |
isReducedDown(boolean newStream,
Frame frame,
boolean down,
Stream stream)
Determine if DOWN is a reduced one.
|
static boolean |
isRefreshQuirkActive()
Get status of refresh quirk (odd refreshing behavior in some terminal
types).
|
boolean |
isRowAvailable(int browseId,
int rowIndex)
Determines if the specified browse row is "available", i.e.
|
boolean |
isRowSelected(int browseId,
int rowIndex)
Implements the IS-ROW-SELECTED() BROWSE widget method.
|
java.lang.Boolean |
isTriggerResultNoApply()
Check if outermost trigger processing result was 'NO-APPLY'.
|
boolean |
isTriggerWasAppliedWithoutWaitFor()
Check if trigger processing was finished with NO-APPLY and there was no
WAIT-FOR during trigger processing.
|
boolean |
isUnderWindows()
Check if the client is running in windows compatibility mode.
|
static boolean |
isWaitState()
Check if wait state is active
|
private void |
iterateEditingBlock()
This method is called on each start of an EDITING block iteration.
|
static void |
loadEnvironment(BootstrapConfig cfg)
The method is called when the environment (
EnvironmentDaemon ) has
been fully initialized. |
boolean |
loadImage(int wId,
int type,
java.lang.String name)
Loads the new image for given button or image widgets from the client side filesystem.
|
boolean |
loadMousePointer(int id,
java.lang.String fileName)
Load custom mouse pointer from a file
|
private MousePtrWrapper |
loadMousePointer(java.lang.String fileName)
Load custom mouse pointer from a file
|
boolean |
loadWindowIcon(int windowId,
boolean small,
java.lang.String name)
Loads the new application icon for given window from the client side filesystem.
|
private Widget |
locateInFocus(int widgetId)
Locate widget in focus.
|
static java.util.Optional<MousePtrWrapper> |
lockedMousePointer()
Get locked mouse pointer if it is locked
|
void |
lockMousePointer(int widgetId,
MousePtrWrapper ptr)
Lock mouse pointer
|
void |
logStackTrace(java.lang.String message)
Write message and stack trace to the client log
|
private java.lang.String |
makePauseText(int seconds)
Prepare message text for specified time to wait.
|
void |
markFrames(MarkEntry me)
Perform operation on array of frames or widgets.
|
void |
message(java.lang.String message)
Renders the specified message into the message line.
|
MessageReturnValue |
message(java.lang.String text,
boolean set,
BaseDataType var,
boolean auto,
java.lang.String format,
Color cs,
int windowId)
Displays a message and sets or updates a character variable using a
specified format for the temporary FillIn widget.
|
logical |
messageBox(java.lang.Object[] list,
logical var,
int alertType,
int buttons,
java.lang.String title,
Color color,
int windowId,
java.lang.String[] stack)
Displays a list of text items and empty lines in an alert box and
sets/updates a
logical variable as a result of the action
taken. |
private void |
messageBoxEventWorker(AlertBox alrtBox)
Event worker for message box.
|
logical |
moveAfterTabItem(int frameId,
int widget,
int after)
Move specified widget after the widget "after".
|
logical |
moveBeforeTabItem(int frameId,
int widget,
int before)
Move specified widget before the widget "before" in the tab order.
|
void |
moveColumnClient(int browseId,
int srcIndex,
int destIndex)
Implements the client side of the MOVE-COLUMN() widget method.
|
void |
moveColumnServer(int browseId,
int src,
int dest)
Implements the server-side MOVE-COLUMN() widget method.
|
java.lang.Boolean |
moveToBottom(int id)
Move the widget to the bottom in z-order
|
java.lang.Boolean |
moveToTop(int id)
Move the widget to the top in z-order
|
static boolean |
needPause()
Get current state of the needPause flag.
|
static boolean |
nextFocus(Widget widget)
Performs conditional focus change procedure to the next widget.
|
private Frame |
nextFrame(Frame frame)
Get next frame.
|
void |
nextPrompt(int frameId,
int widgetId)
Specifies the field to be put in focus during the next input operation
which involves this field of the frame.
|
int |
nextTabItem(int frameId,
int widgetId)
Obtains the next widget in the frame's tab order from the client.
|
static boolean |
nextTabStop(Widget widget)
Performs conditional focus change procedure to the next tab stop widget.
|
void |
notifyAdvance(Stream out)
Notify the registered object that the given stream is advancing page.
|
void |
notifyClose(Stream out)
Notify the registered object that the given stream is being closed.
|
void |
notifyColumnsUpdated(int browseId)
Notify the client that columns have been added to the browse.
|
void |
notifyFlush(Stream out)
Notify the registered object that the given stream is flushing.
|
void |
notifyUnbind(Stream out)
Notify registered object that given stream reached end of life cycle and
all references to it can be safely discarded.
|
void |
openURL(java.lang.String path)
Open the target page or resource in the browser's window.
|
int |
pause(int seconds,
java.lang.String text,
boolean noMessage,
int windowId)
Suspends processing for the specified number of seconds or until the
user presses any key, whichever comes first.
|
int |
pause(int seconds,
java.lang.String text,
boolean noMessage,
TopLevelWindow wnd)
Suspends processing for the specified number of seconds or until the user presses any key,
whichever comes first.
|
void |
pauseAfterPage()
Process pause after page for terminal stream.
|
void |
pauseBeforeEnd()
Perform pause before end of application.
|
void |
pauseBeforeHide()
Process pause before hide as requested.
|
void |
pauseBeforeHide(int seconds,
java.lang.String text,
int windowId)
Specifies the pause action the user must take whenever frames are hidden
automatically.
|
private void |
pauseCleanup()
Run pause cleanup block if any.
|
private void |
placeFrameInt(Frame frame,
boolean force)
Hide frames if necessary to prepare space for specified frame and then
place and realize current frame.
|
private boolean |
pop()
Process events and restore previous event queue.
|
MouseHoverAction |
popHover()
Pop action of the recently hovered widget off the stack
|
private void |
popTrash()
Trash all events and restore previous event queue.
|
private void |
positionCursor()
Positions the real cursor before pausing according to the focused widget
"directions".
|
void |
postMouseEvent(java.awt.event.MouseEvent event,
int windowId)
Post the specified mouse event to the
EventManager , which will save it in a
dedicated queue. |
void |
postMouseEvent(java.awt.event.MouseEvent event,
int windowId,
int sourceId)
Post the specified mouse event to the
EventManager , which will save it in a
dedicated queue. |
void |
postOSEvent(Event event)
Post an OS event (which needs to be processed by the 4GL drawing layer, but not
necessarily as a legacy 4GL event) to the event queue.
|
void |
postServerEvent(ServerEvent event)
Post the server event to the client side.
|
private Widget[] |
prepareChooseWidgetList(ChooseData c,
Frame frame,
java.lang.Integer[] focusId)
Prepare list of widgets involved in CHOOSE.
|
private void |
preprocessFrameDef(Frame frame,
WidgetConfig cc)
Process frame definition.
|
private void |
preprocessView(ScreenBuffer[] frameBuf,
Widget widget,
int[] widgetIds)
If this is a nested frame, when performing a VIEW FRAME, in some cases all the ancestors
need to be displayed, if not already visible.
|
private Frame |
prevFrame(Frame frame)
Get previous frame.
|
static boolean |
previousFocus(Widget widget)
Performs conditional focus change procedure to the previous widget.
|
static boolean |
previousTabStop(Widget widget)
Performs conditional focus change procedure to the previous tab stop widget.
|
private boolean |
processBrowseEvent(KeyInput evt)
Give a browse widget, if it is in this event's component hierarchy, a
chance to process and consume the END-ERROR event.
|
private void |
processCondition(int action,
int opcode,
boolean inPause)
Handles processing of ENDKEY, END-ERROR and STOP conditions in a
uniform manner.
|
private Widget[] |
processEnable(Frame frame,
boolean enabled,
int[] widgetId,
ScreenBuffer[] sb,
Widget focus)
Process enable.
|
ScreenBuffer[] |
processEvents(ScreenBuffer[] inbuf)
Processes all outstanding events without blocking for user input.
|
private boolean |
processEventsWorker()
Processes all outstanding events without blocking for user input.
|
boolean |
processMnemonic(KeyInput evt,
int key,
Widget<?> src)
Worker to process the given key as a mnemonic (ALT or simple key), for normal widgets
(not menus).
|
private void |
processPostponedValueChanged()
Handle postponed VALUE-CHANGED if any.
|
void |
processProgressEvent(Event event)
Handle event as Progress event.
|
private void |
processSideLabel(ScreenBuffer buffer,
Widget<?> comp)
Process the side-label associated with the given widget.
|
ScreenBuffer[] |
promptFor(int frameId,
int[] widgetIds,
ScreenBuffer[] sb,
int seconds,
EventList el,
boolean doIO,
int windowId)
Provides a composite helper to implement a single call to the client
which does an enable, wait-for, disable and hide message (in that
order).
|
static void |
propagate(int windowId,
int wid,
MousePtrWrapper ptr)
Push information about the loaded mouse pointer for widget
|
void |
publish(long subId,
java.lang.String event,
java.lang.String[] param,
boolean delayed)
Send a PUBLISH notification to a remote application.
|
private void |
push()
Save current event queue.
|
void |
pushHover(MouseHoverAction action)
Push action of the currently hovered widget on the stack
|
void |
pushIntermediateRows(int browseId,
BrowseRow[] rows)
Push "intermediate" rows (i.e.
|
void |
pushMenuDescription(MenuDescription[] md)
Send array of menu element descriptions to the client.
|
private void |
pushOneDef(ScreenDefinition definition)
Push one screen definition.
|
WidgetConfig[] |
pushScreenDefinition(ScreenDefinition[] sd)
Process array of frame/widget definitions provided by server.
|
void |
pushWindow(WindowConfig config)
Process window configuration provided by server.
|
void |
putCursor(boolean onOff)
Turns cursor visibility on or off.
|
void |
putCursor(double row,
double column)
Puts cursor to the specified screen position.
|
void |
putScreen(java.lang.String text,
double row,
double column,
Color color)
Puts text on the screen at the specified position and with the given
text attributes.
|
private void |
putScreenDirect(java.lang.String text,
double row,
double column,
Color color)
Outputs text as the result of PUT SCREEN operation.
|
void |
queryClosed(int browseId)
Notify browse widget at client side that query was closed.
|
void |
queryRepositioned(int browseId,
boolean repositionError,
int targetRepositionRow)
Notify the browse that the underlying query has been repositioned..
|
int |
readKey(int seconds)
Reads and returns one keystroke from the keyboard type-ahead buffer.
|
static RedirectedTerminal |
redirectedTerminalForStream(Stream out)
Looks up the redirected terminal instance for a given stream.
|
void |
redirectOutput(int oldId,
int newId)
Redirect terminal output to the stream represented by
newId
(or to the interactive terminal if newId is -1) and close/
cleanup resources for the redirected terminal associated with
oldId (unless oldId is -1 in which case
nothing needs to be closed). |
private void |
redrawEnabled(Frame frame,
Widget[] affw)
Redraw enabled widgets.
|
private void |
refocusTarget(int widgetId,
Widget inFocus)
Set focus to target.
|
void |
refresh(int browseId,
boolean deleteCurrentRowMode)
Refresh the browse cache and redisplay the browse.
|
void |
refreshAfterDeletion(int browseId,
int rowIndex)
Refresh the browse after some of its rows were deleted.
|
java.lang.String |
refreshFrameWidget(int fid,
int wid,
BaseDataType value)
Refreshes the specified frame and widget with a new screen value.
|
void |
refreshHover()
Refresh mouse cursor shape for the currently hovered widget
|
void |
refreshScreen()
Redraw everything after suspending terminal or after use of terminal
stream.
|
void |
refreshScrollRow(int browseId,
boolean leaveOnRowInView,
boolean preserveViewportRow,
boolean repositioned,
boolean repositionError,
int targetRepositionRow)
Refresh scroll row in the browse and redisplay.
|
void |
registerPageElement(int frameId,
boolean header)
Register the frame as a header or footer from the stream that is the
current redirected terminal output destination.
|
void |
registerPageElement(int frameId,
boolean header,
int streamId)
Register the frame as a header or footer with the given stream as the
redirected terminal output destination.
|
void |
registerPageElement(int frameId,
boolean header,
int streamId,
boolean endOut)
Register the frame as a header or footer with the given stream as the
redirected terminal output destination.
|
void |
registerRowDisplayEvents(int[] wids,
int[] triggerIds)
Register the specified ROW-DISPLAY events.
|
WidgetRegistry |
registry()
Resolve the widget registry being in use.
|
void |
remapKey(java.lang.String keyLabel,
java.lang.String keyFunction)
Defines a specific action for the key.
|
UnformattedPayload |
remoteCall(UnformattedPayload request)
This is a special API which is used to delegate a call from converted 4GL code
(via _P2J_REMOTE_CALL_ functions) to the remote side.
|
void |
removeEditSelection(int id)
Removes the currently selected text from an Editor, Fill-In or ComboBox.
|
static void |
removeFrame(Frame frame)
Remove frame from the registry().
|
void |
removeRowDisplayEvents(int[] triggers)
Remove the ROW-DISPLAY triggers from the specified list.
|
void |
removeServerEvents(int[] eventIds)
Remove from the server event queue all the events in the given list, identified by their id.
|
static void |
removeWidget(Widget<?> widget)
Remove the specified widget from the registry, and from its parent frame.
|
void |
removeWindow(int window)
Remove the window instance from the client.
|
private void |
repaintAffectedWidgets(Frame[] frames,
java.lang.Iterable<Widget> widgets)
Repaint widgets affected during ENABLE/DISABLE processing.
|
java.lang.Boolean |
replaceEditorSelectionText(int id,
java.lang.String txt)
Replace selection of the targeted editor with a given string.
|
java.lang.Boolean |
replaceEditorString(int id,
java.lang.String from,
java.lang.String to,
int flag)
Replace given substring of the targeted editor with a given string
|
void |
requestEndCurrentWaitForEventLoop()
Requests the current wait-for event loop to be interrupted.
|
private void |
requestHelp()
Request HELP application execution on the server.
|
void |
resetActiveComboBox()
Reset the active combo box global reference and the locked mouse pointer that has been
used by the active drop down.
|
void |
resetBufferSizeManager()
Reset buffer size manager to its initial state.
|
private void |
resetChanged(int frameId)
Resets the changed state for all widgets of the frame into unchanged.
|
boolean |
restoreCursor(NativePoint curpos,
boolean curvis)
Force the cursor to the specified location and make it visible again.
|
private ChooseData |
restoreEnabledAfterChoose(ChooseData c,
Frame frame,
Widget[] comps,
ScreenBuffer[] sbo,
boolean saveEnabled)
Restore enabled widget after CHOOSE processing.
|
void |
restoreInsState(int savedInsState,
boolean force)
Restore insert mode after a prompting function or a trigger.
|
void |
restoreRedirection(int tempTerm)
Restore the terminal to redirected mode from interactive mode, if the
terminal to switch to is not -1.
|
void |
resume()
Re-enables client UI processing (key reading, normal drawing mode).
|
int |
saveInsState()
Save insert mode before using a prompting function or a trigger.
|
void |
scroll(int frameId,
boolean fromCurrent,
boolean up)
Scrolls the lines of the down frame up or down.
|
void |
scrollToCurrentRow(int browseId)
Scrolls a browse (if necessary) to bring the currently selected row into view.
|
boolean |
scrollToItem(int slId,
int index)
Invokes the SCROLL-TO-ITEM() method on the specified selection-list widget.
|
void |
scrollToSelectedRow(int browseId,
int selectedRowIndex)
Scrolls a browse (if necessary) to bring the specified selected row into view.
|
java.lang.Boolean |
searchInEditor(int id,
java.lang.String pattern,
int mode)
Searches for a specified string starting from the current text caret position.
|
void |
selectAll(int browseId)
Implements the SELECT-ALL() BROWSE widget method.
|
void |
selectFocusedRow(int browseId)
Implements the SELECT-FOCUSED-ROW() BROWSE widget
method.
|
private void |
selectiveDisable(Frame frame)
Selectively disable and redraw widgets.
|
logical |
selectNextRow(int browseId)
Implements the SELECT-NEXT-ROW() widget method.
|
private java.lang.String |
selectPredefinedTitle(int alertType)
Select one of the standard titles.
|
logical |
selectPreviousRow(int browseId)
Implements the SELECT-PREV-ROW() widget method.
|
boolean |
selectRow(int browseId,
int rowIndex)
Implements the SELECT-ROW() widget method.
|
boolean |
sendEntry(Widget widget)
Sends ENTRY event to the specified widget and returns a boolean result
of the possible trigger invocation.
|
boolean |
sendEntry(Widget widget,
boolean mouse)
Sends ENTRY event to the specified widget and returns a boolean result
of the possible trigger invocation.
|
boolean |
sendLeave(Widget widget)
Sends LEAVE event to the specified widget.
|
boolean |
sendLeave(Widget widget,
boolean mouse)
Sends LEAVE event to the specified widget.
|
int |
sendToStream(java.lang.String message)
Send message to stream.
|
void |
set3D(boolean value)
Set the THREE-D value for this client session.
|
void |
setActiveComboBox(ComboBox activeComboBox,
int widgetId,
MousePtrWrapper ptr)
(De)register combo-box with active drop down.
|
void |
setAfterChoose(boolean afterChoose)
Force or reset forcing of automatic clearing.
|
void |
setAuthMode(boolean auth)
Set authentication mode flag.
|
private void |
setChangedValue(Frame frame,
Widget comp,
WidgetConfig config,
BaseDataType value,
java.lang.String fmt)
Changes the value of a widget in a frame.
|
void |
setClipboardValue(java.lang.String value)
Copies a string value to the client's system clipboard.
|
int |
setCurrentRow(int browseId,
int rowIndex)
Inform server about current row in the browse.
|
void |
setDataEntryReturn(boolean on)
Set the state of SESSION:DATA-ENTRY-RETURN attribute.
|
java.lang.Boolean |
setEditorCursorChar(int id,
int pos)
Sets the cursor position in the current line of the targeted editor
|
java.lang.Boolean |
setEditorCursorLine(int id,
int line)
Sets the cursor line of the targeted editor
|
java.lang.Boolean |
setEditorCursorOffset(int id,
int offset)
Sets the cursor offset of the targeted editor.
|
java.lang.Boolean |
setEditorSelection(int id,
int start,
int end)
Selects text in the targeted editor between start and end points.
|
void |
setFirstTabItem(int frameId,
java.util.List<java.lang.Integer> fgWidgetIds,
int widgetId)
Move specified widget to the first position in the tab order.
|
private void |
setFocusSilent(Widget inFocus)
Silently restore and redraw the focus.
|
void |
setFormat(int widget,
java.lang.String format)
Sets the format specification for the specified widget and redraws the
widget.
|
static void |
setHelp(java.lang.String text,
AbstractWidget widget)
Set help text.
|
boolean |
setImage(int wId,
int type,
byte[] image)
Sets the new image for given button or image widgets on the client side.
|
void |
setImmediateDisplay(boolean on)
Set the state of SESSION:IMMEDIATE-DISPLAY attribute.
|
void |
setInputActive(int inputActive)
Set input active counter.
|
void |
setKeep3DFillinBorder(boolean value)
Set the Keep3DFillinBorder environment value for this client session.
|
void |
setLastKey(int lastKey)
Set the last key, received form keyboard.
|
void |
setLastViewed(Frame frame)
Set last viewed frame reference.
|
boolean |
setMousePointer(int id,
byte[] data,
java.lang.String ptrName)
Set the custom mouse pointer for a widget or reset to the default one
|
java.lang.Boolean |
setMousePointer(int id,
MousePointer ptr)
Set the the pre-defined custom mouse pointer for a widget or reset to the default one
|
protected boolean |
setMousePtr(int id,
MousePtrWrapper ptrWrapper)
Set the custom mouse pointer for a widget
|
void |
setNeedPause(boolean needPause,
TopLevelWindow wnd)
Set new value for the
needPause flag. |
void |
setNumericFormat(char decSep,
char groupSep)
Set the new decimal and group separators.
|
void |
setPendingFocus(Widget pendingFocus)
Set
pendingFocus widget. |
void |
setPendingFocusApply(Widget widget)
Set
pendingFocusApply reference. |
private void |
setScreenBuffer(ScreenBuffer frameBuf)
Parses
ScreenBuffer instance for current set of frames
and assigns new widget values. |
private void |
setScreenBuffer(ScreenBuffer frameBuf,
boolean direct)
Parses
ScreenBuffer instance for current set of frames
and assigns new widget values. |
private void |
setScreenBuffers(ScreenBuffer[] frameBuf)
Parses
ScreenBuffer array for current set of frames and assigns new widget
values. |
private void |
setScreenBuffers(ScreenBuffer[] frameBuf,
boolean checkFrameExists)
Parses
ScreenBuffer array for current set of frames and assigns new widget
values. |
static void |
setSessionTooltips()
Initialize initial tooltip settings
|
void |
setSessionTooltips(boolean tooltips)
Sets the SESSION:TOOLTIPS attribute for this session.
|
void |
setTerminalType(java.lang.String term)
Sets the terminal type.
|
void |
setTriggerNesting(int triggerNesting)
Set value of
triggerNesting counter. |
boolean |
setupPrinter(int windowId,
int copies,
int orientation)
Displays the
Print dialog box and lets the user set the default print context for
subsequent print jobs. |
static void |
setupTooltip(WidgetWithConfig<? extends WidgetConfig> widget)
Setup tooltip for widget
|
static void |
setValueChangedEvent(KeyInput input)
Assign VALUE CHANGED event.
|
boolean |
setWaitState(byte[] data)
Initiate/cancel wait state
|
boolean |
setWaitState(MousePointer ptr)
Initiate/cancel wait state
|
private boolean |
setWaitState(MousePtrWrapper ptr)
Initiate/cancel wait state
|
boolean |
setWaitState(java.lang.String ptrName)
Initiate wait state with a custom cursor from file
|
boolean |
setWindowDefaultIcon(TopLevelWindow.IconDataType type,
java.lang.Object data)
Sets the default window icon for all new windows on the client side.
|
boolean |
setWindowIcon(int windowId,
byte[] icon)
Sets the new application icon for given window on the client side.
|
private void |
startEditingMode(int focusWidgetId,
EventList eventList)
Marks the beginning of the editing block and passes a customized list of
GO-ON events that define termination condition for this I/O operation.
|
private void |
startInputStatus(boolean cursor)
Activate input mode.
|
(package private) void |
startWidgetOutput()
Mark start of widget drawing.
|
void |
statusDefault(java.lang.String text,
boolean noLengthLimit,
int windowId)
Specifies a new default status message for the running procedure when
not in INPUT mode (when editing).
|
void |
statusInput(java.lang.String text,
int windowId)
Specifies a new status message used when the user interface is blocked
on input.
|
void |
statusInputOff(int windowId)
Disables display of the input status message.
|
void |
statusInputRevert(int windowId)
Reverts the input status message to the default.
|
void |
stopBatchSession()
Stops the associated client session by generating UnstoppableExitException.
|
ScreenBuffer[] |
stopEditingMode()
Marks the end of the editing block when triggered by any abnormal exit
from the block on the server.
|
private void |
stopInputStatus()
Deactivate input mode.
|
private void |
stopInputStatus(boolean changeStatus)
Deactivate input mode.
|
private void |
stopNoAvailableWidgets()
Stop the WAIT-FOR loop, as it determined there are no available widgets,
in the following cases:
when the terminal is reset, inside an editing block
when the WAIT-FOR loop is NOT waiting for global events and there
are no enabled components registered for exit events
|
Stream |
streamFromId(int sid)
Returns the stream associated with a given stream.ID.
|
void |
suspend()
Temporarily halts the client UI processing (key reading, normal drawing
mode) After entering suspend mode, the current contents of the
terminal are cleared.
|
int |
suspendedPause()
Indefinitely pause and display the default message.
|
private boolean |
switchFrames(int streamId,
int frameId)
Checks whether the stream and its redirected terminal need to switch to
another frame and does switching if so.
|
int |
switchOutput(int newId,
boolean clean)
Redirect terminal output to the stream represented by
newId
(or to the interactive terminal if newId is -1) and return
the id of the current output destination. |
int |
switchOutput(int newId,
boolean clean,
boolean endOut)
Redirect terminal output to the stream represented by
newId
(or to the interactive terminal if newId is -1) and return
the id of the current output destination. |
private boolean |
switchStreams(Frame frame)
Checks whether the frame needs switching streams and does switching.
|
private int |
switchWorker(int newId)
Redirect terminal output to the stream represented by
newId
(or to the interactive terminal if newId is -1) and return
the id of the current output destination. |
void |
systemHelp(java.lang.String fileName,
java.lang.String windowName,
SystemHelpAction action,
java.lang.Object[] params)
Calls the Microsoft Windows Help engine to display Windows Help topics, and the HTML Help
engine to display HTML Help topics.
|
private Window<?> |
targetWindowWorker(int windowId)
Resolves client-side window with specified id.
|
static void |
terminate()
When run in-process on the server, the client has threads with security
context that must be shutdown.
|
private void |
transferFocusToFrame(Frame frame,
Frame newFrame)
Transfer focus between frames.
|
private boolean |
trigger(int triggerId,
int eventId,
int sourceId,
int otherId,
long resourceId,
ScreenBuffer sb,
EventList previousEventList)
Signals a trigger to the application.
|
private void |
unconditionalRedirectedDown(int frameId,
int steps,
Frame frame,
RedirectedTerminal rt,
Stream stream,
boolean reducedDown,
int prevLineNum,
boolean flushed)
Handle unconditional DOWN processing in redirected mode.
|
void |
underline(int frameId,
int[] widgetIds)
Underlines a set of widgets of the specified frame.
|
private java.util.ArrayList<java.lang.Integer> |
updateHeaders(ScreenBuffer frameBuf)
Update form headers from given
ScreenBuffer instance. |
void |
updateRow(int browseId,
int rowIndex,
int[] cellIndices,
BaseDataType[] cellValues,
boolean onlyNotifyRowReleased)
Updates selected cells in the given row.
|
boolean |
validate(int sourceId,
ScreenBuffer sb)
Signals a validation event to the application.
|
private int |
validateWidget(int id,
int[] ids)
Validates the widget's ID by comparing with array of allowed IDs.
|
private boolean |
validateWidget(Widget widget)
Validates the widget's current value and displays the validation error
message if any.
|
private void |
view_(int widgetId,
ScreenBuffer[] frameBuf,
int[] widgetIds,
boolean isView,
boolean markTarget,
int windowId)
Shows all fields of the specified frame on screen.
|
void |
view(int frameId)
Display frame content in redirected mode by page element.
|
ScreenBuffer[] |
view(int widgetId,
ScreenBuffer[] frameBuf,
int[] widgetIds,
boolean isView,
int windowId)
Shows all fields of the specified frame on screen.
|
WidgetConfig[] |
view(int widgetId,
ScreenBuffer[] frameBuf,
int[] widgetIds,
int streamId,
boolean register,
boolean pageTop,
boolean isView,
int windowId)
Shows all fields of the specified frame on screen.
|
static void |
view(Widget widget,
ScreenBuffer[] frameBuf,
int[] widgetIds,
boolean isView)
Externally accessible static wrapper for
viewWorker(Widget, ScreenBuffer[], int[], boolean, int) . |
private void |
viewWorker(Widget widget,
ScreenBuffer[] frameBuf,
int[] widgetIds,
boolean isView,
int windowId)
Force the visibility and drawing of all specified fields of the
given frame.
|
ScreenBuffer[] |
waitFor(EventList list,
int focusWidgetId,
int seconds,
ScreenBuffer[] inbuf)
Wait for specified list of events.
|
ScreenBuffer[] |
waitFor(EventList list,
int focusWidgetId,
int seconds,
ScreenBuffer[] inbuf,
BlockingOperation op,
boolean force)
Wait for specified list of events.
|
private Event |
waitForEvent(int seconds,
boolean frameAsTarget,
boolean honorServerEvent)
Wait for key press indefinitely or for specified number of seconds.
|
private Event |
waitForEvent(int seconds,
boolean frameAsTarget,
boolean honorServerEvent,
boolean includeOSEvent)
Wait for key press indefinitely or for specified number of seconds.
|
void |
waitForNextKey()
Conditionally blocks until a next UI event is available.
|
ScreenBuffer[] |
waitForWorker(EventList list,
int focusWidgetId,
int seconds,
ScreenBuffer[] inbuf,
boolean force,
boolean status,
boolean entryWindow,
BlockingOperation operation)
Main WAIT-FOR worker routine.
|
ScreenBuffer[] |
waitForWorker(EventList list,
int focusWidgetId,
int seconds,
ScreenBuffer[] inbuf,
boolean force,
boolean status,
boolean entryWindow,
BlockingOperation operation,
boolean restoreFocus)
Main WAIT-FOR worker routine.
|
private void |
warnNoEnabledFrames(Window wnd)
Shows a warning in the case when menubar is assigned to a window,
that has no enabled frames.
|
int |
watchCtrlC()
Callback method that notifies the application about Ctrl-C keystroke
and returns the decision the application has made about the disposition
of the Ctrl-C keystroke.
|
static void |
wrapFrame(Frame frame)
Remove frame from the registry.
|
private static final java.util.logging.Logger LOG
private static final java.lang.String PBH_DEFAULT_TEXT
private static final java.lang.String PBE_DEFAULT_TEXT
private static final java.lang.String END_ERR_MSG
private static final ContextLocal<ThinClient> local
private static java.lang.Object modToken
private KeyInput postponedValueChanged
public boolean viewRefresh
public boolean viewDisplay
boolean viewInProgress
boolean nextViewRefresh
false
has no effect.
true
forces full frame redrawing, including decorations.boolean nextViewDisplay
false
has no effect.
true
forces data only output.
Normally, only one of {nextViewRefresh, nextViewDisplay} flags should be
set to true
or else the requirements are in contradiction.
If that happens nonetheless, nextViewRefresh takes precedence.private OutputManager tk
Toolkit
instance.
TODO: there must be a "main" tk which is used to resolve the factory, so widgets can be
created while the secondary (i.e. ChUI mgr) is active.private java.lang.Thread dedicatedThread
private ServerExports server
private java.lang.String validationError
private boolean needPause
true
means pause is due.private int timePBH
private boolean honorPBH
private java.lang.String textPBH
private java.lang.String inputDefaultText
private EventList currentEventList
private java.util.Map<java.lang.Integer,java.lang.Integer> rowDisplayEvents
private boolean inRowDisplayTrigger
private int isGoPending
private ConditionException immediateException
private java.util.Stack<java.lang.Integer> triggerNestingByWaitFor
private java.util.Stack<java.lang.Boolean> triggerResultNoApply
private java.util.Stack<java.lang.Boolean> triggerHadWaitFor
private int lastAppliedCode
private int lastKey
private FileSystemDaemon fsd
private StreamDaemon sd
private ProcessDaemon pd
private MemoryDaemon mmd
private EnvironmentDaemon ed
private LibraryDaemon libd
private OsPropertiesDaemon ospd
private java.util.Map<java.lang.Integer,RedirectedTerminal> redirections
private java.util.Set<java.lang.Integer> deferredCleanup
private int currentStream
private int interactions
private java.util.Map<java.lang.Integer,PageElement> pageElements
private java.util.Map<PageElement,java.util.Set<Stream>> streamMap
private int triggerNesting
private int conditionalUpDown
private int conditionalFrameId
private boolean cursorVisible
private java.util.Stack<java.lang.Boolean> oldcursor
private boolean inEditingBlock
private boolean implicitApplyNoTrigger
private boolean hadReset
private java.util.ArrayList<java.lang.Integer> removedFrames
private java.util.ArrayList<java.lang.Integer> wrappedFrames
private boolean helpActive
private Frame lastViewed
private int alertBoxActive
private boolean afterChoose
private FillIn focusToRestoreFillIn
private boolean leaveSent
private boolean hadPause
private java.util.Deque<ThinClient.WaitForOp> waitForFrames
private java.util.Deque<Frame> editingFrames
private java.util.Stack<EventList> eventLists
private java.util.Stack<Widget> editingFocus
private int lastActionCode
private int functionKey
private java.lang.Integer lastEventX
private java.lang.Integer lastEventY
private java.lang.Integer lastEvent
private boolean condExit
true
when condition exception may be thrown.private boolean inEnable
true
then enable(..)
function is being run.private int inputActive
private final java.util.Map<java.lang.String,MousePtrWrapper> mousePointers
private final java.util.Map<MousePointer,MousePtrWrapper> wrappers
private java.util.Stack<java.lang.Integer> savedInsStates
private java.util.Stack<java.lang.Integer> savedInsStateInitials
private Widget pendingFocus
private int nesting
private Widget pendingFocusApply
private Editor lastEditorDisplayed
private boolean skipCaretDraw
private boolean authMode
private boolean ignoreNextStopEditing
private boolean forceWipeScreen
protected boolean messageClearQuirk
private java.lang.Object cleanupSynchronizer
private java.lang.Runnable cleanupBlock
private Frame lastExposedFrame
private BlockingOperation currentBlockingOp
private boolean refreshQuirk
private FocusManager focusManager
FocusManager
instance.private TypeAhead typeAhead
private SigintWaiter sigintThread
private CoordinatesConversion redirectedConversion
private boolean underWindows
private boolean is3D
private boolean keep3DFillinBorder
private final java.util.Stack<MouseHoverAction> hovers
private volatile MouseHoverAction recentlyHovered
private volatile java.util.Optional<MousePtrWrapper> lockedMousePointer
private ComboBox activeComboBox
private boolean isWaitState
private boolean isImmediateDisplay
private java.lang.Boolean isDataEntryReturn
private java.util.logging.FileHandler clientLogFile
private java.util.logging.Logger clientLog
private ThinClient(boolean single)
single
- true
to startup within the server process which
must bypass the shared infrastructure initialization. Use
false
for the normal client JVM startup.public static ThinClient getInstance()
null
if initializePrep(com.goldencode.p2j.cfg.BootstrapConfig, com.goldencode.p2j.ui.client.driver.ScreenDriver, boolean)
has not yet
been called. Otherwise, the singleton instance of this class
will be returned.public static void setHelp(java.lang.String text, AbstractWidget widget)
text
- Text for help string or null
, which indicates the default status message
has to be restored.widget
- Optional widget for window detection. If null
, the default window is
selected for displaying the help message.public static void initClientLog(java.lang.String clientlog)
clientlog
- log file namepublic static void initializePrep(BootstrapConfig cfg, ScreenDriver driver, boolean single) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
getInstance()
.cfg
- The bootstrap configuration file.driver
- If non-null, this is not the first init and the output
manager must re-use this instance as its driver.single
- true
to startup within the server process which
must bypass the shared infrastructure initialization. Use
false
for the normal client JVM startup.java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
public static void initializePost(BootstrapConfig cfg, Session session, java.lang.Object context)
initializePrep(com.goldencode.p2j.cfg.BootstrapConfig, com.goldencode.p2j.ui.client.driver.ScreenDriver, boolean)
has been called).cfg
- The configuration to use for setup of the client.session
- The connection to the server. null
if this is running on the server side
(and thus there is no network session).context
- The security context (if non-null). This is only used when run on the server. This
context must be propagated to other threads which need to access context-specific
state.public static void loadEnvironment(BootstrapConfig cfg)
EnvironmentDaemon
) has
been fully initialized.cfg
- A valid bootstrap configuration.public static void setSessionTooltips()
private void clearTerminal()
public static void terminate()
public void suspend()
resume()
to return to normal mode.public static boolean isWaitState()
true
if wait state is activepublic void setActiveComboBox(ComboBox activeComboBox, int widgetId, MousePtrWrapper ptr)
activeComboBox
- COMBO-BOX with active drop down or null
when deacticatedwidgetId
- the ID of the widget which caused lockingptr
- locked mouse pointerpublic void resetActiveComboBox()
public void lockMousePointer(int widgetId, MousePtrWrapper ptr)
widgetId
- the ID of the widget which caused lockingptr
- locked mouse pointerpublic static boolean isMousePointerLocked()
true
if mouse pointer is lockedpublic static java.util.Optional<MousePtrWrapper> lockedMousePointer()
public ComboBox<?> activeComboBox()
public void pushHover(MouseHoverAction action)
action
- action of the currently hovered widget on the stackpublic MouseHoverAction popHover()
null
if the stack is emptypublic void refreshHover()
public void resume()
suspend()
.public void refreshScreen()
public int suspendedPause()
public int sendToStream(java.lang.String message)
message
- Message to send.public void pauseBeforeHide()
public void pauseAfterPage()
public ScreenBuffer[] apply(int widgetId, int eventCode, ScreenBuffer[] inbuf, EventList eventList, boolean explicit)
apply
in interface ClientExports
widgetId
- ID of frame or a contained widget.eventCode
- Progress-compatible event code.inbuf
- The screen buffer for the related frame if the widgetId is
from a widget that is a frame or is contained within a frame.
May be null
if the widget is not associated with
any frame (e.g. the session window).eventList
- The list of the latest triggers (which may be more recent
than that used in any previous WAIT-FOR
).explicit
- true
if this APPLY call has an explicit target.null
if the frame has no data containing widgets
or if the input screen buffer is null
or is
otherwise invalid.public void apply(long resId, int eventCode, EventList eventList)
apply
in interface ClientExports
resId
- The resource ID to which this events needs to be applied.eventCode
- Progress-compatible event code.eventList
- The list of the latest triggers (which may be more recent than that used in any
previous WAIT-FOR
).private Widget locateInFocus(int widgetId)
widgetId
- Widget ID to start search from.private boolean adjustFocusBeforeProcessing(boolean explicit, Widget saveFocus, Widget focusFrame, int focusState, boolean frameChangeEvent)
explicit
- Explicit event flag.saveFocus
- Saved old focused widget.focusFrame
- Frame which holds focused widget.focusState
- Focus state.frameChangeEvent
- true
indicates frame change event.true
if pending focus is valid.private void refocusTarget(int widgetId, Widget inFocus)
widgetId
- Widget ID.inFocus
- Focus target.private void adjustFocusForTriggerMode(Widget pending, boolean isPendingValid)
pending
- Pending focus target.isPendingValid
- flag indicating valid pending focus target.private void handleFillInEntry(int eventCode, Widget inFocus)
FillIn
widgets.eventCode
- Event code.inFocus
- Widget in focus.public void bell()
This method corresponds to the Progress statement:
BELL
bell
in interface ClientExports
public ChooseData choose(int frameId, ChooseData c, EventList wl)
This method corresponds to this Progress statement:
CHOOSE
choose
in interface ClientExports
frameId
- ID of frame this request came forc
- CHOOSE statement optionswl
- Event list.private ChooseData chooseWorker(ChooseData c, EventList wl, Frame frame, Widget[] comps, int toFocusId)
c
- Input CHOOSE parameters.wl
- Event list.frame
- Target frame.comps
- Widget list.toFocusId
- Target focus ID.private ChooseData restoreEnabledAfterChoose(ChooseData c, Frame frame, Widget[] comps, ScreenBuffer[] sbo, boolean saveEnabled)
c
- Input CHOOSE data.frame
- Target frame.comps
- Array of widgets to process.sbo
- Output screen buffers array.saveEnabled
- Saved frame enabled flag.private void enterChoose(ChooseData c, Frame frame, java.lang.Integer[] focusId, Widget[] comps)
c
- CHOOSE parameters.frame
- Target frame.focusId
- List of focus IDs.comps
- Widget list.private Widget[] prepareChooseWidgetList(ChooseData c, Frame frame, java.lang.Integer[] focusId)
c
- CHOOSE parameters.frame
- Target frame.focusId
- List of focused widget IDs.private void enableChooseWidgets(ChooseData c, Widget[] list)
c
- Input CHOOSE data.list
- List of widgets to enable.private int handleOutstandingNextPrompt(int toFocusId, int[] widgetIds)
toFocusId
- ID of pending widget.widgetIds
- Widget ID list.public ScreenBuffer[] clear(int frameId, boolean noPause)
This method corresponds to this Progress statement:
CLEAR
clear
in interface ClientExports
frameId
- The ID of the frame to clear.noPause
- true
if NO-PAUSE option was used (no pause will
occur even if the client detects that the user has had no
chance to review the screen's contents).public ScreenBuffer[] clearAll(int frameId, boolean noPause)
This method corresponds to this Progress statement:
CLEAR ALL
clearAll
in interface ClientExports
frameId
- The ID of the frame to clear.noPause
- true
if NO-PAUSE option was used (no pause will
occur even if the client detects that the user has had no
chance to review the screen's contents).private ScreenBuffer clearAll(int frameId, boolean noPause, boolean resolveBuffer)
This method corresponds to this Progress statement:
CLEAR ALL
frameId
- The ID of the frame to clear.noPause
- true
if NO-PAUSE option was used (no pause will
occur even if the client detects that the user has had no
chance to review the screen's contents).resolveBuffer
- When true
, resolve the frame's screen buffer and return it.public void deselectRows(int browseId)
deselectRows
in interface ClientExports
browseId
- ID of the browse widget this request came forpublic void notifyColumnsUpdated(int browseId)
notifyColumnsUpdated
in interface ClientExports
browseId
- ID of the browse widget this request came for.public void scrollToCurrentRow(int browseId)
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.
scrollToCurrentRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.ErrorConditionException
- if a numbered error occurs.public void scrollToSelectedRow(int browseId, int selectedRowIndex)
scrollToSelectedRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.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.public java.lang.Boolean deleteEditorLine(int id)
deleteEditorLine
in interface ClientExports
id
- Widget id of the target editor.true
if the line was deleted.public java.lang.Boolean setEditorSelection(int id, int start, int end)
setEditorSelection
in interface ClientExports
id
- Widget id of the target editor.start
- Starting offset.end
- Ending offset.true
if the operation succeeded.public void removeEditSelection(int id)
removeEditSelection
in interface ClientExports
id
- Widget id of the target editor.public java.lang.Boolean setEditorCursorLine(int id, int line)
setEditorCursorLine
in interface ClientExports
id
- Widget id of the target editor.line
- the new cursor line valuetrue
if the cursor line is valid and set,
null if no widget with given id is foundpublic java.lang.Boolean setEditorCursorChar(int id, int pos)
setEditorCursorChar
in interface ClientExports
id
- Widget id of the target editor.pos
- the new cursor position valuetrue
if the cursor position is valid and set,
null if no widget with given id is foundpublic void debug(int id, java.lang.String message)
debug
in interface ClientExports
id
- widget idmessage
- String parameterpublic java.lang.Boolean setEditorCursorOffset(int id, int offset)
setEditorCursorOffset
in interface ClientExports
id
- Widget id of the target editor.offset
- the new offset value.true
if the cursor offset is valid and set, null
if no widget
with given id
is found.public java.lang.Boolean insertEditorString(int id, java.lang.String txt)
insertEditorString
in interface ClientExports
id
- Widget id of the target editor.txt
- the string to be insertedtrue
if the string is inserted,
null if no widget with given id is foundpublic java.lang.Boolean insertEditorFile(int id, java.lang.String filePath)
insertEditorFile
in interface ClientExports
id
- Widget id of the target editor.filePath
- The file to be inserted. Full or relative path may be used. In
latter case, the PROPATH
is used to find the file.true
if the file content is inserted, null
if no widget with given
id
is found.public java.lang.Boolean replaceEditorSelectionText(int id, java.lang.String txt)
replaceEditorSelectionText
in interface ClientExports
id
- Widget id of the target editor.txt
- the replacement stringtrue
if the selection is replaced,
null if no widget with given id is foundpublic java.lang.Boolean replaceEditorString(int id, java.lang.String from, java.lang.String to, int flag)
replaceEditorString
in interface ClientExports
id
- Widget id of the target editor.from
- the string to be replacedto
- the replacement stringflag
- the replacement mode flag as described in 4GL EDITOR:REPLACE documentationtrue
if the replacement was performed,
null if no widget with given id is foundpublic java.lang.Boolean searchInEditor(int id, java.lang.String pattern, int mode)
searchInEditor
in interface ClientExports
id
- Widget id of the target editor.pattern
- The string to be search. No wildcard allowed.mode
- a combinations of flags that specifies the type of search to be performed. The
following values are accepted:
Type of search | Flag value |
---|---|
EditorWidget.FIND_NEXT_OCCURRENCE | 1 |
EditorWidget.FIND_PREV_OCCURRENCE | 2 |
EditorWidget.FIND_CASE_SENSITIVE | 4 |
EditorWidget.FIND_WRAP_AROUND | 16 |
EditorWidget.FIND_SELECT | 32 |
yes
.public ScreenBuffer[] enable(int frameId, int[] widgetId, ScreenBuffer[] sb, boolean enabled, int windowId)
This method maintains the tab order of the specified frame. Every widget
listed for enabling is moved to the end of the tab order
retaining the same order as specified in the list. If a
frame with x, y and z widgets gets an enable call for y and
x (in that order), then the tab order will change from the
default x y z
to z y x
. In the case
where all widgets are enabled, no change to the tab order
occurs.
This method corresponds to these Progress statements:
DISABLE ALL
DISABLE ALL EXCEPT
ENABLE ALL
ENABLE ALL EXCEPT
enable
in interface ClientExports
frameId
- ID of frame this request came forwidgetId
- array of field level widget IDs to be enabled or
null
, which means all of them.sb
- The currently editable frames screen buffer array.enabled
- New state for widgets.windowId
- Id of target windowScreenBuffer
array with the current values.public ScreenBuffer[] enable(int frameId, int[] widgetId, ScreenBuffer[] sb, boolean enabled, int windowId, boolean resolveBuffer)
This method maintains the tab order of the specified frame. Every widget
listed for enabling is moved to the end of the tab order
retaining the same order as specified in the list. If a
frame with x, y and z widgets gets an enable call for y and
x (in that order), then the tab order will change from the
default x y z
to z y x
. In the case
where all widgets are enabled, no change to the tab order
occurs.
This method corresponds to these Progress statements:
DISABLE ALL
DISABLE ALL EXCEPT
ENABLE ALL
ENABLE ALL EXCEPT
frameId
- ID of frame this request came forwidgetId
- array of field level widget IDs to be enabled or
null
, which means all of them.sb
- The currently editable frames screen buffer array.enabled
- New state for widgets.windowId
- Id of target windowresolveBuffer
- Flag indicating if the screen buffer needs to be resolved and returned.resolveBuffer
flag is set to
true
.private Widget getEnablePendingFocus(Widget focus, int[] widgetId, boolean enabled)
focus
- Frame ID.widgetId
- Array of enabled widget IDs.enabled
- true
if call enables widgets.null
if no focus management should be performed.private boolean isEmpty(int[] widgetId)
widgetId
- Array of widget IDs.true
if array is null
or contains no
elements.private void enableWorker(int[] widgetId, ScreenBuffer[] sb, boolean enabled, Widget focus, Frame frame, boolean preview, int windowId)
widgetId
- List of widget IDs.sb
- Screen buffer array.enabled
- New enabled state.focus
- Focused widget.frame
- Focused frame.preview
- Preview flag.windowId
- target window id.private void redrawEnabled(Frame frame, Widget[] affw)
frame
- Target frame.affw
- List of widgets to redraw.private Widget[] processEnable(Frame frame, boolean enabled, int[] widgetId, ScreenBuffer[] sb, Widget focus)
frame
- Target frame.enabled
- New enabled state.widgetId
- List of widget IDs.sb
- Screen buffer array.focus
- Focused widgets.public logical moveAfterTabItem(int frameId, int widget, int after)
moveAfterTabItem
in interface ClientExports
frameId
- ID of the frame that contains widgets being moved.widget
- ID of the widget to move.after
- ID of the widget after which the widget should be moved.public logical moveBeforeTabItem(int frameId, int widget, int before)
moveBeforeTabItem
in interface ClientExports
frameId
- ID of the frame that contains widgets being moved.widget
- ID of the widget to move.before
- ID of the widget before which the widget should be moved.public void setPendingFocusApply(Widget widget)
pendingFocusApply
reference.widget
- Widget reference.public ScreenBuffer[] enable(int frameId, int widgetId, ScreenBuffer[] sb, boolean enabled, int windowId)
This method corresponds to these Progress statement:
widget:SENSITIVE=true/false
enable
in interface ClientExports
frameId
- ID of frame this request came forwidgetId
- widget ID to be enabled or disabledsb
- The currently editable frames screen buffer array.enabled
- New state of the widgetwindowId
- Id of target windowpublic void underline(int frameId, int[] widgetIds)
underline
in interface ClientExports
frameId
- The frame ID this request came for.widgetIds
- The array of field level widget IDs to be underlined.public WidgetConfig[] down(int frameId, int lines, boolean cond, int sid)
lines
is negative, this operates as a move of the cursor
up
.
This method corresponds to these Progress statements:
DOWN n
UP n
down
in interface ClientExports
frameId
- ID of frame this request came forlines
- Number and direction of iterations of the data to move. If
positive, the move is down
, if negative the
move is up
. 0 is ignored.cond
- true
means conditional down; lines is assumed
to be 1sid
- The stream for which pending PUT or EXPORT output must be
ended and written to the stream. -1 means that this is not
necessary.null
is returned.private boolean downWorker(int frameId, int steps, boolean conditional, boolean newStream, boolean noPause)
lines
is negative, this
operates as a move of the cursor up
.
This method corresponds to these Progress statements:
DOWN n
UP n
frameId
- ID of frame this request came forsteps
- Number and direction of iterations of the data to move. If positive, the move is
down
, if negative the move is up
. 0 is ignored.conditional
- true
when this call is for conditional up/down.newStream
- true
when stream switch has just occurrednoPause
- if true
then no pause will be generated on cursor wrap.true
if wrap is occurred.private int flushNow(int steps, Stream stream)
steps
- DOWN size.stream
- Output stream.private boolean advanceCursor(int steps, boolean noPause, Frame frame)
steps
- UP/DOWN size.noPause
- Disable pause processing/frame
- Target frame.true
if cursor wrap has occurredprivate void clearFrame(int frameId, boolean conditional, Frame frame, boolean down)
frameId
- Frame ID.conditional
- true
if DOWN processing is conditional/frame
- Target frame.down
- Direction flag.private boolean isReducedDown(boolean newStream, Frame frame, boolean down, Stream stream)
newStream
- Stream.frame
- Target frame.down
- DOWN direction.stream
- Old stream.true
if DOWN is a reduced one.private void unconditionalRedirectedDown(int frameId, int steps, Frame frame, RedirectedTerminal rt, Stream stream, boolean reducedDown, int prevLineNum, boolean flushed)
frameId
- ID of frame this request came for.steps
- Number and direction of iterations of the data to move. If positive, the move is
down
, if negative the move is up
. 0 is ignored.frame
- The processed frame.rt
- The RedirectedTerminal
.stream
- The redirected stream.reducedDown
- true
if this down is reduced.prevLineNum
- The next line number AFTER all buffered lines were flushed or -1 if the
RedirectedTerminal
was not flushed.flushed
- true
if the RedirectedTerminal
was flushed.public WidgetConfig[] down(int frameId, int lines, int streamId, boolean cond, boolean endOut)
lines
is negative, this operates as a move of the cursor
up
.
The terminal will be temporarily redirected to the given stream for the
duration of this method call. This allows the caller to avoid
bracketing this call with switchOutput(int, boolean)
invocations, as the
same result is achieved internal to this method's operation.
This method corresponds to these Progress statements:
DOWN n
UP n
down
in interface ClientExports
frameId
- ID of frame this request came forlines
- Number and direction of iterations of the data to move. If
positive, the move is down
, if negative the
move is up
. 0 is ignored.streamId
- The stream to be used as the temporary terminal redirection
(only for the duration of this call).cond
- true
means conditional down; lines is assumed
to be 1endOut
- true
to force any pending PUT or EXPORT output
to be ended for the given stream (so long as that stream is
not the terminal).null
is returned.public FocusManager getFocusManager()
public int getFocus()
getFocus
in interface ClientExports
public int getTimePBH()
public boolean isHonorPBH()
public java.lang.String getTextPBH()
public void postServerEvent(ServerEvent event)
postServerEvent
in interface ClientExports
event
- The server event.public UnformattedPayload remoteCall(UnformattedPayload request)
This API is expected to block waiting for a response.
remoteCall
in interface ClientExports
request
- The request data incoming from 4GL.public void publish(long subId, java.lang.String event, java.lang.String[] param, boolean delayed)
publish
in interface ClientExports
subId
- The subscriber's ID, known by the remote application.event
- The published event name.param
- The parameters for this event.delayed
- Flag indicating if the PUBLISH must be executed immediately (when true
)
or posted to the client's event queue, otherwise.public void postMouseEvent(java.awt.event.MouseEvent event, int windowId)
EventManager
, which will save it in a
dedicated queue.
This usage of an AWT event class is intentional. It is being used separately from the AWT/Swing event model. No other AWT/Swing usage is occurring in this class.
event
- The mouse event.windowId
- The window where the event was captured.public void postMouseEvent(java.awt.event.MouseEvent event, int windowId, int sourceId)
EventManager
, which will save it in a
dedicated queue.
This usage of an AWT event class is intentional. It is being used separately from the AWT/Swing event model. No other AWT/Swing usage is occurring in this class.
event
- The mouse event.windowId
- The window where the event was captured.sourceId
- The explicit source of this mouse event.public void postOSEvent(Event event)
event
- The event to be posted.public void removeServerEvents(int[] eventIds)
removeServerEvents
in interface ClientExports
eventIds
- The list of event IDs to be removed.public java.lang.Object invokeOnServer(java.util.function.Supplier<ServerReturnValue> code)
code
- The code to be executed.public void invokeLaterOS(java.lang.Runnable runnable)
Use this method for processing the OS input.
runnable
- A valid Runnable
reference.java.lang.IllegalArgumentException
- when runnable is null
.public void invokeLater(java.lang.Runnable runnable)
Use this method for the widget-related application logic.
runnable
- A valid Runnable
reference.java.lang.IllegalArgumentException
- when runnable is null
.public void registerPageElement(int frameId, boolean header)
registerPageElement
in interface ClientExports
frameId
- The id of the frame for this request.header
- true
to register as a header, false
to register as a footer.public void registerPageElement(int frameId, boolean header, int streamId)
registerPageElement
in interface ClientExports
frameId
- The id of the frame for this request.header
- true
to register as a header, false
to register as a footer.streamId
- The stream to associate with the frame as a page element.public void registerPageElement(int frameId, boolean header, int streamId, boolean endOut)
frameId
- The id of the frame for this request.header
- true
to register as a header, false
to register as a footer.streamId
- The stream to associate with the frame as a page element.endOut
- true
to force any pending PUT or EXPORT output
to be ended for the given stream (so long as that stream is
not the terminal).public void deregisterPageElement(int frameId, boolean header)
This is called (among other places) during hide processing on the server, which must be safe to be called at any time. This is true, even if we aren't redirected, if the frame is not visible and/or if there was no page element ever registered for this frame (because it was never viewed).
deregisterPageElement
in interface ClientExports
frameId
- The id of the frame for this request.header
- true
to register as a header, false
to register as a footer.public void deregisterPageElement(int frameId, boolean header, int streamId)
This is called (among other places) during hide processing on the server, which must be safe to be called at any time. This is true, even if we aren't redirected, if the frame is not visible and/or if there was no page element ever registered for this frame (because it was never viewed).
deregisterPageElement
in interface ClientExports
frameId
- The id of the frame for this request.header
- true
to register as a header, false
to register as a footer.streamId
- The stream to associate with the frame as a page element.public void forceDeregisterPageElement(int frameId, boolean header)
forceDeregisterPageElement
in interface ClientExports
frameId
- The id of the frame for this request.header
- true
to register as a header, false
to register as a footer.public void forceDeregisterPageElement(int frameId)
frameId
- The id of the frame for this request.private void forceFrameDraw(RedirectedTerminal rt, int frameId, int streamId)
rt
- The current redirected terminal for the stream.frameId
- The frame to output.streamId
- The output destination.public int getInputActive()
public void setInputActive(int inputActive)
inputActive
- value of the counter.public OutputManager getOutputManager()
public double getFrameCol(int frameId)
This method corresponds to the Progress built-in function:
FRAME-COL
getFrameCol
in interface ClientExports
frameId
- The ID of the frame for this request.public int getPixelsPerColumn()
getPixelsPerColumn
in interface ClientExports
public int getPixelsPerRow()
getPixelsPerRow
in interface ClientExports
public void adjustFontTableSize(int numEntries)
adjustFontTableSize
in interface ClientExports
numEntries
- The new size of the font-table.public int fontTableSize()
fontTableSize
in interface ClientExports
public int getTextWidthPixels(java.lang.String txt, int fontNum)
getTextWidthPixels
in interface ClientExports
txt
- The text.fontNum
- The entry in the font-table.public int getFontHeightPixels(int fontNum)
getFontHeightPixels
in interface ClientExports
fontNum
- The entry in the font-table.public java.lang.String getFontKey(int fontNum)
getFontKey
in interface ClientExports
fontNum
- The entry in the font-table.public boolean chooseFont(int fontNum, int windowId, boolean ansiOnly, boolean fixedOnly)
This implements the SYSTEM-DIALOG FONT font-num
statement.
chooseFont
in interface ClientExports
fontNum
- The font-table entry to be changed.windowId
- The id of the window that will be the parent for the dialog.ansiOnly
- Do not include graphic symbols in the set of fonts to be selected.fixedOnly
- Only allow mono-spaced fonts to be selected.true
if the dialog was accepted and false
if the user cancelled the
dialog.public boolean setupPrinter(int windowId, int copies, int orientation)
Print
dialog box and lets the user set the default print context for
subsequent print jobs.
This implements the SYSTEM-DIALOG PRINTER-SETUP
statement.
setupPrinter
in interface ClientExports
windowId
- The id of the window that will be the parent for the dialog.copies
- The initial value of Copies
field. Ignored if negative.orientation
- The initial orientation of the page.true
if the dialog was accepted and false
if the user cancelled the
dialog.public java.lang.String chooseFile(int windowId, java.lang.String path, java.lang.String title, boolean findDirectories, boolean saveAs, boolean askOverwrite, boolean mustExist, boolean createTestFile, boolean returnToStartDir, boolean useFilename, java.lang.String defaultExtension, java.lang.String initialDir, java.lang.String[] filters, int initialFilter)
File Selection
dialog box and prompt the user to select a file with
configured constraints set by the options of the SYSTEM-DIALOG PRINTER-SETUP
statement.chooseFile
in interface ClientExports
windowId
- The id of the window that will be the parent for the dialog.path
- The initial selected filename, (only if useFilename == true
).title
- The dialog's title (optional).findDirectories
- Allow only directories to be selected.saveAs
- This is a Save As...
dialog.askOverwrite
- Prompt the user for overwriting if the file exists. Used only with saveAs
option.mustExist
- Enforce that the file should already exist.createTestFile
- Test writing permissions by creating a temporary file.returnToStartDir
- Do not save the last location where the user navigated for subsequent calls.useFilename
- If true
, use the path
as the starting location.defaultExtension
- Configures the default extension for files to be selected.initialDir
- Configures the initial directory where the dialog is opened.filters
- A set of filters to be displayed to user.initialFilter
- The index of the filter to be active when the dialog opens.null
is returned (user selected
Cancel
button to close the dialog).public boolean chooseColor(int colorNum, int windowId)
SYSTEM-DIALOG COLOR color-num
statement.chooseColor
in interface ClientExports
colorNum
- The color-table entry to be changed.windowId
- The window ID to which the edited font-table belongs.true
if the dialog was accepted and false
if the user cancelled the
dialog.public void systemHelp(java.lang.String fileName, java.lang.String windowName, SystemHelpAction action, java.lang.Object[] params)
systemHelp
in interface ClientExports
fileName
- Path to the help file.windowName
- The window name (optional, amy be null).action
- Help action. See SystemHelpAction
for more information.params
- Parameters specific to current action.public void activateConfigUpdates()
activateConfigUpdates
in interface ClientExports
public EnvironmentDaemon getEnvironmentDaemon()
EnvironmentDaemon
for this client.public boolean isAfterChoose()
public void setAfterChoose(boolean afterChoose)
afterChoose
- true
force, false
otherwise.public int getLastKey()
public void setLastKey(int lastKey)
lastKey
- Code of the last key.public double getWidth(int frameId)
FRAME:WIDTH-CHARS
attribute).getWidth
in interface ClientExports
frameId
- The ID of the frame for this request.public double getHeight(int frameId)
FRAME:HEIGHT-CHARS
attribute).getHeight
in interface ClientExports
frameId
- The ID of the frame for this request.public int getFrameDown(int frameId)
This method corresponds to the Progress built-in function:
FRAME-DOWN
getFrameDown
in interface ClientExports
frameId
- The ID of the frame for this request.public int getFrameLine(int frameId, int pendingUpDown)
This method corresponds to the Progress built-in function:
FRAME-LINE
getFrameLine
in interface ClientExports
frameId
- The ID of the frame for this request.pendingUpDown
- The pending down value for this frame.public double getFrameRow(int frameId)
This method corresponds to the Progress built-in function:
FRAME-ROW
getFrameRow
in interface ClientExports
frameId
- The ID of the frame for this request.public int getFirstTabItem(int frameId, java.util.List<java.lang.Integer> widgetIDs)
getFirstTabItem
in interface ClientExports
frameId
- ID of the containing frame.widgetIDs
- IDs of widgets in the target field-group.public void setFirstTabItem(int frameId, java.util.List<java.lang.Integer> fgWidgetIds, int widgetId)
setFirstTabItem
in interface ClientExports
frameId
- ID of the frame that contains widgets being moved.fgWidgetIds
- Target field-group widgets.widgetId
- ID of the widget to move.public int getMessageLines()
This method corresponds to the Progress built-in function:
MESSAGE-LINES
getMessageLines
in interface ClientExports
public int getNumSelectedRows(int browseId)
getNumSelectedRows
in interface ClientExports
browseId
- ID of the browse widget this request came forpublic int getNextTabItem(int frameId, int widgetId)
getNextTabItem
in interface ClientExports
frameId
- ID of the containing frame.widgetId
- The widget to get the next widget in the tab order.public int getSelectedRowIndex(int browseId, int n)
getSelectedRowIndex
in interface ClientExports
browseId
- ID of the browse widget associated with the request.n
- 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[] getSelectedRowIndexes(int browseId)
getSelectedRowIndexes
in interface ClientExports
browseId
- ID of the browse widget this request came for.ErrorConditionException
- If selIndex
is invalid or if there are no "available" rows.public double getScreenLines()
This method corresponds to the Progress built-in function:
SCREEN-LINES
getScreenLines
in interface ClientExports
public java.lang.String getTerminalType()
TERM
environment variable on UNIX or Linux
unless set via setTerminalType(java.lang.String)
. On Windows it depends upon
whether the terminal is in graphical or character mode. If it is
in character mode, the result depends on the monitor type.
This method corresponds to the Progress built-in function:
TERMINAL
getTerminalType
in interface ClientExports
public boolean hide(int widgetId, boolean noPause, boolean hidden)
This method corresponds to this Progress statement:
HIDE widget
hide
in interface ClientExports
widgetId
- ID of frame or widget this request came fornoPause
- true
if NO-PAUSE option was usedhidden
- If true
, set the HIDDEN attribute.true
if the widget has been hidden,
false
otherwise.public void hideAll(boolean noPause, int windowId)
This method operates on the contents of the interactive terminal no matter what redirection stream is in effect.
This method corresponds to the Progress statement
HIDE ALL [NO_PAUSE]
hideAll
in interface ClientExports
noPause
- true
if no pause is required before hiding.windowId
- Id of target window or -1 for default windowpublic void hideMessage(boolean noPause, int windowId)
This method corresponds to the Progress statement
HIDE MESSAGE [NO_PAUSE]
hideMessage
in interface ClientExports
windowId
- Id of target window or -1 for default windownoPause
- true
if no pause is required before hiding
messagespublic void inputClear()
This method corresponds to the Progress statement
INPUT CLEAR
inputClear
in interface ClientExports
public boolean isInBatchMode()
isInBatchMode
in interface ClientExports
true
for batch mode, false
otherwise.public boolean isBatchInBackground()
isBatchInBackground
in interface ClientExports
true
for background mode, false
otherwise.public void stopBatchSession() throws UnstoppableExitException
stopBatchSession
in interface ClientExports
UnstoppableExitException
public void activateBatchMode(boolean on)
activateBatchMode
in interface ClientExports
on
- The new satus of the active flag for batch driver.public void displayError(java.lang.String errmsg)
displayError
in interface ClientExports
errmsg
- The error message to display.public void displayErrorRedirected(java.lang.String errmsg)
displayErrorRedirected
in interface ClientExports
errmsg
- The error message to display.public void message(java.lang.String message)
message
- The message body to be rendered.public MessageReturnValue message(java.lang.String text, boolean set, BaseDataType var, boolean auto, java.lang.String format, Color cs, int windowId)
This method corresponds to the Progress statement
MESSAGE SET/UPDATE variable AUTO-RETURN FORMAT
message
in interface ClientExports
text
- Text to be displayed.set
- true
for SET, false
for UPDATE,
not used if var parameter is null
.var
- The variable to set or update. null
means no
set or update will occur.auto
- true
if the AUTO-RETURN option is specified. This
is only valid if var
is not null
.format
- The format specification to use for the set or update. This
is only valid if var
is not null
.cs
- The color specification to use for the text.windowId
- Id of target windowvar
is not null
and operation
finished successfully and/or if any key was pressed during
editing/pausing. If no pause occurred and there was no input
(editing) in process, then null
will be returned.public void displayErrorMessage(java.lang.String text)
The method takes care of rendering the error message directly and does not interact with an error writer.
displayErrorMessage
in interface ClientExports
text
- Error text to be displayed.public logical messageBox(java.lang.Object[] list, logical var, int alertType, int buttons, java.lang.String title, Color color, int windowId, java.lang.String[] stack)
logical
variable as a result of the action
taken. This is a modal dialog with the specified title and button
configuration. The message body is represented by a content array. Each
line of the message including any number of empty lines (skip) are
elements of the content array. Text elements of the content array must
be Strings
. In addition, there may be any number of
skip
elements which are encoded as a Java
Integer
instance where the integral value is equivalent
to the number of lines to skip.
The value of the var
being edited determines the default
button if it is not null
. true
is the first
button, false
is the second button and for a 3-button
dialog, unknown
is the third button.
The result of the user's selection is returned and this result value can be mapped to a button following the same mapping as used for setting the default button (see above).
This method corresponds to the Progress statements:
MESSAGE list VIEW-AS ALERT-BOX MESSAGE list VIEW-AS ALERT-BOX SET/UPDATE var ... and all other variants that include options such as title, buttons and colors
messageBox
in interface ClientExports
list
- The list of message text components.var
- The variable to update if not null
.alertType
- One of the ALERT_* constants specifying message type.buttons
- One of the BTN_* constants specifying used button set.title
- The dialog title.color
- Color scheme to use.windowId
- Id of target windowstack
- Progress stack traceprivate java.lang.String selectPredefinedTitle(int alertType)
alertType
- Type of Alert.private void messageBoxEventWorker(AlertBox alrtBox)
alrtBox
- Reference to AlertBox.public void nextPrompt(int frameId, int widgetId)
If the very next operation does not involve the field, this request will be disregarded.
The next high level input operation clears this information for the involved frame only. WAIT-FOR does not clear it, however.
This method corresponds to this Progress statement:
NEXT-PROMPT
nextPrompt
in interface ClientExports
frameId
- ID of frame this request came forwidgetId
- widget to be put in focuspublic int pause(int seconds, java.lang.String text, boolean noMessage, int windowId)
This method corresponds to the Progress statement
PAUSE n MESSAGE/NO-MESSAGE
pause
in interface ClientExports
seconds
- Pause duration in seconds (0 means immediate return, -1 means
infinite wait).text
- Either null
if NO-MESSAGE is in effect, or the
message text.noMessage
- true
if NO-MESSAGE is in effect. This suppresses
the message display, even if an explicit message text was
passed.windowId
- Id of target windowpublic int pause(int seconds, java.lang.String text, boolean noMessage, TopLevelWindow wnd)
Behaviour in case of batch processing: if the timeout is limited, it is honored, if infinite
(seconds == -1
) return immediately.
This method corresponds to the Progress statement
PAUSE n MESSAGE/NO-MESSAGE
seconds
- Pause duration in seconds (0 means immediate return, -1 means infinite wait).text
- Either null
if NO-MESSAGE is in effect, or the message text.noMessage
- true
if NO-MESSAGE is in effect. This suppresses the message display, even
if an explicit message text was passed.wnd
- Not null
target window. If null
- an NPE will be thrown.public void pauseBeforeHide(int seconds, java.lang.String text, int windowId)
This method corresponds to Progress statements:
PAUSE seconds BEFORE-HIDE MESSAGE text PAUSE seconds BEFORE-HIDE NO-MESSAGE
pauseBeforeHide
in interface ClientExports
seconds
- Pause duration in seconds.text
- Either null
if NO-MESSAGE is in effect or the
message text to display.windowId
- Id of target windowpublic ScreenBuffer[] processEvents(ScreenBuffer[] inbuf)
This method corresponds to the Progress statement
PROCESS EVENTS
processEvents
in interface ClientExports
inbuf
- current screen buffer array for editable frames known to the serverScreenBuffer
array with the current valuespublic void registerRowDisplayEvents(int[] wids, int[] triggerIds)
registerRowDisplayEvents
in interface ClientExports
wids
- The id of the browse widget for which there are ROW-DISPLAY
triggers.triggerIds
- The corresponding trigger ID for each widget.public void removeRowDisplayEvents(int[] triggers)
removeRowDisplayEvents
in interface ClientExports
triggers
- The triggers to be removed, if they are associated to a
ROW-DISPLAY event.public void pushMenuDescription(MenuDescription[] md)
pushMenuDescription
in interface ClientExports
md
- Array of menu descriptions.public WidgetConfig[] pushScreenDefinition(ScreenDefinition[] sd)
pushScreenDefinition
in interface ClientExports
sd
- Array of screen definitions.null
is returned.private void pushOneDef(ScreenDefinition definition)
definition
- Definition to push.public void pushWindow(WindowConfig config)
pushWindow
in interface ClientExports
config
- instance of WindowConfig
public void removeWindow(int window)
removeWindow
in interface ClientExports
window
- The window ID.public int getActiveFrame()
getActiveFrame
in interface ClientExports
public void putCursor(boolean onOff)
This method corresponds to the Progress statements
PUT CURSOR
PUT CURSOR OFF
putCursor
in interface ClientExports
onOff
- true
if the cursor display is being turned on.public void putCursor(double row, double column)
This method corresponds to the Progress statement
PUT CURSOR ROW COLUMN
putCursor
in interface ClientExports
row
- 1-based screen row numbercolumn
- 1-based screen column numberpublic void putScreen(java.lang.String text, double row, double column, Color color)
This method corresponds to the Progress statement:
PUT SCREEN ROW y COLUMN x
putScreen
in interface ClientExports
text
- The text to display.row
- 1-based screen row number.column
- 1-based screen column number.color
- The color specification or -1 for the default color.public int readKey(int seconds)
This method corresponds to the Progress statements
READKEY PAUSE n READKEY
readKey
in interface ClientExports
seconds
- -1 means indefinite wait, 0 means no wait and positive values
mean the number of seconds to waitpublic void refresh(int browseId, boolean deleteCurrentRowMode)
refresh
in interface ClientExports
browseId
- ID of the browse widget this request came fordeleteCurrentRowMode
- true
if this function is used for update on DELETE-CURRENT-ROW.
false
if this function is used for update on REFRESH.public void refreshAfterDeletion(int browseId, int rowIndex)
refreshAfterDeletion
in interface ClientExports
browseId
- ID of the browse widget this request came for.rowIndex
- 0-based index of the deleted row. -1
if all of the selected rows were
deleted.public logical selectNextRow(int browseId)
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.
selectNextRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.true
on success.public logical selectPreviousRow(int browseId)
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.
selectPreviousRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.true
on success.public void remapKey(java.lang.String keyLabel, java.lang.String keyFunction)
This method corresponds to the Progress statement
ON key-label key-function
remapKey
in interface ClientExports
keyLabel
- the label of the keykeyFunction
- the action to take when the user presses the keypublic void scroll(int frameId, boolean fromCurrent, boolean up)
This method corresponds to this Progress statement:
SCROLL
scroll
in interface ClientExports
frameId
- ID of frame this request came forfromCurrent
- true
if FROM-CURRENT option was usedup
- true
if scrolling uppublic void selectAll(int browseId)
selectAll
in interface ClientExports
browseId
- ID of the browse widget this request came forpublic void selectFocusedRow(int browseId)
selectFocusedRow
in interface ClientExports
browseId
- ID of the browse widget this request came forpublic void deselectFocusedRow(int browseId)
deselectFocusedRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.public boolean deselectSelectedRow(int browseId, 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.
deselectSelectedRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.rowIndex
- 1-based index of the row (in the list of selected rows) to deselect.true
if the row is successfully deselected.public boolean selectRow(int browseId, 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.
selectRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.rowIndex
- 1-based row index in the browse viewport.true
if the row with the given index exist in the browse viewport.public boolean isRowSelected(int browseId, int rowIndex)
isRowSelected
in interface ClientExports
browseId
- ID of the browse widget this request came for.rowIndex
- 1-based row index in the browse viewport.true
if a specified row in the browse viewport is currently selected.public void moveColumnClient(int browseId, int srcIndex, int destIndex)
Repositions a column in a browse widget.
moveColumnClient
in interface ClientExports
srcIndex
- 0-based position of the column to be moved.destIndex
- 0-based position to which the column is moved.public void moveColumnServer(int browseId, int src, int dest)
Repositions a column in the browse widget.
browseId
- ID of the browse which should handle the request.src
- 0-based position of the column to be moved.dest
- 0-based position to which the column is moved.public int getFocusedRow(int browseId)
getFocusedRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.-1
if browse
doesn't exist.public int getBrowsePageRowCount(int browseId)
getBrowsePageRowCount
in interface ClientExports
browseId
- ID of the browse widget this request came for.public void refreshScrollRow(int browseId, boolean leaveOnRowInView, boolean preserveViewportRow, boolean repositioned, boolean repositionError, int targetRepositionRow)
refreshScrollRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.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 executePendingRefresh(int browseId, boolean queryReopened, boolean repositionBeforeReopen, int repositionedRow)
executePendingRefresh
in interface ClientExports
browseId
- ID of the browse widget this request came for.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 queryRepositioned(int browseId, boolean repositionError, int targetRepositionRow)
queryRepositioned
in interface ClientExports
browseId
- ID of the browse widget this request came for.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 queryClosed(int browseId)
queryClosed
in interface ClientExports
browseId
- ID of the browse widget this request came forpublic boolean isNewRow(int browseId)
true
if the current row is a new row and is not present in the
database.isNewRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.true
if the current row is a new row and false
otherwise.public boolean isCurrentRowModified(int browseId)
true
if the current browse row is modified.isCurrentRowModified
in interface ClientExports
browseId
- ID of the browse widget this request came for.true
if the current browse row is modified.public boolean insertRow(int browseId, boolean after)
insertRow
in interface ClientExports
browseId
- ID of the browse widget this request came for.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.public int calcBrowseDown(int browseId, int rowHeightPixels)
calcBrowseDown
in interface ClientExports
browseId
- ID of the browse widget this request came for.rowHeightPixels
- Row height in pixels.public void pushIntermediateRows(int browseId, BrowseRow[] rows)
BrowseWidget.getRows(int, int, boolean, int, ScreenBuffer[], RowDisplayStrategy)
)
to the client, so these rows can be drawn if a pause occurs in ROW-DISPLAY trigger.pushIntermediateRows
in interface ClientExports
browseId
- ID of the browse widget this request came for.rows
- Set of rows to push.public boolean scrollToItem(int slId, int index)
scrollToItem
in interface ClientExports
slId
- Widget ID of the selection list to scroll.index
- The 0-based index of the item to which to scroll.TRUE
in success, FALSE
otherwise.public void setTerminalType(java.lang.String term)
This processing also clears the input buffer and resets any key mappings to their default values.
This method corresponds to the Progress statement:
TERMINAL
setTerminalType
in interface ClientExports
term
- Terminal type name. If null
, this resets the
terminal without changing the type.public void statusDefault(java.lang.String text, boolean noLengthLimit, int windowId)
This method is used to display a status message, which is trimmed to
63 chars only if the noLengthLimit
flag is not set.
statusDefault
in interface ClientExports
text
- The new status message. null
is the equivalent
of the empty string.noLengthLimit
- flag indicating the status message should not be trimmedwindowId
- Id of target windowpublic void statusInput(java.lang.String text, int windowId)
This method corresponds to the Progress statement
STATUS INPUT text
.
statusInput
in interface ClientExports
text
- The new status message. null
is the equivalent
of the empty string.windowId
- Id of target windowpublic void statusInputRevert(int windowId)
statusInputRevert
in interface ClientExports
windowId
- Id of target windowpublic void statusInputOff(int windowId)
This method corresponds to the Progress statement
STATUS INPUT OFF IN WINDOW wnd
.
statusInputOff
in interface ClientExports
windowId
- Id of target windowpublic ScreenBuffer[] view(int widgetId, ScreenBuffer[] frameBuf, int[] widgetIds, boolean isView, int windowId)
view
in interface ClientExports
widgetId
- The frame ID or widget this request came for.frameBuf
- The screen buffer with current values of widgets.widgetIds
- The array of field level widget IDs to be shown or
null
, which means all of them.isView
- true
if the call is for VIEW, false
for DISPLAY.windowId
- target window id.public void clientLog(java.lang.String message, java.lang.String[] stack)
clientLog
in interface ClientExports
message
- the messagestack
- the Progress stack tracepublic void logStackTrace(java.lang.String message)
logStackTrace
in interface ClientExports
message
- the messageprivate void view_(int widgetId, ScreenBuffer[] frameBuf, int[] widgetIds, boolean isView, boolean markTarget, int windowId)
Notes on the logic of view/display calls in redirected mode:
Listed below are steps taken in redirected mode before the common worker viewWorker() is called.
FS = (NH ? HS : 0) + BS
widgetId
- The frame ID or widget this request came for.frameBuf
- The screen buffer array with current values of widgets in editable frames.widgetIds
- The array of field level widget IDs to be shown or
null
, which means all of them.isView
- true
if the call is for VIEW, false
for DISPLAY.markTarget
- true
if the call is for regular frame,
false
for page elements renderingwindowId
- target window id.public static int frameIdFromWidgetId(int widgetId)
widgetId
- The widget ID.public void displayAndDown(int widgetId, ScreenBuffer[] frameBuf, int[] widgetIds, int streamId, boolean register, boolean pageTop, int windowId)
displayAndDown
in interface ClientExports
widgetId
- The frame ID or widget this request came for.frameBuf
- The screen buffer array with current values of widgets for editable frames.widgetIds
- The array of field level widget IDs to be shown or
null
, which means all of them.streamId
- The stream to be used as the temporary terminal redirection
(only for the duration of this call).register
- true
if the frame associated with this request
must be registered as a page element with the given stream.pageTop
- true
if the page element registration is for
a page top element, false
for a page bottom
element. This parameter is ignored if register
is false
.windowId
- Id of target window or WindowConfig.RESOLVE_WINDOW
for
current or default window.public WidgetConfig[] view(int widgetId, ScreenBuffer[] frameBuf, int[] widgetIds, int streamId, boolean register, boolean pageTop, boolean isView, int windowId)
The terminal will be temporarily redirected to the given stream for the
duration of this method call. This allows the caller to avoid
bracketing this call with switchOutput(int, boolean)
invocations, as the
same result is achieved internal to this method's operation.
view
in interface ClientExports
widgetId
- The frame ID or widget this request came for.frameBuf
- The screen buffer array with current values of widgets for editable frames.widgetIds
- The array of field level widget IDs to be shown or
null
, which means all of them.streamId
- The stream to be used as the temporary terminal redirection
(only for the duration of this call). If this is not -1,
then the any pending PUT or EXPORT output on this stream will
be ended/forced out.register
- true
if the frame associated with this request
must be registered as a page element with the given stream.pageTop
- true
if the page element registration is for
a page top element, false
for a page bottom
element. This parameter is ignored if register
is false
.isView
- true
if the call is for VIEW, false
for DISPLAY.windowId
- Id of target window or WindowConfig.RESOLVE_WINDOW
for
current or default window.public ScreenBuffer[] promptFor(int frameId, int[] widgetIds, ScreenBuffer[] sb, int seconds, EventList el, boolean doIO, int windowId)
promptFor
in interface ClientExports
frameId
- ID of frame this request came forwidgetIds
- array of field level widget IDs to be enabled or
null
, which means all of them.sb
- The currently editable frames screen buffer array.seconds
- Time to wait for event.el
- List of events to wait for.doIO
- tells to perform the requested operation if true
.
otherwise prepares the frame for editing session only.windowId
- Id of target window or WindowConfig.RESOLVE_WINDOW
for
current or default window.ScreenBuffer
array with the current values.public java.lang.String refreshFrameWidget(int fid, int wid, BaseDataType value)
The frame is not necessarily on top of Z-order and the widget is not necessarily fully visible. This operation does not change the Z-order.
refreshFrameWidget
in interface ClientExports
fid
- frame to refreshwid
- widget to refreshvalue
- new widget valueprivate void iterateEditingBlock()
public static void view(Widget widget, ScreenBuffer[] frameBuf, int[] widgetIds, boolean isView)
viewWorker(Widget, ScreenBuffer[], int[], boolean, int)
.widget
- The frame or widget for this request.frameBuf
- The current values of widgets in editable frames.widgetIds
- Array of field level widget IDs to be shown or
null
, which means show all contained widgets
(for frame only).isView
- true
if the call is for VIEW, false
for DISPLAY.private void viewWorker(Widget widget, ScreenBuffer[] frameBuf, int[] widgetIds, boolean isView, int windowId)
view(int, com.goldencode.p2j.ui.ScreenBuffer[], int[], boolean, int)
method.widget
- The frame or widget for this request.frameBuf
- The current values of widgets in editable frames.widgetIds
- Array of field level widget IDs to be shown or
null
, which means show all contained
widgets (for frame only).isView
- true
if the call is for VIEW, false
for DISPLAY.windowId
- target window id.void endWidgetOutput()
void startWidgetOutput()
public void conditionalRefresh(Rectangle rect)
rect
- Rectangle to refresh.public void conditionalLineRefresh(Rectangle rect)
rect
- Rectangle to refresh.private void placeFrameInt(Frame frame, boolean force)
frame
- Frame which will be displayed.force
- true
means forced frame placement even if
the frame is currently visible; useful for recovering partially
hidden frames.private boolean hideFramesInt(Frame frame)
frame
- Frame which is about to be displayed.true
if pause was triggered.public void markFrames(MarkEntry me)
me
- MarkEntry
container with operation and array of
frames to process.public ScreenBuffer[] waitFor(EventList list, int focusWidgetId, int seconds, ScreenBuffer[] inbuf)
waitFor
in interface ClientExports
list
- List of events to wait for.focusWidgetId
- Widget ID of a widget receiving focus first, or -1.seconds
- Time to wait for event.inbuf
- currently editable frames screen buffer known to the server.ScreenBuffer
array with the current values.public ScreenBuffer[] waitFor(EventList list, int focusWidgetId, int seconds, ScreenBuffer[] inbuf, BlockingOperation op, boolean force)
list
- List of events to wait for.focusWidgetId
- Widget ID of a widget receiving focus first, or -1.seconds
- Time to wait for event.inbuf
- currently editable frames screen buffer known to the server.op
- The type of blocking operation.force
- If true
, on output, copy the current data into
the returned screen buffer without regard to the changed
flag.ScreenBuffer
array with the current values.public ScreenBuffer[] waitForWorker(EventList list, int focusWidgetId, int seconds, ScreenBuffer[] inbuf, boolean force, boolean status, boolean entryWindow, BlockingOperation operation)
It manages the focus scopes, sets the initial focus and provides a message processing loop. The focus validity is constantly monitored and when it needs adjustment and the conditions are appropriate, the focus gets adjusted.
list
- List of events to wait for.focusWidgetId
- Widget ID of a widget receiving focus first, or -1.seconds
- The time to wait for a given key event.inbuf
- The currently editable frames screen buffer known to the server.force
- If true
, on output, copy the current data into
the returned screen buffer without regard to the changed
flag.status
- If true
method will change status line.entryWindow
- true
if ENTRY for window should be sent.operation
- The operation
for which this event loop is executed.ScreenBuffer
array with the current values.public ScreenBuffer[] waitForWorker(EventList list, int focusWidgetId, int seconds, ScreenBuffer[] inbuf, boolean force, boolean status, boolean entryWindow, BlockingOperation operation, boolean restoreFocus)
It manages the focus scopes, sets the initial focus and provides a message processing loop. The focus validity is constantly monitored and when it needs adjustment and the conditions are appropriate, the focus gets adjusted.
list
- List of events to wait for.focusWidgetId
- Widget ID of a widget receiving focus first, or -1.seconds
- The time to wait for a given key event.inbuf
- The currently editable frames screen buffer known to the server.force
- If true
, on output, copy the current data into
the returned screen buffer without regard to the changed
flag.status
- If true
method will change status line.entryWindow
- true
if ENTRY for window should be sent.operation
- The operation
for which this event loop is executed.restoreFocus
- When true
currenty focused widget will be kept before the event loop
is started and eventually restored when condition is raised.
When false
the method will not attempt to restore focus.ScreenBuffer
array with the current values.private void fixWaitForFocus(int cop, Widget<?> saveFocus, Widget<?> savePending, int focusState, int pendingState)
cop
- The current operation.saveFocus
- The focus before the event loop started.savePending
- The pending focus set via pendingFocus
, before the event loop started.focusState
- The focus state for the saveFocus
.pendingState
- The focus state for the savePending
.private void fixFocusedFrameZOrder()
public boolean sendEntry(Widget widget)
widget
- target widget for sending ENTRY eventtrue
if no trigger or the trigger has returned
normallyfalse
if the trigger has returned no-applypublic boolean sendEntry(Widget widget, boolean mouse)
widget
- target widget for sending ENTRY eventmouse
- Flag indicating this ENTRY is posted from a mouse event. In this case, drawing is
bypassed.true
if no trigger or the trigger has returned
normallyfalse
if the trigger has returned no-applypublic boolean sendLeave(Widget widget)
widget
- target widget for sending LEAVE eventtrue
if no trigger or the trigger has returned
normallyfalse
if the trigger has returned no-applypublic boolean sendLeave(Widget widget, boolean mouse)
widget
- target widget for sending LEAVE eventmouse
- Flag indicating this LEAVE is posted from a mouse event. In this case, drawing is
bypassed.true
if no trigger or the trigger has returned
normallyfalse
if the trigger has returned no-applypublic boolean isTriggerWasAppliedWithoutWaitFor()
true
if both conditions are met.private void processPostponedValueChanged()
private void startInputStatus(boolean cursor)
cursor
- New state of the cursor. true
for the cursor
to be forced into visibility and false
to hide
the cursor.private void stopInputStatus()
private void stopInputStatus(boolean changeStatus)
changeStatus
- Allow changing status line.private boolean trigger(int triggerId, int eventId, int sourceId, int otherId, long resourceId, ScreenBuffer sb, EventList previousEventList)
triggerId
- The trigger to be called.eventId
- The event which was generated.sourceId
- The widget which generated the event.otherId
- The companion widget id (for ENTER/LEAVE).resourceId
- The resource which generated the event.sb
- The associated frame's current ScreenBuffer
true
if the event must be consumed (this is
equivalent to RETURN NO-APPLY
.public boolean validate(int sourceId, ScreenBuffer sb)
This signal is used to trigger validation execution on the server.
sourceId
- widget ID of the widget generated the trigger.sb
- current ScreenBuffer
private ScreenBuffer[] getEditableClientScreenBuffers(ScreenBuffer sbDefault)
sbDefault
- The default screen buffer for the exact frame in processing.public java.lang.String getValidationError()
null
if the last validation succeeded.public WidgetConfig[] getEditorsConfigs(int browseId)
browseId
- ID of the browse which should handle the request.null
if the column is not
editable. Return value is null
if the browse is read-only.public int getRowCount(int browseId)
browseId
- ID of the browse which should handle the request.public int getRowCount(int browseId, int startRow)
browseId
- ID of the browse which should handle the request.startRow
- Initial row to start count rows from.public BrowseRow[] getRows(int browseId, int startRowIndex, int count, boolean forward, int rowDisplayTriggerId, ScreenBuffer[] sb, RowDisplayStrategy displayStrategy)
browseId
- ID of the browse which should handle the request.startRowIndex
- Index of the first row to retrieve (0-based).count
- Maximum count of rows to return. -1
for no limit.forward
- true
if rows are retrieved in the forward direction,
false
if rows are retrieved in the backward direction.rowDisplayTriggerId
- Trigger ID of the ROW-DISPLAY trigger. -1
if there is no ROW-DISPLAY
trigger for this browse.sb
- Screen buffer for the ROW-DISPLAY trigger. null
if there is no
ROW-DISPLAY trigger for this browse.displayStrategy
- Specifies type of action for which rows are fetched and defines how rows are
iterated / displayed.null
is returned.public BrowseRow[] getRows(int browseId, char searchChar, int searchColumn, int viewportTopRow, int viewportBottomRow, int rowDisplayTriggerId, ScreenBuffer[] sb)
browseId
- ID of the browse which should handle the request.searchChar
- Character to be searched for. Search is performed using only the first character
(in the visual data representation) in the current column. Specifying a character
puts this function in the search mode. This parameter is null
for
non-search mode.searchColumn
- For search mode: 0-based index of the column to be searched.viewportTopRow
- For search mode: 0-based index (in the result set) of the top row in the current
view.viewportBottomRow
- For search mode: 0-based index (in the result set) of the bottom row in the
current view.rowDisplayTriggerId
- Trigger ID of the ROW-DISPLAY trigger. -1
if there is no ROW-DISPLAY
trigger for this browse.sb
- Screen buffer for the ROW-DISPLAY trigger. null
if there is no
ROW-DISPLAY trigger for this browse.null
is returned.public void updateRow(int browseId, int rowIndex, int[] cellIndices, BaseDataType[] cellValues, boolean onlyNotifyRowReleased) throws DataValidationException
browseId
- ID of the browse which should handle the request.rowIndex
- Index of the row to update.cellIndices
- Cells for update indexes.cellValues
- Cells for update new values.onlyNotifyRowReleased
- Only notify server that the row has been released. Data is not updated.DataValidationException
- New values don't passed database validation rules.public int setCurrentRow(int browseId, int rowIndex)
browseId
- ID of the browse which should handle the request.rowIndex
- 0-based index of the current row.public int getCurrentRow(int browseId)
browseId
- ID of the browse which should handle the request.public boolean isRowAvailable(int browseId, int rowIndex)
browseId
- ID of the browse which should handle the request.rowIndex
- 0-base index of the target row in the browse model.true
if the row is "available", i.e. it is not deleted.public boolean continueEditing(boolean hadNext)
continueEditing
in interface ClientExports
hadNext
- true
if the executing business logic executed a NEXT
statement causing the editing block to iterate. This will result in clearing
any current GO-PENDING
condition. This is passed as a parameter
here so that a separate trip down to the client is not needed to process the
editing block iteration state update.true
if there is no GO-PENDING
and the editing mode
continues.private void startEditingMode(int focusWidgetId, EventList eventList)
This call is responsible for setting the initial focus to the first enabled widget or NEXT-PROMPT hint.
focusWidgetId
- ID of the target frame for this editing sessioneventList
- Information about events to wait for.public ScreenBuffer[] stopEditingMode()
continueEditing(boolean)
. This
method allows the client's state to be cleaned up in the abnormal
termination case.stopEditingMode
in interface ClientExports
public void waitForNextKey()
waitForNextKey
in interface ClientExports
public java.io.Serializable getChanges()
To enable incremental changes, it is guaranteed that this method will be called every time any message is sent to the other side of the connection. In addition, this will only be called once per message.
In a system in which control flow is "sent" to the other side of the
connection (a type of "conversation" or single-threaded synchronous
mode), it is further guaranteed that any changes that are made at the
other side after this is called will result in a call to this side's
applyChanges(java.io.Serializable)
method before this method is ever called again
(when control flow returns to this side of the connection). This allows
one to ensure that on the call to this method, any "dirty" flags can be
safely cleared and the state of this side will be updated with
the results of the other side's changes before this method must ever
again check to see if there are changes to send.
Note that any user input events received by the application while the thread is waiting for the server's response are enqueued in the event queues and processed once server response is received and the thread resumes processing. During this time the client app appears as locked for any input.
getChanges
in interface StateSynchronizer
null
if no changes need to be sent.public void applyChanges(java.io.Serializable changes)
applyChanges
in interface StateSynchronizer
changes
- The payload of state changes that must be locally applied.public boolean isChui()
isChui
in interface ClientExports
true
if ChUI driver false
if GUI driver.public boolean isEmbedded()
isEmbedded
in interface ClientExports
TRUE
if the client is running in embedded mode,
FALSE
otherwisepublic boolean isUnderWindows()
public void setSessionTooltips(boolean tooltips)
setSessionTooltips
in interface ClientExports
tooltips
- The new value for session related TOOLTIPS attribute.public void activateTooltipForWidget(int wId)
activateTooltipForWidget
in interface ClientExports
wId
- The widget ID to activate tooltip.public void deactivateTooltipForWidget(int wId)
deactivateTooltipForWidget
in interface ClientExports
wId
- The widget ID to deactivate tooltip.public void destroyFrame(int frameId)
destroyFrame
in interface ClientExports
frameId
- The frame requiring cleanup.public void destroyMenu(int menuId)
destroyMenu
in interface ClientExports
menuId
- The menu requiring cleanup.private void selectiveDisable(Frame frame)
frame
- Frame where widgets should be disabled.public boolean isGoPending()
editing
block or a wait-for
).
This method corresponds to the Progress built-in function:
GO-PENDING
isGoPending
in interface ClientExports
true
if an event has been applied that caused
pending GO for the current editing operation.public Frame getFrame(int frameId)
frameId
- Frame ID.public int getFrameLine(Frame frame, int pendingUpDown)
This method corresponds to the Progress built-in function:
FRAME-LINE
frame
- The frame for this request. Must NOT be null
.pendingUpDown
- The pending down value for this frame.private void cleanupQueue()
public boolean restoreCursor(NativePoint curpos, boolean curvis)
curpos
- The 0-based location to which the cursor must be forced.curvis
- The new cursor visibility state (true
means
set the cursor visible).public boolean isInEditingBlock()
true
if in editing block, false
- otherwise.public Frame getLastViewed()
public void setLastViewed(Frame frame)
frame
- Last viewed frame.private boolean honorConditionalUpDown(boolean noPause)
noPause
- Make no pause if frame will need it during DOWN processing.true
if down frame was wrapped during processing of
conditional UP/DOWN.private void honorConditionalUpDown()
public Widget getWidget(WidgetId componentId)
Component
instance for a given ID.componentId
- ID of the requested Component
instance.Component
instance with given ID.public Widget getWidget(int componentId)
Component
instance for a given ID.componentId
- ID of the requested Component
instance.Component
instance with given ID.public void setFormat(int widget, java.lang.String format)
setFormat
in interface ClientExports
widget
- The widget to modify.format
- The format specification.public void setNumericFormat(char decSep, char groupSep)
setNumericFormat
in interface ClientExports
decSep
- The new decimal separator.groupSep
- The new group separator.public int getLastActionCode()
public EventList getCurrentEventList()
private java.lang.String makePauseText(int seconds)
seconds
- Seconds to wait for an event. Negative value means wait
indefinitely and number of seconds is not displayed.private Widget computeFocus(boolean frameAsTarget)
frameAsTarget
- if true
, then the active frame is the target of
events if nothing is enabled and in focus, otherwise
the current windownull
if no focus can be determind.private Event waitForEvent(int seconds, boolean frameAsTarget, boolean honorServerEvent)
seconds
- -1 means indefinite wait, 0 means no wait and positive values
mean the number of seconds to waitframeAsTarget
- if true
, then the active frame is the target of
events if nothing is enabled and in focus, otherwise
the current windowhonorServerEvent
- flag indicating if server events should be honored or not.private Event waitForEvent(int seconds, boolean frameAsTarget, boolean honorServerEvent, boolean includeOSEvent)
seconds
- -1 means indefinite wait, 0 means no wait and positive values
mean the number of seconds to waitframeAsTarget
- if true
, then the active frame is the target of
events if nothing is enabled and in focus, otherwise
the current windowhonorServerEvent
- flag indicating if server events should be honored or not.includeOSEvent
- flag indicating if OS events (mouse, window) should be considered the as action
source or not.private boolean checkForSystemEvent(KeyInput key)
key
- The key to be checked.true
if more keys need to be read.private void pauseCleanup()
private ScreenBuffer getScreenBuffer(Widget widget)
ScreenBuffer
instance for the given
frame or for the frame in which the given widget is contained.widget
- A frame or a widget in the frame whose screen buffer must be
returned.ScreenBuffer
instance.private ScreenBuffer getScreenBuffer(int frameId, int size)
ScreenBuffer
instance for the given
frame.frameId
- The frame whose screen buffer must be returned.size
- The number of widgets in the screen buffer in total or -1
to allow this value to be calculated.ScreenBuffer
instance.private ScreenBuffer getScreenBuffer(int frameId, int size, boolean force)
ScreenBuffer
instance for the given
frame.frameId
- The frame whose screen buffer must be returned.size
- The number of widgets in the screen buffer in total or -1
to allow this value to be calculated.force
- true
to copy the current data into the screen
buffer without regard to the changed flag.ScreenBuffer
instance.private void processSideLabel(ScreenBuffer buffer, Widget<?> comp)
As side-labels are detached from normal frame widgets, the frame's buffer needs to be manually updated.
buffer
- The screen buffer.comp
- The widget for which the side-label needs processing.private void setScreenBuffers(ScreenBuffer[] frameBuf)
ScreenBuffer
array for current set of frames and assigns new widget
values. No checking for frame existence.frameBuf
- ScreenBuffer
array to apply.private void setScreenBuffers(ScreenBuffer[] frameBuf, boolean checkFrameExists)
ScreenBuffer
array for current set of frames and assigns new widget
values.frameBuf
- ScreenBuffer
array to apply.checkFrameExists
- Flag indicating checking frame for existence before applying the buffer.private void setScreenBuffer(ScreenBuffer frameBuf)
ScreenBuffer
instance for current set of frames
and assigns new widget values.frameBuf
- ScreenBuffer
instance.private void setScreenBuffer(ScreenBuffer frameBuf, boolean direct)
ScreenBuffer
instance for current set of frames
and assigns new widget values.
Allows direct drawing of headers.
frameBuf
- ScreenBuffer
instance.direct
- if set to true
, header widgets draw directly
instead of posting PaintEvent
.private java.util.ArrayList<java.lang.Integer> updateHeaders(ScreenBuffer frameBuf)
ScreenBuffer
instance.frameBuf
- The ScreenBuffer
instance to update headers from.private void applyWorker(Event event)
event
- Progress eventScreenBuffer clearWorker(Frame frame, boolean noPause, boolean clearAll, boolean resolveBuffer)
frame
- Frame to clear.noPause
- Do not generate pause.clearAll
- If true
then all widgets are cleared (the
CLEAR ALL behavior).resolveBuffer
- When true
, resolve the frame's screen buffer and return it.null
if the resolveBuffer
flag is not set.public boolean independentEventDrawingBracket(Widget widget, java.lang.Runnable code)
push()
, executes the code and then ends with
a pop()
and finally disables invalidation mode. The closing of the
event bracket and the disabling of invalidation mode (which can cause
drawing) occur even if the executed code throws an exception. This ensures
that the event processing and drawing will never get out of balance.
This version forces flushing when the invalidation mode is disabled. In addition, the invalidation counter is saved at the beginning and restored at the end of this method.
widget
- The widget which triggered this drawing. If is null
, the window
as returned by WindowManager.findWindow(int)
will be used; otherwise, the
widget's window will be used.code
- Logic to safely execute inside the event bracket.pop
.public boolean eventDrawingBracket(Widget<?> widget, java.lang.Runnable code)
push()
, executes the code and then ends with
a pop()
and finally disables invalidation mode. The closing of the
event bracket and the disabling of invalidation mode (which can cause
drawing) occur even if the executed code throws an exception. This ensures
that the event processing and drawing will never get out of balance.
This version forces flushing when the invalidation mode is disabled.
widget
- The widget which triggered this drawing. If is null
, the window
as returned by WindowManager.findWindow(int)
will be used; otherwise, the
widget's window will be used.code
- Logic to safely execute inside the event bracket.pop
.boolean eventDrawingBracket(Widget<?> widget, boolean discard, java.lang.Runnable code)
push()
, executes the code and then ends with
a pop()
(or popTrash()
) and finally disables invalidation
mode. The closing of the event bracket and the disabling of invalidation
mode (which can cause drawing) occur even if the executed code throws an
exception. This ensures that the event processing and drawing will never
get out of balance.
This version forces flushing when the invalidation mode is disabled.
widget
- The widget which triggered this drawing. If is null
, the window
as returned by WindowManager.findWindow(int)
will be used; otherwise, the
widget's window will be used.discard
- true
to use popTrash
,
false
to use pop
.code
- Logic to safely execute inside the event bracket.pop
. If
popTrash
is used, the result will always be
false
.public boolean eventDrawingBracket(Widget<?> widget, boolean discard, boolean flush, java.lang.Runnable code)
push()
, executes the code and then ends with
a pop()
(or popTrash()
) and finally disables invalidation
mode. The closing of the event bracket and the disabling of invalidation
mode (which can cause drawing) occur even if the executed code throws an
exception. This ensures that the event processing and drawing will never
get out of balance.widget
- The widget which triggered this drawing. If it is null
, the window
as returned by WindowManager.findWindow(int)
will be used; otherwise, the
widget's window will be used.discard
- true
to use popTrash
, false
to use pop
.flush
- Force flushing when invalidation mode is disabled.code
- Logic to safely execute inside the event bracket.pop
. If popTrash
is used, the result
will always be false
.public boolean eventBracket(java.lang.Runnable code)
push()
and ends with a pop()
even if the
executed code throws an exception. This ensures that the event processing
will never get out of balance.code
- Logic to safely execute inside the event bracket.pop
.public boolean eventBracket(boolean discard, java.lang.Runnable code)
push()
and ends with a pop()
or
popTrash()
even if the executed code throws an exception. This
ensures that the event processing will never get out of balance.discard
- true
to use popTrash
,
false
to use pop
.code
- Logic to safely execute inside the event bracket.pop
. If
popTrash
is used, the result will always be
false
.private boolean pop()
true
if at least one frame related
PaintEvent
has been processedprivate void popTrash()
private void push()
public int getTriggerNesting()
public static boolean needPause()
public void pauseBeforeEnd()
pauseBeforeEnd
in interface ClientExports
public int watchCtrlC()
This method is called in the context of the key reader thread.
This implementation's goal is to properly generate the STOP condition.
watchCtrlC
in interface Watcher
public void setAuthMode(boolean auth)
Control
but processed as a
normal sequence.auth
- New state of the flag.public static RedirectedTerminal redirectedTerminalForStream(Stream out)
out
- The stream being queried.RedirectedTerminal
associated with
the stream.public void notifyClose(Stream out)
This listener is used to catch the event of the stream closure to flush any output that may remain sitting in the redirected terminal buffer.
notifyClose
in interface CloseListener
out
- The stream being closed.public void notifyUnbind(Stream out)
This notification is used to unbind frames which were switched from interactive mode to redirected mode and restore their initial state.
notifyUnbind
in interface CloseListener
out
- The stream being closed.public void notifyAdvance(Stream out)
This listener is used to catch the event to flush any output that may remain sitting in the redirected terminal buffer.
notifyAdvance
in interface AdvanceListener
out
- The stream being pagedpublic void notifyFlush(Stream out)
This listener is used to catch the event to flush any output that may remain sitting in the redirected terminal buffer.
notifyFlush
in interface FlushListener
out
- The stream being flushed.public int idFromStream(Stream s)
s
- stream to operate on-1
if no stream ID is associated
with the given stream.public Stream streamFromId(int sid)
sid
- stream IDnull
if stream ID unknown.public int[] getSelection(int widgetId)
getSelection
in interface ClientExports
widgetId
- Widget ID.null
if specified widget does not exists or does not support such a
request.private void requestHelp()
public boolean isRedirected()
isRedirected
in interface ClientExports
true
if the terminal is redirected to a stream,
false
if the terminal is interactive.public boolean isRedirected(Stream s)
s
- a stream to to check the redirection fortrue
if the terminal is redirected to the stream,
false
if the terminal is interactive.or
redirected to a different streampublic void redirectOutput(int oldId, int newId)
newId
(or to the interactive terminal if newId
is -1) and close/
cleanup resources for the redirected terminal associated with
oldId
(unless oldId
is -1 in which case
nothing needs to be closed).redirectOutput
in interface ClientExports
oldId
- The previously redirected stream for which the redirected
terminal is to be closed or -1 for no close/cleanup action.newId
- The stream for which a redirected terminal is to be setup for
redirection or -1 to remove redirections and activate the
interactive terminal.public int switchOutput(int newId, boolean clean)
newId
(or to the interactive terminal if newId
is -1) and return
the id of the current output destination. This may be another
redirected terminal or it may be -1 if the interactive terminal is in
use.
If redirection has not yet been established for the given stream, it will be setup.
newId
- The stream for which a redirected terminal is to be setup for
redirection or -1 to remove redirections and activate the
interactive terminal.clean
- true
if this stream will need deferred cleanup.public int switchOutput(int newId, boolean clean, boolean endOut)
newId
(or to the interactive terminal if newId
is -1) and return
the id of the current output destination. This may be another
redirected terminal or it may be -1 if the interactive terminal is in
use.
If redirection has not yet been established for the given stream, it will be setup.
switchOutput
in interface ClientExports
newId
- The stream for which a redirected terminal is to be setup for
redirection or -1 to remove redirections and activate the
interactive terminal.clean
- true
if this stream will need deferred cleanup.endOut
- true
to force any pending PUT or EXPORT output
to be ended for the given stream (so long as that stream is
not the terminal).public void cleanupPseudoTerminal(int id)
switchOutput(int, boolean)
interface.
This should never be called when the redirection is currently active.
cleanupPseudoTerminal
in interface ClientExports
id
- The stream needing cleanup.public int nextTabItem(int frameId, int widgetId)
nextTabItem
in interface ClientExports
frameId
- frame where the widget is placedwidgetId
- target widget which is being queried-1
.public void resetBufferSizeManager()
resetBufferSizeManager
in interface ClientExports
public static void setValueChangedEvent(KeyInput input)
input
- The event to assign.public static void removeFrame(Frame frame)
frame
- The frame to remove.public static void removeWidget(Widget<?> widget)
widget
- The widget to be removed.public static void wrapFrame(Frame frame)
frame
- The frame to remove.public static boolean isRefreshQuirkActive()
true
if refreshing quirk is active.public static void setupTooltip(WidgetWithConfig<? extends WidgetConfig> widget)
widget
- the widget the tooltip is configured forprivate void resetChanged(int frameId)
frameId
- ID of frame this request came forprivate int switchWorker(int newId)
newId
(or to the interactive terminal if newId
is -1) and return
the id of the current output destination. This may be another
redirected terminal or it may be -1 if the interactive terminal is in
use.
If redirection has not yet been established for the given stream, it will be setup.
newId
- The stream for which a redirected terminal is to be setup for
redirection or -1 to remove redirections and activate the
interactive terminal.public int forceInteractive()
restoreRedirection(int)
to restore the terminal when
done with interactive mode.public void restoreRedirection(int tempTerm)
tempTerm
- The terminal id of the redirected terminal that was previously
removed using forceInteractive()
or -1 if there was no
previous redirected terminal.private boolean processEventsWorker()
This method corresponds to the Progress statement
PROCESS EVENTS
true
if at least one frame related
PaintEvent
has been processedpublic boolean processMnemonic(KeyInput evt, int key, Widget<?> src)
evt
- The event to process.key
- The associated key.src
- The event's source.true
if the key was processed as a mnemonic by a widget.public void processProgressEvent(Event event)
Precedence order for honoring Progress key events:
If any exit condition is found, the isGoPending
flag is
set.
event
- Event to handle.private boolean processBrowseEvent(KeyInput evt)
evt
- Current event.true
if the event was an END-ERROR event and was
handled and consumed by a browse widget in the event's
component hierarchy; else false
.public int getRowDisplayTriggerId(int browseId)
browseId
- Browse widget ID.-1
if there is
no such trigger.public ScreenBuffer[] getEditableClientScreenBuffers(Widget widget)
widget
- Widget which initiates the call.public ThinClient.TriggerResult invokeRowDisplayTrigger(int widgetId)
rowDisplayEvents
map for a ROW-DISPLAY trigger
associated with this widget. If this is a browse widget and such a
trigger is found, it will be executed.widgetId
- event source.public ThinClient.TriggerResult invokeTriggers(Widget widget, int evtCode, boolean isKey)
EventList
instance for triggers defined
for this event and widget pair and activate the first one found.
Triggers are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
The first found trigger, if any, gets activated.
widget
- event source.evtCode
- event code.isKey
- This flags marks reals keys typed by user.public ThinClient.TriggerResult invokeTriggers(Widget widget, int evtCode, boolean isKey, java.lang.Integer eventX, java.lang.Integer eventY)
EventList
instance for triggers defined
for this event and widget pair and activate the first one found.
Triggers are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
The first found trigger, if any, gets activated.
widget
- event source.evtCode
- event code.isKey
- This flags marks reals keys typed by user.eventX
- The value of LAST-EVENT:X attribute; null
if not used.eventY
- The value of LAST-EVENT:Y attribute; null
if not used.public ThinClient.TriggerResult invokeTriggers(Widget widget, Widget other, int evtCode, boolean isKey)
EventList
instance for triggers defined
for this event and widget pair and activate the first one found.
Triggers are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
The first found trigger, if any, gets activated.
widget
- event source.other
- a companion widget (for ENTER/LEAVE events).evtCode
- event code.isKey
- This flags marks real keys typed by user.private ThinClient.TriggerResult invokeTriggers(Widget widget, long resourceId, int evtCode, boolean isKey)
EventList
instance for triggers defined
for this event and widget pair and activate the first one found.
Triggers are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
The first found trigger, if any, gets activated.
widget
- event source.resourceId
- When not set to -1, is a valid resource ID (for non-widget events).evtCode
- event code.isKey
- This flags marks reals keys typed by user.private ThinClient.TriggerResult invokeTriggers(Widget widget, Widget other, long resourceId, int evtCode, boolean isKey)
EventList
instance for triggers defined
for this event and widget pair and activate the first one found.
Triggers are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
The first found trigger, if any, gets activated.
widget
- event source.other
- a companion widget (for ENTER/LEAVE events).resourceId
- When not set to -1, is a valid resource ID (for non-widget events).evtCode
- event code.isKey
- This flags marks reals keys typed by user.private ThinClient.TriggerResult invokeTriggers(Widget widget, Widget other, long resourceId, int evtCode, boolean isKey, java.lang.Integer eventX, java.lang.Integer eventY)
EventList
instance for triggers defined
for this event and widget pair and activate the first one found.
Triggers are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
The first found trigger, if any, gets activated.
widget
- event source.other
- a companion widget (for ENTER/LEAVE events).resourceId
- When not set to -1, is a valid resource ID (for non-widget events).evtCode
- event code.isKey
- This flags marks reals keys typed by user.eventX
- The value of LAST-EVENT:X attribute; null
if not used.eventY
- The value of LAST-EVENT:Y attribute; null
if not used.private void setFocusSilent(Widget inFocus)
inFocus
- Widget to focus.private void checkHelpText(Widget focus)
focus
- Widget in focus.private boolean checkBreak(Widget widget, int evtCode, boolean isKey)
EventList
instance for exit conditions
for this event and widget pair.
Events are searched either for a specific widget, or, if no widget is enabled (in focus), for the session window. The latter is also performed if the specific widget happens to be the session window.
The specific search is done in the following order:
The search for the session window is a one step process.
widget
- event source.evtCode
- event code.isKey
- Mark real keys typed by user.true
if a matching event existsprivate boolean checkBreak(long resourceId, int evtCode)
EventList
instance for exit conditions for this event and resource pair.
The specific search is done by exact match for the specified resource and event
resourceId
- id of the resource generating the event.evtCode
- event code.true
if a matching event existsprivate void processCondition(int action, int opcode, boolean inPause) throws StopConditionException, EndConditionException, ErrorConditionException
action
- The key action to check against the list of possible
conditions.opcode
- Specifies which operation is in process (for example, a
EventList.WAIT_FOR
).inPause
- Specifies whether the method is called from a pausing
function.StopConditionException
- If action is Keyboard.KA_STOP
.EndConditionException
- If action is Keyboard.KA_ENDKEY
or on
Keyboard.KA_END_ERROR
on the first interaction in the
current block or when opcode is
EventList.WAIT_FOR
.ErrorConditionException
- If action is Keyboard.KA_END_ERROR
and one of the
above conditions does not hold.private boolean validateWidget(Widget widget)
widget
- widget to validateprivate void enableFillInAutoZap(Widget widget)
widget
- Widget to process.private int validateWidget(int id, int[] ids)
id
- widget id to validateids
- array of allowed ids or null
-1
public void highlight(Widget widget, boolean state)
widget
- The widget to modify.state
- The new state of the widget's highlight.public int saveInsState()
public void restoreInsState(int savedInsState, boolean force)
savedInsState
- Insert mode that was before the call of the corresponding
prompting function or trigger.force
- Whether we have to repaint the indicator even if the new mode
is the same as the old one.public void setNeedPause(boolean needPause, TopLevelWindow wnd)
needPause
flag.needPause
- New value for the flag.wnd
- Not null target window. If null - an NPE will be thrown.boolean isNeedPause()
needPause
flag.public boolean isInEnable()
true
if enable(..)
function is being
run.public int getSavedInsState()
-1
if there is no state to apply.public void clearSavedInsState()
public Stream getCurrentRedirection()
null
if no redirection is currently in effect.null
if not
redirected.public void view(int frameId)
frameId
- Frame ID.public void handleNextPrevFrameEvents(Frame frame, boolean nextFrame)
frame
- The frame from which search will start.nextFrame
- true
if this is the NEXT-FRAME event, false
if this is the PREV-FRAME event.private Frame nextFrame(Frame frame)
frame
- Current frame.null
if no such frame available.private Frame prevFrame(Frame frame)
frame
- Current frame.null
if no such frame available.private void transferFocusToFrame(Frame frame, Frame newFrame)
frame
- Frame which holds focus now.newFrame
- Frame which should receive focus.private boolean switchStreams(Frame frame)
frame
- the target frame for the operationtrue
if the stream switch has happened and it was
not the very first switch for the frameprivate boolean switchFrames(int streamId, int frameId)
Switching the stream between frames causes flushing the buffers of the redirected terminal to the stream. Otherwise the redirected terminal receives continuous output from the same frame.
streamId
- ID of the output stream the current output is redirected to.frameId
- ID of the frame about to produce some outputtrue
when the frame switch has happened or
false
for the case of continuous output.public void flushStream(Stream out)
out
- The stream being flushed.public java.lang.Boolean isTriggerResultNoApply()
private void endOutput(int sid)
sid
- The stream on which to call endOutput
.private int flushRedirected(Stream stream, boolean bypass)
view(int, com.goldencode.p2j.ui.ScreenBuffer[], int[], boolean, int)
in order to write page headers or footers.stream
- The stream to flush or null
to flush the
current redirection destination.bypass
- true
if page header processing must be bypassed
when flushing the output. This should be true
if the caller has pushed pending redirected terminal output
into the stream since this will have already processed the
page headers and this will avoid duplicates.private void setChangedValue(Frame frame, Widget comp, WidgetConfig config, BaseDataType value, java.lang.String fmt)
frame
- Frame
where the widget belongscomp
- Component
for the widgetconfig
- ComponentConfig
for the widgetvalue
- new valuefmt
- format if formatted valuepublic Frame getActiveFrameInt()
null
if there is no
such frame.private void stopNoAvailableWidgets()
StopConditionException
- always thrown - stop all other processingprivate void putScreenDirect(java.lang.String text, double row, double column, Color color)
text
- Text to out.row
- Row.column
- Column.color
- Color.private void positionCursor()
private void repaintAffectedWidgets(Frame[] frames, java.lang.Iterable<Widget> widgets)
frames
- List of frames above current frame.widgets
- Array of affected widgets.public void setPendingFocus(Widget pendingFocus)
pendingFocus
widget.pendingFocus
- New value for pendingFocus
.public Widget getPendingFocus()
pendingFocus
widget.pendingFocus
widget.public void setTriggerNesting(int triggerNesting)
triggerNesting
counter.triggerNesting
- New value of triggerNesting
counter.private void preprocessView(ScreenBuffer[] frameBuf, Widget widget, int[] widgetIds)
frameBuf
- The frames buffer array for editable frames.widget
- The widget targeted by VIEW (may be a FRAME or another widget).widgetIds
- The widget list.private void preprocessFrameDef(Frame frame, WidgetConfig cc)
frame
- Frame to process.cc
- New widget config.public ServerExports getServer()
ServerExports
instance.public LowLevelBuffer getMemoryDaemon()
LowLevelBuffer
implementation.public static boolean nextFocus(Widget widget)
widget
- Component
that is the reference widget, which is
currently retaining focus.true
if focus change is successful.public static boolean previousFocus(Widget widget)
widget
- Component
that is the reference widget, which is
currently retaining focus.true
if focus change is successful.public static boolean nextTabStop(Widget widget)
widget
- Component
that is the reference widget, which is
currently retaining focus.true
if focus change is successful.public static boolean previousTabStop(Widget widget)
widget
- Component
that is the reference widget, which is
currently retaining focus.true
if focus change is successful.public WidgetRegistry registry()
private Window<?> targetWindowWorker(int windowId)
windowId
- Id of target window or -1 for current or default windowWindowManager.resolveWindow(com.goldencode.p2j.ui.client.widget.AbstractWidget<?>)
for details.public java.lang.String getInputDefaultText()
public int getDisplayWidth(int windowId)
getDisplayWidth
in interface ClientExports
windowId
- A valid window id.public int getDisplayHeight(int windowId)
getDisplayHeight
in interface ClientExports
windowId
- A valid window id.public int getDisplayWorkAreaX(int windowId)
getDisplayWorkAreaX
in interface ClientExports
windowId
- A valid window id.public int getDisplayWorkAreaY(int windowId)
getDisplayWorkAreaY
in interface ClientExports
windowId
- A valid window id.public int getDisplayWorkAreaWidth(int windowId)
getDisplayWorkAreaWidth
in interface ClientExports
windowId
- A valid window id.public int getDisplayWorkAreaHeight(int windowId)
getDisplayWorkAreaHeight
in interface ClientExports
windowId
- A valid window id.public boolean setWindowIcon(int windowId, byte[] icon)
setWindowIcon
in interface ClientExports
windowId
- A valid window id.icon
- A new icon image array date.TRUE
if operation successful FALSE
otherwise.public boolean loadWindowIcon(int windowId, boolean small, java.lang.String name)
loadWindowIcon
in interface ClientExports
windowId
- A valid window id.small
- Flag indicating usage of the small icon case(16x16 in size).name
- The fully qualified file name for the icon to be loaded.TRUE
if operation successful FALSE
otherwise.public boolean setWindowDefaultIcon(TopLevelWindow.IconDataType type, java.lang.Object data)
setWindowDefaultIcon
in interface ClientExports
type
- Data type for second parameter.data
- Data to create new icon on client side. Can be the byte array, filename string
or nothing for predefined icon from p2j.jar client side file.TRUE
if operation successful FALSE
otherwise.public boolean setImage(int wId, int type, byte[] image)
setImage
in interface ClientExports
wId
- A valid wdget id.type
- Image type to load. Up, Down or Insensitive for buttons, -1 for image.image
- A new image array data.TRUE
if operation successful FALSE
otherwise.public boolean loadImage(int wId, int type, java.lang.String name)
loadImage
in interface ClientExports
wId
- A valid wdget id.type
- Image type to load. Up, Down or Insensitive for buttons, -1 for image.name
- The fully qualified file name for the image to be loaded.TRUE
if operation successful FALSE
otherwise.public java.lang.String getImageFileName(java.lang.String imageName)
imageName
- the name of the imagenull
of not foundpublic boolean editorSaveFile(int wId, java.lang.String name)
editorSaveFile
in interface ClientExports
wId
- A valid editor widget id.name
- The file name for the file to be written.TRUE
if operation successful FALSE
otherwise.public boolean editorReadFile(int wId, java.lang.String name)
editorReadFile
in interface ClientExports
wId
- A valid editor widget id.name
- The file name for the file to be loaded.TRUE
if operation successful FALSE
otherwise.public static java.lang.String getLocalFileName(java.lang.String name)
PROPATH
directories. The method will also adjust the case-sensitivity
so that in case of porting from a Windows installation to Linux files can be open even if
name
does not match the exact cases required by Linux filesystem.name
- The name of the file to be located in the client file system.PROPATH
directories with adjusted casings or
null
if the specified file cannot be found.public boolean is3D()
is3D
in interface ClientExports
public void set3D(boolean value)
set3D
in interface ClientExports
value
- The value to set.public boolean isKeep3DFillinBorder()
public void setKeep3DFillinBorder(boolean value)
value
- The value to set.public java.lang.Boolean moveToTop(int id)
moveToTop
in interface ClientExports
id
- widget idBoolean.TRUE
if operation was successful
null if no widget with given id is foundpublic java.lang.Boolean moveToBottom(int id)
moveToBottom
in interface ClientExports
id
- widget idBoolean.TRUE
if operation was successful
null if no widget with given id is foundpublic boolean setMousePointer(int id, byte[] data, java.lang.String ptrName)
setMousePointer
in interface ClientExports
id
- the widget iddata
- the pointer dataptrName
- the pointer nametrue
if operation was successfulpublic java.lang.Boolean setMousePointer(int id, MousePointer ptr)
setMousePointer
in interface ClientExports
id
- the widget idptr
- the new custom mouse pointer or null
true
if operation was successfulpublic boolean loadMousePointer(int id, java.lang.String fileName)
loadMousePointer
in interface ClientExports
id
- widget idfileName
- the file name of the pointer datatrue
if successful.public void setImmediateDisplay(boolean on)
setImmediateDisplay
in interface ClientExports
on
- The new state for SESSION:IMMEDIATE-DISPLAY attribute.public void setDataEntryReturn(boolean on)
setDataEntryReturn
in interface ClientExports
on
- The new state for SESSION:DATA-ENTRY-RETURN attribute.public static boolean isDataEntryReturn()
protected boolean setMousePtr(int id, MousePtrWrapper ptrWrapper)
id
- the widget idptrWrapper
- the mouse pointertrue
on successpublic boolean setWaitState(MousePointer ptr)
setWaitState
in interface ClientExports
ptr
- new mouse pointer or null
for canceltrue
if operation was successfulpublic boolean setWaitState(byte[] data)
setWaitState
in interface ClientExports
data
- new mouse pointer datatrue
if operation was successfulpublic boolean setWaitState(java.lang.String ptrName)
setWaitState
in interface ClientExports
ptrName
- the name of the file with new mouse pointer datatrue
if operation was successfulpublic boolean endFileDrop()
endFileDrop
in interface ClientExports
TRUE
in success, FALSE
otherwise.public int getNumDroppedFiles()
getNumDroppedFiles
in interface ClientExports
public java.lang.String getDroppedFile(int index)
getDroppedFile
in interface ClientExports
index
- 1-based number of the file name to get.public static void propagate(int windowId, int wid, MousePtrWrapper ptr)
windowId
- to level window idwid
- widgetIdptr
- mouse pointerpublic NativeRectangle getDisplayBounds(int windowId)
windowId
- A valid window id.public void requestEndCurrentWaitForEventLoop()
private MousePtrWrapper loadMousePointer(java.lang.String fileName)
fileName
- the file name of the pointer dataprivate MousePtrWrapper createMousePointer(byte[] data, java.lang.String ptrName)
data
- cusrsor dataptrName
- pointer namenull
public MousePtrWrapper createPtrWrapper(MousePointer ptr)
ptr
- source mouse pointerprivate boolean setWaitState(MousePtrWrapper ptr)
ptr
- new mouse pointer or null
for canceltrue
if operation was successfulprivate NativeRectangle getDisplayWorkArea(int windowId)
windowId
- A valid window id.private java.util.List<Frame> extractFrames(java.util.Deque<ThinClient.WaitForOp> waitForOps)
waitForOps
- The current operations.private boolean hasEnabledFrame()
true
if there is a frame exists.private void warnNoEnabledFrames(Window wnd)
wnd
- Target window to search frames.public void openURL(java.lang.String path)
openURL
in interface ClientExports
path
- The URL path to the target page or resource.public character getClipboardValue()
getClipboardValue
in interface ClientExports
public void setClipboardValue(java.lang.String value)
setClipboardValue
in interface ClientExports
value
- The string to be stored in the client's system clipboard.public java.util.Map<java.lang.Integer,ColorRgb> getThemeSystemPalette()
getThemeSystemPalette
in interface ClientExports