Package tripleplay.ui
Class Field
Displays text which can be edited via the
Input.getText(playn.core.Keyboard.TextType, java.lang.String, java.lang.String)
popup.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Blocks keypresses for a native text field when the length is at a given maximum.final class
Exposes protected field information required for native fields.static interface
For native text fields, transforms text during typing.static interface
For native text fields, decides whether to block a keypress based on the proposed content of the field.Nested classes/interfaces inherited from class tripleplay.ui.Element
Element.Take
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Style.Flag
Controls the behavior of native text fields with respect to auto-capitalization on platforms that support it.static final Style.Flag
Controls the behavior of native text fields with respect to auto-correction on platforms that support it.static final Style.Flag
If on a platform that utilizes native fields and this is true, the native field is displayed whenever this Field is visible, and the native field is responsible for all text rendering.static final Style.Flag
Sets the field to allow the return key to insert a line break in the text.Sets the label used on the "return" key of the virtual keyboard on native keyboards.static final Style.Flag
Controls secure text entry on native text fields: typically this will mean dots or asterix displayed instead of the typed character.final react.Value<String>
The text displayed by this widget.static final Style<Keyboard.TextType>
Sets the Keyboard.TextType in use by this Field.static final Style<Field.Transformer>
Sets the transformner to use when updating native text fields while being typed into.static final Style<Field.Validator>
Sets the validator to use when censoring keypresses into native text fields. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns this field's native text field, if it has one, otherwise null.react.SignalView<Boolean>
Returns a signal that is dispatched when text editing is complete.void
focus()
Attempt to focus on this field, if it is backed by a native field.static boolean
Checks if the platform has native text fields.static Style.Binding<Field.Validator>
maxLength
(int max) Creates a style binding for the given maximum length.setPopupLabel
(String label) Configures the label to be displayed when text is requested via a popup.setVisible
(boolean visible) Configures whether this element is visible.Forcibly notify the NativeTextField backing this field that its screen position has changed.Methods inherited from class tripleplay.ui.Element
addStyles, addStyles, bindEnabled, bindVisible, bounds, constraint, enabledSlot, hierarchyChanged, isAdded, isEnabled, isShowing, isVisible, location, parent, setConstraint, setEnabled, setStyles, setStyles, size, styles, visibleSlot, x, y
-
Field Details
-
FULLTIME_NATIVE_FIELD
If on a platform that utilizes native fields and this is true, the native field is displayed whenever this Field is visible, and the native field is responsible for all text rendering. If false, the native field is only displayed while actively editing (after a user click). -
AUTOCAPITALIZATION
Controls the behavior of native text fields with respect to auto-capitalization on platforms that support it. -
AUTOCORRECTION
Controls the behavior of native text fields with respect to auto-correction on platforms that support it. -
SECURE_TEXT_ENTRY
Controls secure text entry on native text fields: typically this will mean dots or asterix displayed instead of the typed character. -
TEXT_TYPE
Sets the Keyboard.TextType in use by this Field. -
VALIDATOR
Sets the validator to use when censoring keypresses into native text fields.- See Also:
-
TRANSFORMER
Sets the transformner to use when updating native text fields while being typed into. -
RETURN_KEY_LABEL
Sets the label used on the "return" key of the virtual keyboard on native keyboards. Be aware that some platforms (such as iOS) have a limited number of options. The underlying native implementation is responsible for attempting to match this style, but may be unable to do so. Defaults to null (uses platform default). -
MULTILINE
Sets the field to allow the return key to insert a line break in the text. -
text
The text displayed by this widget.
-
-
Constructor Details
-
Field
public Field() -
Field
-
Field
-
Field
-
-
Method Details
-
maxLength
Creates a style binding for the given maximum length. -
hasNative
public static boolean hasNative()Checks if the platform has native text fields. -
finishedEditing
Returns a signal that is dispatched when text editing is complete. -
setPopupLabel
Configures the label to be displayed when text is requested via a popup. -
updateNativeFieldBounds
Forcibly notify the NativeTextField backing this field that its screen position has changed.- Returns:
- this for call chaining.
-
focus
public void focus()Attempt to focus on this field, if it is backed by a native field. If the platform uses a virtual keyboard, this will cause it slide up, just as though the use had tapped the field. For hardware keyboard, a blinking caret will appear in the field. -
setVisible
Description copied from class:Element
Configures whether this element is visible. An invisible element is not rendered and consumes no space in a group.- Overrides:
setVisible
in classElement<Field>
-
exposeNativeField
Returns this field's native text field, if it has one, otherwise null.
-