public class LineEditor extends FillInGuiImpl
FillInGuiImpl. It will notify the listeners when the user
validates the content by pressing the RETURN key.
Other features that lacks in standard FillInGuiImpl:
- catches focus on click
- improved mouse selection
- validates changes on focus lost (Windows explorer specific, might need to make it togglable)
- notifies listeners for ENTER and ESCAPE key pressedLightweightTextWidget.TextLineSelection| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AC_CANCEL_EDIT
The action that is fired when ESCAPE key is pressed while editing the text.
|
static java.lang.String |
AC_TEXT_VALIDATED
The action that is fired when ENTER/RETURN key is pressed while editing the text.
|
private java.util.List<ActionListener> |
actionListeners
The list of active listeners.
|
private boolean |
validateOnFocusLost
The editor will emit fire
AC_TEXT_VALIDATED on focus lost only if this flag is set
to true (default value). |
disabledFore, disabledForeFixedColorbrowseColumn, drawLine, editScroller, justActivated, leftAnchor, rightAnchor, selected, skipCursorActivation, useUnderlineconfiglisteners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
LineEditor(WidgetId fid,
FillInConfig fcfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ActionListener listener)
Adds an
ActionListener to this editor. |
boolean |
isValidateOnFocusLost()
Checks if this editor will emit
AC_TEXT_VALIDATED action event when it loses focus. |
void |
mousePressed(java.awt.event.MouseEvent e)
Notification of a mouse pressed event occurred for this widget.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Notification of a mouse released event occurred for this widget.
|
void |
processKeyEvent(KeyInput key)
Process specific keys.
|
void |
removeListener(ActionListener listener)
Removes an
ActionListener from the list of listeners. |
void |
setValidateOnFocusLost(boolean valid)
Sets whether this editor will emit
AC_TEXT_VALIDATED action event when it loses
focus. |
activate, adjustEditScroller, afterConfigUpdate, blankScreenValue, convertToStreamable, createLeftAnchor, createMnemonic, createRightAnchor, display, draw, drawBorder, drawCaret, drawCaretInt, drawCursor, editableNativeDimension, focusAndSelect, getCursorColumnOffset, getCursorRowOffset, getFontCache, getInitialCursorPos, getInsertMode, getLastOffset, getNativeCursorPos, getScreenText, getScreenText, getScrollColumnOffset, getScrollRowOffset, getSelectedText, getTextLookAndFeel, getTextSelection, getValidCursorPos, initialize, initSelection, invalidateSelection, isAutoResize, isCharacterInGui, isDroppable, isIntegerInGui, isRMBEntrySupported, isTextSelectionDisplayed, isZapToBeApplied, mouseActions, mouseClicked, mouseDragged, mouseWheelMoved, moveCursorToLast, nativeHeight, nativeWidth, nativeWidth, processMnemonic, refresh, removeSelectedText, resetCaret, resetEditScroller, selectAll, setCursorOffset, setSelection, setSelection, showPopupMenu, supportsCustomMousePointer, updateCursorOffsetValue, updateSizeactivate, adjustCursor, canMovetoTop, clear, clear, clear, clearWidget, copyState, currentFocus, defaultFocus, draw, fireValueChanged, focusTraversable, getBrowse, getCurrentFormat, getCursorOffset, getDataEntryReturn, getDrawText, getEditScroller, getFirstInGroup, getFormat, getScreenValue, getText, getText, getTriggerWidget, getValue, getVariable, height, isAtField, isDrawLine, isFormatCheck, isInAutoReturn, isLeftEdgeWidget, isLinkedToBrowse, isPendingNoZap, isRightAligned, isRightAlignedInt, isRightEdgeWidget, isSelected, isSelectionValid, isZapActive, refresh, requestFocus, reset, setAttrFormat, setBrowseColumn, setCursorOffset, setDataType, setEnabled, setForceLeft, setForceRight, setFormatCheck, setHeaderParm, setInAutoReturn, setInsertMode, setPendingNoZap, setSize, setSkipCursorActivation, setTextGroup, setUnderline, setValue, setValue, setZapMode, setZapMode, silentActivation, toScreenValue, toString, update, updateSize, updateUIAfterValueSet, updateZapState, validateDisplayValue, widthconfig, 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, 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, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseEntered, mouseExited, mouseMoved, 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, 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, sync, topLevelWindow, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconvertToStreamableeditPaste, isEditCanUndoacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, completeTrigger, dimension, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getState, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, 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, 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, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, widgetStateChanged, windowgetChangedValuegetMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, isMnemonicSupported, updateMnemonicwidgetsAsListpublic static final java.lang.String AC_TEXT_VALIDATED
public static final java.lang.String AC_CANCEL_EDIT
private boolean validateOnFocusLost
AC_TEXT_VALIDATED on focus lost only if this flag is set
to true (default value).private java.util.List<ActionListener> actionListeners
public LineEditor(WidgetId fid, FillInConfig fcfg)
Call FillInGuiImpl.initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.FillInConfig) to finish the widget initialization.
fid - The widget's ID.fcfg - Configuration data.public void mousePressed(java.awt.event.MouseEvent e)
If the widget is not already focused, it forces the focus to it. After the focus was received, it computes the caret location, based on the mouse position over the widget's content.
mousePressed in interface java.awt.event.MouseListenermousePressed in class FillInGuiImple - The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
If the widget is not already focused, it forces the focus to it. After the focus was received, it computes the caret location, based on the mouse position over the widget's content.
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class FillInGuiImple - The mouse event.public void processKeyEvent(KeyInput key)
processKeyEvent in interface Widget<GuiOutputManager>processKeyEvent in class FillInGuiImplkey - Key event structure.public void addListener(ActionListener listener)
ActionListener to this editor. It will be notified when user confirms the
current text by typing RETURN.listener - The ActionListener to be added.public void removeListener(ActionListener listener)
ActionListener from the list of listeners. The listener will not be
notified any more when user confirms the current text by typing RETURN.listener - The ActionListener to be removed.public boolean isValidateOnFocusLost()
AC_TEXT_VALIDATED action event when it loses focus.validateOnFocusLost flag.public void setValidateOnFocusLost(boolean valid)
AC_TEXT_VALIDATED action event when it loses
focus.valid - new value for validateOnFocusLost flag.