public abstract class FillIn<O extends OutputManager<?>,C extends FillInConfig> extends LabeledDataContainer<O,C> implements EditableField, TextSelection
| Modifier and Type | Class and Description |
|---|---|
private class |
FillIn.LocalFocusListener
Some actions on focus hanging.
|
private class |
FillIn.NoOpScroller
A no-op implementation of the
EditScroller class. |
| Modifier and Type | Field and Description |
|---|---|
private BaseDataType |
appVar
Variable which is bound to this widget.
|
private boolean |
autoFormat
Track if format set explicitly or it is determined automatically.
|
private BaseDataType |
backupVar
Variable which stores our data value at the most recent enable.
|
protected BrowseColumn |
browseColumn
Parent browse column widget (if this fill-in is associated to a browse).
|
private double |
deltaWidth
Width delta for the header mode.
|
protected boolean |
drawLine
Draw line instead of last line of spaces if height is greater than 1.
|
protected EditScroller |
editScroller
The active scroller, used when the fill-in is editable.
|
private boolean |
forceLeft
Flag to force left alignment.
|
private boolean |
forceRight
Flag to force right alignment.
|
private boolean |
formatCheck
Hard format check state flag.
|
private boolean |
groupMode
TEXT clause mode state.
|
private boolean |
inAutoReturn
Processing the AUTO-RETURN event.
|
private boolean |
isDateBased
Keep track if the fill-in is date based.
|
protected boolean |
justActivated
Is field just activated by Tab.
|
private boolean |
keyApplied
Indicates whether the key has been applied to the next row (in group
mode).
|
protected EditScroller |
leftAnchor
The left edge anchor instance.
|
private static CentralLogger |
LOG
Logger
|
private int |
offsCursor
Cursor's offset in widget.
|
private boolean |
pendingNoZap
Indicates whether zap mode should be reset.
|
protected EditScroller |
rightAnchor
The right edge anchor instance.
|
protected boolean |
selected
Track 'selected' state.
|
private boolean |
skipActivation
Skip next activation event.
|
protected boolean |
skipCursorActivation
Skip cursor offset modification at the next activation event.
|
private boolean |
skipHelpAdjustment
Indicates whether we should skip help string adjustment on focus
gaining.
|
protected boolean |
useUnderline
Use underline attribute if enabled.
|
configlisteners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
FillIn(WidgetId id,
FillInConfig cfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
The last setup before editing starts.
|
void |
activate(boolean isEntry)
The last setup before editing starts.
|
int |
adjustCursor(int key,
int pos,
int max)
Allow the widget to adjust the cursor position, after a key was pressed.
|
protected void |
adjustEditScroller(int key,
boolean printable)
Adjust the edit scroller depending on the key being processed and the cursor location.
|
void |
afterConfigUpdate(C beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
protected java.lang.String |
blankScreenValue(DisplayFormat.Presentation curPres,
int fmtWidth)
Implements screen value blanking when BLANK modifier is used.
|
boolean |
canMovetoTop()
Flag indicating if this widget can be moved to top by a DISPLAY statement when WINDOW:KEEP-FRAME-Z-ORDER
flag is set.
|
void |
clear()
Clear input variable.
|
void |
clear(int selectionStart,
int selectionEnd)
Clear the specified selection from the input variable.
|
void |
clear(int selectionStart,
int selectionEnd,
boolean skipValueChanged)
Clear the specified selection from the input variable.
|
private void |
clearOverride()
Clear any temporary display override so that future drawing will be
based upon our standard data and format.
|
boolean |
clearWidget()
Clear widget state on CLEAR FRAME call for the parent frame.
|
private boolean |
completeEdit()
Completes edit and checks the result.
|
protected void |
copyState(Widget<?> w)
Copy the widget state from the specified source widget to this instance.
|
protected EditScroller |
createLeftAnchor()
Create the left-edge scroller.
|
protected EditScroller |
createRightAnchor()
Create the right-edge scroller.
|
Widget<O> |
currentFocus()
Returns this component directly because it is not an usual container and
have no child components.
|
Widget<O> |
defaultFocus()
Returns this component directly because it is not an usual container and
have no child components.
|
void |
display()
Fills data structures from variable's value.
|
void |
draw()
Draws text.
|
abstract void |
draw(Color color)
Actual drawing routine.
|
abstract void |
drawCaret()
Sets position of terminal's cursor which may or may not be the same as
the actual cursor location within the widget.
|
protected abstract NativeDimension |
editableNativeDimension()
Determine the portion of the widget's editable part.
|
protected void |
fireValueChanged()
Fire VALUE-CHANGED event.
|
boolean |
focusTraversable()
This component will receive an input focus when Tab or Shift-Tab is
pressed.
|
protected Browse |
getBrowse()
Get associated browse widget, if any.
|
DisplayFormat |
getCurrentFormat()
Get current active format.
|
int |
getCursorOffset()
Returns the cursor's offset from the left bound of the FillIn.
|
protected boolean |
getDataEntryReturn()
Convenience method to get access to SESSION:DATA-ENTRY-RETURN attribute.
|
java.lang.String |
getDrawText(char fill)
Obtains the text that should be rendered, handling any processing of a password field.
|
EditScroller |
getEditScroller()
Get the active
EditScroller. |
FillIn<O,C> |
getFirstInGroup()
Get reference to first widget in TEXT group.
|
java.lang.String |
getFormat()
Returns format definition string.
|
protected boolean |
getInsertMode()
Returns the insert mode state.
|
(package private) FillIn<O,C> |
getLastInGroup()
Get reference to last widget in the TEXT group.
|
int |
getLastOffset()
Returns the last valid cursor position from the left bound of the
FillIn.
|
private java.lang.String |
getLastWord(int limit)
Retrieve last word(s) from the buffer.
|
private java.lang.String |
getLeadingWords(int size)
Get leading words from the text buffer.
|
protected abstract int |
getNativeCursorPos()
Get the cursor position, in native units.
|
private Widget<O> |
getNextAfterGroup()
Get focus traversable widget which is right before the TEXT group in TAB
order.
|
private FillIn<O,C> |
getNextInGroup()
Get next component in TEXT clause group.
|
private int |
getNumLeadingSpaces()
Get number of leading spaces in the text before first non-space
character.
|
private Widget<O> |
getPrevBeforeGroup()
Get focus traversable widget which is right before the TEXT group in TAB
order.
|
private FillIn<O,C> |
getPrevInGroup()
Get previous component in TEXT clause group.
|
java.lang.String |
getScreenValue(boolean isInternal)
Get the screen representation of the current content, adjusted using the display format
(if the request is for the internal usage).
|
java.lang.String |
getText()
Get screen representation of the data.
|
java.lang.String |
getText(boolean isInternal)
Main worker routine for the
FillIn text accessor. |
Widget<?> |
getTriggerWidget(int evtCode,
boolean isKey)
This method returns the widget that should serve as the source of the triggered event.
|
protected int |
getValidCursorPos()
Get valid cursor position.
|
BaseDataType |
getValue()
Getting the BaseDataType object representing the current value.
|
BaseDataType |
getVariable()
Returns a reference to the variable of this widget.
|
double |
height()
Get widget height.
|
void |
initialize(WidgetId id,
C cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
void |
initSelection()
Resets the selection state for fill-in widget depending on the content.
|
private void |
insertWord(java.lang.String word,
boolean override)
Insert word at the beginning of the existing text.
|
private void |
internalActivation(FillIn<O,C> source)
Prepares fill-in for internal activation inside TEXT group.
|
void |
invalidateSelection()
Invalidate the text selection state.
|
boolean |
isAtField()
Get status of @ field flag.
|
protected boolean |
isCharacterInGui()
Check is we have character variable based fill-in in GUI mode.
|
boolean |
isDrawLine()
Get current state of the flag responsible for drawing line.
|
private boolean |
isFirstInGroup()
Check if component is first in the TEXT clause group.
|
boolean |
isFormatCheck()
Get current state of hard format check flag.
|
boolean |
isInAutoReturn()
Reports if this widget is currently processing AUTO-RETURN.
|
protected boolean |
isIntegerInGui()
Check if we have integer variable based fill-in in GUI mode.
|
private boolean |
isLastInGroup()
Check if component is last in the TEXT clause group.
|
protected boolean |
isLeftEdgeWidget()
Check if this instance is a left-edge component in the parent
container.
|
boolean |
isLinkedToBrowse()
|
boolean |
isPendingNoZap()
Returns
true if the zap mode is reset. |
boolean |
isRightAligned()
Get widget alignment policy.
|
boolean |
isRightAlignedInt()
Get internal widget alignment policy.
|
protected boolean |
isRightEdgeWidget()
Check if this instance is a right-edge component in the parent
container.
|
boolean |
isSelected()
Return
true if last draw(Color) was performed
with colors other than regular. |
boolean |
isSelectionValid()
Check if currently there is some selected text.
|
boolean |
isZapActive()
Determines whether auto-zap mode is active.
|
boolean |
isZapToBeApplied()
Determines whether auto-zap mode should be applied.
|
protected abstract int |
nativeHeight()
Retrieve the widget's height in native units.
|
protected abstract int |
nativeWidth()
Retrieve the widget's width in native units.
|
private boolean |
partOfGroup(Widget<O> comp)
Check if given widget is part of the same group as this widget.
|
void |
processKeyEvent(KeyInput ke)
Process KeyEvents for this widget.
|
private boolean |
refill(boolean insert,
int key)
Refill content after insertion or deletion of characters.
|
protected void |
refresh()
Refresh widget.
|
protected void |
refresh(boolean delayed)
Refresh widget.
|
void |
requestFocus()
Requesting the focus to the
FillIn. |
void |
reset()
Reset widget content.
|
void |
resetCaret()
Resets position of terminal's cursor.
|
protected void |
resetEditScroller()
Reset the edit scroller to the initial state.
|
boolean |
setAttrFormat(java.lang.String format)
Sets new display format.
|
void |
setBrowseColumn(BrowseColumn<O> browseColumn)
Link this fill-in with the
BrowseColumn widget. |
boolean |
setCursorOffset(int offset)
Sets the cursor's offset from the left bound of the FillIn.
|
boolean |
setCursorOffset(int offset,
boolean shouldInvalidateSelection)
Sets the cursor's offset from the left bound of the FillIn.
|
void |
setDataType(java.lang.String dataType)
Set type of the bound variable.
|
void |
setEnabled(boolean enable)
Enable/disable the widget for editing.
|
void |
setForceLeft(boolean forceLeft)
Sets the flag to force left alignment.
|
void |
setForceRight(boolean forceRight)
Sets the flag to force right alignment.
|
void |
setFormatCheck(boolean formatCheck)
Set format check flag.
|
void |
setHeaderParm(boolean drawLine,
double deltaWidth)
Control how to handle last row of the empty space during drawing.
|
void |
setInAutoReturn(boolean inAutoReturn)
Assigns the flag that this widget is currently processing AUTO-RETURN.
|
void |
setInsertMode(boolean mode)
Changes the insert mode state in the window and the data presentation.
|
void |
setPendingNoZap()
Reset the zap mode.
|
boolean |
setSelection(int start,
int end,
boolean upToContent)
Creates a new selection, eventually dropping the already existing one.
|
void |
setSize(double width,
double height)
Sets new widget's size.
|
void |
setSkipCursorActivation()
Make the fill-in skip cursor offset modification at the next activation event.
|
void |
setTextGroup(boolean enable)
Turn on/off text group (word wrap) mode.
|
void |
setUnderline(boolean underline)
Let widget to not use underline attribute (for use in
Browse widget). |
void |
setValue(BaseDataType value)
Sets the new variable value in the fill-in.
|
void |
setValue(BaseDataType value,
java.lang.String fmt)
Sets the new variable value in the fill-in.
|
private void |
setValueInt(BaseDataType value)
Set value and preserve state of the insert mode and cursor offset.
|
private static void |
setWindowInsertMode(boolean mode)
Changes the insert mode state in the window.
|
void |
setZapMode(boolean enable)
Set zap mode (when it is ON, next key-press will clear the data).
|
void |
setZapMode(boolean enable,
boolean force)
Set zap mode (when it is ON, next key-press will clear the data).
|
void |
silentActivation(Widget<O> source,
int newPos)
Skip next activation request.
|
protected java.lang.String |
toScreenValue(DisplayFormat.Presentation presentation)
Formats the data as a string that is ready for display.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
boolean |
update(boolean validate)
Updates variable's value with current field's content.
|
protected void |
updateCursorOffsetValue()
Update value of the cursor offset in fill-in configuration (so it can be synchronized with
server).
|
protected void |
updateSize()
Synchronizes the actual size with the default size.
|
protected void |
updateUIAfterValueSet()
Updates the UI state after display data structures are updated from the variable's value.
|
protected void |
updateZapState()
Update value of the zap mode in fill-in configuration (so it can be synchronized with
server).
|
boolean |
validateDisplayValue()
Performs format validation of the widget value being entered, i.e.
|
double |
width()
Get widget width.
|
config, defaultMousePtr, destroy, getColon, getColumnLabelText, getColumnMnemonic, getLabelInstance, getLabelText, getMnemonic, getTo, isForceLabel, isModified, isNoLabels, postprocessConfig, setColumnMnemonic, setHidden, setLabelInstance, setMnemonic, setNoLabels, setVisible, setWasVisible, wasVisibleminimumSize, requestFocusadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, cycleFocus, deregisterSelectedWidget, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInitialCursorPoseditPaste, isEditCanUndo, removeSelectedText, setSelectionacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, completeTrigger, dimension, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, widgetStateChanged, windowmouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleasedgetChangedValuecreateMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, updateMnemonicwidgetsAsListprivate static final CentralLogger LOG
private BaseDataType appVar
private BaseDataType backupVar
private int offsCursor
varDataPres is null.protected boolean justActivated
private boolean groupMode
protected boolean useUnderline
protected boolean drawLine
private double deltaWidth
private boolean autoFormat
protected BrowseColumn browseColumn
private boolean forceLeft
private boolean forceRight
private boolean skipActivation
protected boolean skipCursorActivation
private boolean inAutoReturn
private boolean skipHelpAdjustment
private boolean keyApplied
private boolean pendingNoZap
protected boolean selected
private boolean formatCheck
private boolean isDateBased
protected EditScroller editScroller
protected final EditScroller leftAnchor
protected final EditScroller rightAnchor
public FillIn(WidgetId id, FillInConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, C) to finish the widget initialization.
id - The widget's ID.cfg - Configuration data.protected abstract int nativeWidth()
protected abstract int nativeHeight()
public abstract void drawCaret()
drawCaret in interface Widget<O extends OutputManager<?>>drawCaret in class AbstractWidget<O extends OutputManager<?>>public abstract void draw(Color color)
color - Color for drawing.protected abstract int getNativeCursorPos()
protected abstract NativeDimension editableNativeDimension()
Usually, this follows the widget's format length.
public EditScroller getEditScroller()
EditScroller.public void initialize(WidgetId id, C cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<C extends FillInConfig>id - The widget's ID.cfg - The config used to initialize this widget.public void setEnabled(boolean enable)
RECALL key.setEnabled in interface Widget<O extends OutputManager<?>>setEnabled in class AbstractWidget<O extends OutputManager<?>>enable - true to enable editing in this widget.public void setUnderline(boolean underline)
Browse widget).underline - New state of the underlining.public void setForceLeft(boolean forceLeft)
forceLeft - true to force left alignment of this field.public void setForceRight(boolean forceRight)
forceRight - true to force right alignment of this field.public BaseDataType getValue()
getValue in interface DataContainerpublic void requestFocus()
FillIn.requestFocus in interface Widget<O extends OutputManager<?>>requestFocus in class FixedSizeContainer<O extends OutputManager<?>>public void activate()
Presentation.activate().
This method is automatically called on focusGained event.public void activate(boolean isEntry)
Presentation.activate().
This method is automatically called on focusGained event.isEntry - Flag indicating that an ENTRY event was generated prior to
this activate call.public void display()
public boolean update(boolean validate)
validate - Flag indicating if the format should be validated.true value may also mean
that FillIn contains unsupported (?????) value. It not
an error but variable's values isn't changed.public BaseDataType getVariable()
public java.lang.String getFormat()
public int getCursorOffset()
public int getLastOffset()
public boolean setCursorOffset(int offset,
boolean shouldInvalidateSelection)
setCursorOffset in class LabeledDataContainer<O extends OutputManager<?>,C extends FillInConfig>offset - The new offset value.shouldInvalidateSelection - The flag that shows if we should invalidate selection.true if the cursor offset is valid and set.public boolean setCursorOffset(int offset)
offset - The new offset value.true if the cursor offset is valid and set.public void resetCaret()
public void setZapMode(boolean enable)
setZapMode(boolean, boolean) for more information).enable - Zap mode. true for ON, false for OFF,public void setZapMode(boolean enable,
boolean force)
enable - Zap mode. true for ON, false for OFF,force - If true then set mode unconditionally, otherwise AUTO-RETURN processing
is honored (during AUTO-RETURN processing, zap mode should not be re-enabled in case
the focus is forced back to the widget, the 4GL doesn't zap then).public void draw()
DisplayFormat.Presentation instance is
rendered into screen value. Screen value is left justified or padded to
the right bound with spaces. Non first lines are filled with spaces. If
FillIn is focused then after rendering terminal's cursor is set to
appropriate position in the widget.draw in interface Widget<O extends OutputManager<?>>draw in class AbstractContainer<O extends OutputManager<?>>public java.lang.String getText()
getText in interface DataContainerpublic DisplayFormat getCurrentFormat()
public boolean isRightAligned()
isRightAligned in interface LabeledWidget<O extends OutputManager<?>>isRightAligned in class LabeledDataContainer<O extends OutputManager<?>,C extends FillInConfig>true if widget is formatted for right alignment.public boolean isRightAlignedInt()
true if widget is formatted for right alignment.public void processKeyEvent(KeyInput ke)
DisplayFormat and DisplayFormat.Presentation
instances. The latter instance may be absent but in this case only ZAP
and CLEAR actions are possible which will generate new
DisplayFormat.Presentation instance.
Here is the list of the handled keys and the corresponding actions:
KA_BACKSPACE. Erases one symbol before
the cursor position via deleteBack() method;
KA_BACK_TAB. Requests container to switch
input focus to the previous widget in the tab sequence;
KA_CLEAR. Calls
DisplayFormat.clear() method to make new
presentation;
KA_CURSOR_LEFT, KA_CURSOR_RIGHT.
Moves cursor by one position using moveCursorLeft()
and moveCursorRight() methods;
KA_CURSOR_UP, KA_CURSOR_DOWN.
Moves cursor one line or down
KA_DELETE_CHARACTER. Erases one symbol at the cursor
position via deleteCurrent() method;
KA_HOME
Moves cursor to the bound of FillIn using moveCursorBegin()
KA_INSERT_MODE.
Switches insert mode through Windowclass;
insert() or
overwrite() is called after this;
KA_RECALL
Restores the original contents of the FillIn;
KA_RETURN and KA_TAB.
Requests container to switch input focus to the next widget in
the tab sequence;
processKeyEvent in interface Widget<O extends OutputManager<?>>processKeyEvent in class AbstractContainer<O extends OutputManager<?>>ke - Key event structure.protected void fireValueChanged()
protected void refresh()
protected void refresh(boolean delayed)
delayed - Flag indicating if the drawing should be immediately or delayed.public void clear()
public void clear(int selectionStart,
int selectionEnd)
selectionStart - The start selection index (inclusive).selectionEnd - The end selection index (exclusive).public void clear(int selectionStart,
int selectionEnd,
boolean skipValueChanged)
selectionStart - The start selection index (inclusive).selectionEnd - The end selection index (exclusive).skipValueChanged - The flag indicating to bypass VALUE-CHANGED event emission for generated
KA_CLEAR event.public void reset()
public java.lang.String getText(boolean isInternal)
FillIn text accessor.isInternal - If this flag is set to true then alternative variable value is used
when available.public java.lang.String getDrawText(char fill)
fill - The character to use for password masking.public java.lang.String getScreenValue(boolean isInternal)
isInternal - If this flag is set to true then alternative variable value is used
when available.public void setInsertMode(boolean mode)
mode - New state.
false- overwrite mode,
true- insert mode.
protected boolean getDataEntryReturn()
public void setSize(double width,
double height)
setSize in interface Container<O extends OutputManager<?>>setSize in class AbstractContainer<O extends OutputManager<?>>width - The width component of the new size.height - The height component of the new size. Will be forced to 1
if width is positive and this value is less than
or equal to 0.public boolean focusTraversable()
focusTraversable in interface Widget<O extends OutputManager<?>>focusTraversable in class AbstractContainer<O extends OutputManager<?>>true if this component is enabled and visible.public Widget<O> currentFocus()
currentFocus in interface Container<O extends OutputManager<?>>currentFocus in class AbstractContainer<O extends OutputManager<?>>Container.currentFocus()public Widget<O> defaultFocus()
defaultFocus in interface Container<O extends OutputManager<?>>defaultFocus in class AbstractContainer<O extends OutputManager<?>>Container.defaultFocus()public boolean setAttrFormat(java.lang.String format)
throws ErrorConditionException
format - New display format definition string.true if format was changed and false
otherwise.ErrorConditionException - A format provided is invalid for the given variable object type.java.lang.IllegalArgumentException - The variable type is not supported.public void setValue(BaseDataType value)
setValue in interface DataContainervalue - New value for the screen buffer.public void setValue(BaseDataType value, java.lang.String fmt)
value - New value for the screen buffer. May be a temporary override
of the value with differently formatted data (it may even
be of a different data type).fmt - An optional format string to use with this value. This will
temporarily override the current format string. If specified
this will also cause the value to be detected as
a temporary override (even if the data type is the same as
the "permanent" data type). If null, then no
format string change is made and a temporary override of the
value will only be detected if the data types
differ.public boolean isAtField()
public void setHeaderParm(boolean drawLine,
double deltaWidth)
drawLine - If this parameter is true then last row of the
space occupied by widget is drawn as horizontal line.deltaWidth - Extra horizontal space which will be occupied by widget in
header mode.public boolean isDrawLine()
public double height()
height in interface Widget<O extends OutputManager<?>>height in class AbstractContainer<O extends OutputManager<?>>public double width()
width in interface Widget<O extends OutputManager<?>>width in class AbstractContainer<O extends OutputManager<?>>public java.lang.String toString()
AbstractWidgettoString in class AbstractWidget<O extends OutputManager<?>>Object.toString()public boolean clearWidget()
clearWidget in interface Widget<O extends OutputManager<?>>clearWidget in class AbstractWidget<O extends OutputManager<?>>true on success. false if CLEAR cannot be applied to this
widget, e.g. if it is static text.public void setTextGroup(boolean enable)
enable - New state of the word wrap mode.public void initSelection()
private void clearOverride()
protected void updateSize()
protected java.lang.String toScreenValue(DisplayFormat.Presentation presentation)
presentation - Data presentation to be rendered.public void setDataType(java.lang.String dataType)
throws ErrorConditionException,
java.lang.IllegalArgumentException
dataType - New data type name.ErrorConditionException - A format provided is invalid for the given variable object type.java.lang.IllegalArgumentException - The variable type is not supported.public void setBrowseColumn(BrowseColumn<O> browseColumn)
BrowseColumn widget.browseColumn - Parent browse column widget.public boolean isLinkedToBrowse()
protected Browse getBrowse()
null if there is no associated browse widget.public boolean isZapActive()
true if auto-zap mode is active.public boolean isZapToBeApplied()
true if auto-zap should be applied.public void setPendingNoZap()
public boolean isPendingNoZap()
true if the zap mode is reset.FillIn<O,C> getLastInGroup()
public FillIn<O,C> getFirstInGroup()
public boolean isSelected()
true if last draw(Color) was performed
with colors other than regular.public void setFormatCheck(boolean formatCheck)
formatCheck - the new value for formatCheck fieldpublic boolean isFormatCheck()
public void setInAutoReturn(boolean inAutoReturn)
inAutoReturn - true if the widget is processing AUTO-RETURN.public boolean isInAutoReturn()
true if the widget is processing AUTO-RETURN.public void setSkipCursorActivation()
public void silentActivation(Widget<O> source, int newPos)
source - Source widget which looses the focus.newPos - New cursor position.public int adjustCursor(int key,
int pos,
int max)
For FILL-INs, this will adjust the anchor on which the text is scrolling, if the cursor is set on the left or right edge.
This implementation will return the unchanged cursor position.
adjustCursor in interface EditableFieldkey - The pressed key.pos - The cursor position computed by the display format.max - The maximum cursor position.public boolean setSelection(int start,
int end,
boolean upToContent)
start - The offset of the start of the new selection.end - The offset of the end of the new selection.upToContent - If true, then in the case of invalid end,
make selection up to the content length.true is operation is successful.public void afterConfigUpdate(C beforeUpdate)
afterConfigUpdate in interface ConfigOwner<C extends FillInConfig>afterConfigUpdate in class LabeledDataContainer<O extends OutputManager<?>,C extends FillInConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public Widget<?> getTriggerWidget(int evtCode, boolean isKey)
null which prevents triggering of the
legacy event.If this fill-in is an editing fill-in for a browse column, that browse column widget is returned.
getTriggerWidget in interface Widget<O extends OutputManager<?>>evtCode - The event being triggered.isKey - Whether the event being triggered is a real key.public boolean validateDisplayValue()
validateDisplayValue in interface Widget<O extends OutputManager<?>>true if the display value conforms to the widgets format, false otherwise.public boolean canMovetoTop()
canMovetoTop in interface Widget<O extends OutputManager<?>>true.protected EditScroller createLeftAnchor()
no-op.protected EditScroller createRightAnchor()
no-op.protected boolean isRightEdgeWidget()
true if this component is a right-edge component
in the frame.protected boolean isLeftEdgeWidget()
true if this component is a left-edge component
in the frame.protected void resetEditScroller()
protected void adjustEditScroller(int key,
boolean printable)
key - The currently processed key.printable - Flag indicating if this is a printable key.protected int getValidCursorPos()
protected boolean getInsertMode()
false- overwrite mode,
true- insert mode.
public void invalidateSelection()
invalidateSelection in interface TextSelectionpublic boolean isSelectionValid()
isSelectionValid in interface TextSelectiontrue if text is selected.protected void copyState(Widget<?> w)
copyState in class LabeledDataContainer<O extends OutputManager<?>,C extends FillInConfig>w - The source widget which state needs to be copied.protected void updateCursorOffsetValue()
protected void updateZapState()
protected java.lang.String blankScreenValue(DisplayFormat.Presentation curPres, int fmtWidth)
curPres - Effective screen value.fmtWidth - Effective format width.protected boolean isCharacterInGui()
true if fill-in variable is CHARACTER running in GUI mode,
false otherwise.protected boolean isIntegerInGui()
true for ChUI mode.protected void updateUIAfterValueSet()
private boolean completeEdit()
private static void setWindowInsertMode(boolean mode)
mode - New state.
false- overwrite mode,
true- insert mode.
private boolean refill(boolean insert,
int key)
insert - Mode of operation - true means that character
was inserted.key - The character which will be inserted.true if after insertion operation cursor is
allowed to go to the next widget.private int getNumLeadingSpaces()
private void setValueInt(BaseDataType value)
value - New value for the fill-in.private void internalActivation(FillIn<O,C> source)
source - The widget which is about to trigger activation.private void insertWord(java.lang.String word,
boolean override)
word - The word to be inserted.override - Mark special case of override mode.private java.lang.String getLastWord(int limit)
0 then last word is retrieved.limit - The minimum length of the retrieved text.private java.lang.String getLeadingWords(int size)
size - Total size of the words should be less than specified size.private boolean partOfGroup(Widget<O> comp)
comp - The widget to check.true if widget belongs to the same group.private FillIn<O,C> getPrevInGroup()
private FillIn<O,C> getNextInGroup()
private boolean isFirstInGroup()
true if component is first in group.private boolean isLastInGroup()
true if component is last in group.private Widget<O> getPrevBeforeGroup()