Package tripleplay.ui

Class Field


public class Field extends TextWidget<Field>
  • Field Details

    • FULLTIME_NATIVE_FIELD

      public static final Style.Flag 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

      public static final Style.Flag AUTOCAPITALIZATION
      Controls the behavior of native text fields with respect to auto-capitalization on platforms that support it.
    • AUTOCORRECTION

      public static final Style.Flag AUTOCORRECTION
      Controls the behavior of native text fields with respect to auto-correction on platforms that support it.
    • SECURE_TEXT_ENTRY

      public static final Style.Flag 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

      public static final Style<Keyboard.TextType> TEXT_TYPE
      Sets the Keyboard.TextType in use by this Field.
    • VALIDATOR

      public static final Style<Field.Validator> VALIDATOR
      Sets the validator to use when censoring keypresses into native text fields.
      See Also:
    • TRANSFORMER

      public static final Style<Field.Transformer> TRANSFORMER
      Sets the transformner to use when updating native text fields while being typed into.
    • RETURN_KEY_LABEL

      public static final Style<String> 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

      public static final Style.Flag MULTILINE
      Sets the field to allow the return key to insert a line break in the text.
    • text

      public final react.Value<String> text
      The text displayed by this widget.
  • Constructor Details

    • Field

      public Field()
    • Field

      public Field(String initialText)
    • Field

      public Field(Styles styles)
    • Field

      public Field(String initialText, Styles styles)
  • Method Details

    • maxLength

      public static Style.Binding<Field.Validator> maxLength(int max)
      Creates a style binding for the given maximum length.
    • hasNative

      public static boolean hasNative()
      Checks if the platform has native text fields.
    • finishedEditing

      public react.SignalView<Boolean> finishedEditing()
      Returns a signal that is dispatched when text editing is complete.
    • setPopupLabel

      public Field setPopupLabel(String label)
      Configures the label to be displayed when text is requested via a popup.
    • updateNativeFieldBounds

      public Field 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

      public Field setVisible(boolean visible)
      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 class Element<Field>
    • exposeNativeField

      public NativeTextField exposeNativeField()
      Returns this field's native text field, if it has one, otherwise null.