T
- The data input widget.public class InputDialog<T extends AbstractWidget<GuiOutputManager> & DataContainer> extends FrameGuiImpl implements ActionListener, IsModal, Container<GuiOutputManager>
Modifier and Type | Class and Description |
---|---|
private class |
InputDialog.TextDialogLayout
The manager that does the layout of the widgets of this frame.
|
FrameGuiImpl.GuiFrameScrollContainer
Frame.FrameScrollContainer
Modifier and Type | Field and Description |
---|---|
private boolean |
accepted
Flag that turns to
true only if the user closed the dialog by accepting it. |
private static int |
BUTTON_WIDTH
Width of a button in pixels.
|
private ButtonGuiImpl |
cancelButton
Cancel button.
|
private CoordinatesConversion |
cc
Cached coordinates.
|
private boolean |
dismissed
Flag which tracks if the dialog is active.
|
private static int |
ELEMENT_HEIGHT
Height of an element in pixels.
|
private int |
fieldWidth
Width of the input field in pixels.
|
private GuiDriver |
gd
Cached driver.
|
private T |
inputField
Input field.
|
private static java.util.logging.Logger |
LOG
Logger.
|
private ButtonGuiImpl |
okButton
OK button.
|
private static int |
SPACING
Distance between elements in pixels.
|
chooseHandler, configUpdateActive, contentPane, currentStatement, cursor, down, downBody, EXTRA_DLG_PIXELS, frameScroll, headersHeight, headersOutput, lastRow, needPause, nonbody, originalHeightChars, paintable, positionChanged, redirected, savedTabOrder, sizeChanged, skipMoveToTop, startRow, touched, trailingSkips, underline, underlinedRow, verticalStepBoxed
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
InputDialog(WidgetId id,
FrameConfig cfg)
Special constructor used to restore component using given configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addWidget(Widget<GuiOutputManager> widget)
Adds new widget to the container.
|
static InputDialog<ComboBoxGuiImpl> |
createComboBoxInstance(int fieldWidth,
java.lang.String fieldFormat,
java.lang.String initialValue,
java.lang.String title,
ControlSetItem[] items)
Factory method.
|
private static FrameConfig |
createDialogConfig(WidgetId id,
java.lang.String title)
Provide a base configuration for the input dialog.
|
static InputDialog<LineEditor> |
createTextInstance(int fieldWidth,
java.lang.String fieldFormat,
java.lang.String initialValue,
java.lang.String title)
Factory method.
|
private void |
dismiss(boolean accepted)
Close and destroy the dialog.
|
private int |
getFrameHeight()
Get frame height.
|
private int |
getFrameWidth()
Get frame width.
|
java.lang.String |
getValue()
Get value of the input field.
|
void |
initialize(WidgetId id,
FrameConfig cfg,
int fieldWidth,
java.lang.String fieldFormat,
java.lang.String initialValue,
java.util.function.Supplier<T> supplier)
Initializes the widget.
|
boolean |
isAccepted()
Checks whether the user accepted the selection from the dialog.
|
boolean |
isDismissed()
Returns
true when the modal UI element has dismissed (finished its modal
input). |
void |
onAction(ActionEvent event)
This method is invoked when an action event is generated.
|
activateDirectManipulation, adjustMinSize, adjustWidth, afterConfigUpdate, calculateHeight, calculateHeightDelta, captionHeight, compareColors, convertToStreamable, createMouseHoverAction, createScrollContainer, deactivateDirectManipulation, defaultFocus, destroy, doLayoutWorker, draw, drawDownFrame, drawUnderline, findMouseSource, frameContentBounds, getColorResolver, getCustomMousePointer, getDialogDecorationCharSize, getDynamicLayout, getFrameBgColor, getFrameFgColor, getLabelHeight, getLabelWidth, getMaxFrameSize, getMousePosition, getPortableMouseEventCoordinates, getResizeRectangle, getRowDelta, getTitleHeight, hasBox, initialize, isDirectManipulationRequired, isDroppable, location, mouseActions, moveToTop, moveToTop, onFromVisibleToHidden, physicalLocation, processCancelButton, processDefaultButton, processDefaultButton, processDirectManipulationEvent, realizeFrame, resetColors, setFocus, setHidden, setOuterSize, setVisible, supportsCustomMousePointer
adjustDown, adjustDown, allFramesVisible, applyConfig, arrangeToInteract, arrangeToStream, attachToWindow, calcDefaultFocus, calculateFrameRect, calculateWidthDelta, canSetColumn, canSetHeightChars, canSetRow, canSetWidthChars, clear, clearCurrent, clearWorker, clipping, config, copyState, currentFocus, detach, doLayout, doLayout, draw, enableAllWidgets, enabledWidgetsByList, enterChoose, fixNonBody, forceBox, getBorderBottomChars, getBorderLeftChars, getBorderRightChars, getBorderTopChars, getChooseData, getChooseHelp, getContentPane, getCursor, getDown, getDownConfigs, getField, getField, getFirstEnabledWidget, getFirstFocusableId, getFirstFocusableId, getFixedHeight, getFocusId, getFrameRegion, getFrameValue, getFrameValue, getInnerSize, getIterationHeight, getIterationIds, getLeadingSkipSize, getMinHeight, getNextEnabledWidget, getOriginalHeightChars, getRootFrame, getSavedDimension, getScopeNesting, getSelectedField, getSelectedWidget, getStreamId, getTrailingSkipSize, getValues, getZOrderClass, hasAnyEnabled, hasDefaultButton, hasEditors, hasEnabled, hasHeaders, hasSavedState, hasTitle, initializeWidget, isActive, isAlive, isAllClear, isAttrSpace, isAutoplacing, isCanHide, isCanHideOthers, isCanWipeScreen, isChanged, isChooseActive, isConfigUpdateActive, isCurrentTouched, isDelayedRepaint, isDialog, isDown, isDownCalculated, isDynamic, isExplicitHide, isFixedWidth, isFocusAttractor, isFocusReset, isForcedRefresh, isForcePause, isForceWipeScreen, isHonorNextConditionalDown, isInChoose, isInScope, isInternalGo, isLabels, isLastWidget, isLastWidget, isLeftMostWidget, isNeedPause, isNeedReset, isNoHide, isPendingFixedDown, isPendingUnderline, isPlacedForRedirected, isRedirected, isRightMostWidget, isRootFrame, isSideLabels, isStreamed, isThreeD, isTopFrame, isViewed, isVisibilityChanged, isWithHeaders, leaveChoose, markAsStreamed, markChanged, moveAboveWidget, moveBelowWidget, moveCursor, moveToBottom, moveWidgetBeforeTabItem, needClearRow, notifyClose, notifyPageBreak, notifyUnbind, placeAtTop, placed, placeToWindow, placeToWindow, postponePlace, postponeSetVisible, postprocess, postprocessConfig, prepareIteration, preprocess, preventFocusWhenMouseDownEventDefined, previousFocus, processFrameMnemonic, processKeyEvent, rearrangeEditors, relayout, relocateComponent, repaint, repaintCurrent, repaintUninitialized, requestFocus, reset, resetAll, resetAutoplacing, resetChanged, resetForcedRefresh, resetNeedPause, resetPlacementQuirk, resetWidget, resolveWidgetId, restore, restoreEditors, restoreInitialTabOrder, scroll, setAlive, setAllClear, setAttrSpace, setBodyVisible, setBox, setCanHide, setCanHideOthers, setCanWipeScreen, setChooseAt, setColumns, setCurrentStatement, setCursor, setDelayedRepaint, setDown, setDynCol, setDynRow, setExplicitHide, setFocusAttractor, setFocusId, setFocusReset, setForcePause, setForceWipeScreen, setFormatCheck, setHeight, setHonorNextConditionalDown, setInnerSize, setInScope, setLabels, setLayout, setNeedPause, setNeedPauseDirect, setNeedReset, setNonBodyVisible, setPaintable, setPendingFixedDown, setPendingUnderline, setProtected, setRedirected, setSavedDimension, setScopeNesting, setSensitive, setSize, setSkipMoveToTop, setState, setTabItemList, setTabItemList, setValue, setValue, setViewed, setVisibilityChanged, setWidth, shortName, switchLabelsEmptyMode, thisAndAncestryVisible, toString, touchBody, touchRow, unbind, underline, updateInnerSize, view
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipRectangle, currentFocus, cycleFocus, deregisterSelectedWidget, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, firstFocus, focus, focusTraversable, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, reflectAncestorChange, reflectLocationChange, registerSelectedWidget, remove, removeContainerStateListener, replace, requestFocus, requestFocus, setFocusInt, setIgnoreFocus, setInsets, setSize, startSizeChange, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width
_setHidden, _setVisible, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, hasFocus, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationCapable, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isTotallyObscured, isVisible, isVisible, manageSystemActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, prepParentLocation, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, showPopupMenu, sync, topLevelWindow, translate, unregisterWidgetStateListener, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, add, add, addContainerStateListener, childrenLocation, clipping, currentFocus, currentFocus, defaultFocus, detach, doLayout, endSizeChange, firstFocus, focus, get, getClipRect, getIgnoreFocus, getLayout, getTabItemList, hasFocusable, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, parentOf, prevFocus, remove, removeContainerStateListener, replace, setFocus, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, widgets, widgetsAsList, widgetsAsList
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, config, defaultMousePtr, destroy, dimension, displayPhysicalLocation, draw, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, height, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isDirectManipulable, isDirectManipulationActive, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, 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, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetStateListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetStateListener, validateDisplayValue, widgetStateChanged, width, window
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
convertToStreamable
private static final java.util.logging.Logger LOG
private static int SPACING
private static int ELEMENT_HEIGHT
private static int BUTTON_WIDTH
private int fieldWidth
private GuiDriver gd
private CoordinatesConversion cc
private boolean accepted
true
only if the user closed the dialog by accepting it.private ButtonGuiImpl okButton
private ButtonGuiImpl cancelButton
private T extends AbstractWidget<GuiOutputManager> & DataContainer inputField
private boolean dismissed
public InputDialog(WidgetId id, FrameConfig cfg)
Call initialize(com.goldencode.p2j.ui.WidgetId, com.goldencode.p2j.ui.FrameConfig, int, java.lang.String, java.lang.String, java.util.function.Supplier<T>)
to finish the widget initialization.
id
- The widget's ID.cfg
- Configuration data.public static InputDialog<LineEditor> createTextInstance(int fieldWidth, java.lang.String fieldFormat, java.lang.String initialValue, java.lang.String title)
InputDialog
dialog containting a line editor.fieldWidth
- Width of the input field in pixels.fieldFormat
- 4GL format of the text input field, e.g. "x(30)".initialValue
- Initial value for the input field.title
- Dialog title.InputDialog
configured as requested.public static InputDialog<ComboBoxGuiImpl> createComboBoxInstance(int fieldWidth, java.lang.String fieldFormat, java.lang.String initialValue, java.lang.String title, ControlSetItem[] items)
InputDialog
dialog containing a combo box.fieldWidth
- Width of the input field in pixels.fieldFormat
- 4GL format of the text input field, e.g. "x(30)".initialValue
- Initial value for the input field.title
- Dialog title.items
- A list of items to populate the input combo box.InputDialog
configured as requested.private static FrameConfig createDialogConfig(WidgetId id, java.lang.String title)
id
- The id of the dialog frame.title
- The title of the dialog frame.public boolean isAccepted()
true
if the dialog was accepted, and false
if the dialog was not
yet displayed or it was rejected by user.public boolean isDismissed()
true
when the modal UI element has dismissed (finished its modal
input).isDismissed
in interface IsModal
public java.lang.String getValue()
public void initialize(WidgetId id, FrameConfig cfg, int fieldWidth, java.lang.String fieldFormat, java.lang.String initialValue, java.util.function.Supplier<T> supplier)
id
- The widget's ID.cfg
- The config used to initialize this widget.fieldWidth
- Width of the input field in pixels.fieldFormat
- 4GL format of the text input field, e.g. "x(30)".initialValue
- Initial value for the input field.supplier
- Function which supplies the input widget.public void onAction(ActionEvent event)
onAction
in interface ActionListener
event
- Event which triggered this call.public void addWidget(Widget<GuiOutputManager> widget)
addWidget
in class Frame<GuiOutputManager>
widget
- The new widget to be added to the container.private int getFrameWidth()
private int getFrameHeight()
private void dismiss(boolean accepted)
accepted
- true
if the dialog was accepted or false
if the dialog was rejected
by user.