Class GeneratedVaadinTextField<R extends GeneratedVaadinTextField<R,​T>,​T>

    • Constructor Detail

      • GeneratedVaadinTextField

        public GeneratedVaadinTextField​(T initialValue,
                                        T defaultValue,
                                        Class<P> elementPropertyType,
                                        SerializableFunction<P,​T> presentationToModel,
                                        SerializableFunction<T,​P> modelToPresentation)
        Constructs a new GeneratedVaadinTextField component with the given arguments.
        Type Parameters:
        P - the property type
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        elementPropertyType - the type of the element property
        presentationToModel - a function that converts a string value to a model value
        modelToPresentation - a function that converts a model value to a string value
      • GeneratedVaadinTextField

        public GeneratedVaadinTextField​(T initialValue,
                                        T defaultValue,
                                        Class<P> elementPropertyType,
                                        SerializableFunction<P,​T> presentationToModel,
                                        SerializableFunction<T,​P> modelToPresentation,
                                        boolean isInitialValueOptional)
        Constructs a new GeneratedVaadinTextField component with the given arguments.

        If isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set.

        Type Parameters:
        P - the property type
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        elementPropertyType - the type of the element property
        presentationToModel - a function that converts a string value to a model value
        modelToPresentation - a function that converts a model value to a string value
        isInitialValueOptional - if isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set
      • GeneratedVaadinTextField

        public GeneratedVaadinTextField​(T initialValue,
                                        T defaultValue,
                                        boolean acceptNullValues)
        Constructs a new GeneratedVaadinTextField component with the given arguments.
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        acceptNullValues - whether null is accepted as a model value
      • GeneratedVaadinTextField

        public GeneratedVaadinTextField​(T initialValue,
                                        T defaultValue,
                                        boolean acceptNullValues,
                                        boolean isInitialValueOptional)
        Constructs a new GeneratedVaadinTextField component with the given arguments.

        If isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set.

        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        acceptNullValues - whether null is accepted as a model value
        isInitialValueOptional - if isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set
      • GeneratedVaadinTextField

        public GeneratedVaadinTextField​(T initialValue,
                                        T defaultValue,
                                        Class<P> elementPropertyType,
                                        SerializableBiFunction<R,​P,​T> presentationToModel,
                                        SerializableBiFunction<R,​T,​P> modelToPresentation)
        Constructs a new GeneratedVaadinTextField component with the given arguments.
        Type Parameters:
        P - the property type
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        elementPropertyType - the type of the element property
        presentationToModel - a function that accepts this component and a property value and returns a model value
        modelToPresentation - a function that accepts this component and a model value and returns a property value
      • GeneratedVaadinTextField

        public GeneratedVaadinTextField​(T initialValue,
                                        T defaultValue,
                                        Class<P> elementPropertyType,
                                        SerializableBiFunction<R,​P,​T> presentationToModel,
                                        SerializableBiFunction<R,​T,​P> modelToPresentation,
                                        boolean isInitialValueOptional)
        Constructs a new GeneratedVaadinTextField component with the given arguments.

        If isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set.

        Type Parameters:
        P - the property type
        Parameters:
        initialValue - the initial value to set to the value
        defaultValue - the default value to use if the value isn't defined
        elementPropertyType - the type of the element property
        presentationToModel - a function that accepts this component and a property value and returns a model value
        modelToPresentation - a function that accepts this component and a model value and returns a property value
        isInitialValueOptional - if isInitialValueOptional is true then the initial value is used only if element has no "value" property value, otherwise element "value" property is ignored and the initial value is set
      • GeneratedVaadinTextField

        public GeneratedVaadinTextField()
        Default constructor.
    • Method Detail

      • addThemeVariants

        public void addThemeVariants​(TextFieldVariant... variants)
        Adds theme variants to the component.
        Parameters:
        variants - theme variants to add
      • removeThemeVariants

        public void removeThemeVariants​(TextFieldVariant... variants)
        Removes theme variants from the component.
        Parameters:
        variants - theme variants to remove
      • isAutofocusBoolean

        protected boolean isAutofocusBoolean()

        Description copied from corresponding location in WebComponent:

        Specify that this control should have input focus when the page loads.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the autofocus property from the webcomponent
      • setAutofocus

        protected void setAutofocus​(boolean autofocus)

        Description copied from corresponding location in WebComponent:

        Specify that this control should have input focus when the page loads.

        Parameters:
        autofocus - the boolean value to set
      • isDisabledBoolean

        protected boolean isDisabledBoolean()

        Description copied from corresponding location in WebComponent:

        If true, the user cannot interact with this element.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the disabled property from the webcomponent
      • setDisabled

        protected void setDisabled​(boolean disabled)

        Description copied from corresponding location in WebComponent:

        If true, the user cannot interact with this element.

        Parameters:
        disabled - the boolean value to set
      • getAutocompleteString

        protected String getAutocompleteString()

        Description copied from corresponding location in WebComponent:

        Whether the value of the control can be automatically completed by the browser. List of available options at: https://developer.mozilla.org/en/docs /Web/HTML/Element/input#attr-autocomplete

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the autocomplete property from the webcomponent
      • setAutocomplete

        protected void setAutocomplete​(String autocomplete)

        Description copied from corresponding location in WebComponent:

        Whether the value of the control can be automatically completed by the browser. List of available options at: https://developer.mozilla.org/en/docs /Web/HTML/Element/input#attr-autocomplete

        Parameters:
        autocomplete - the String value to set
      • getAutocorrectString

        protected String getAutocorrectString()

        Description copied from corresponding location in WebComponent:

        This is a property supported by Safari that is used to control whether autocorrection should be enabled when the user is entering/editing the text. Possible values are: on: Enable autocorrection. off: Disable autocorrection.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the autocorrect property from the webcomponent
      • setAutocorrect

        protected void setAutocorrect​(String autocorrect)

        Description copied from corresponding location in WebComponent:

        This is a property supported by Safari that is used to control whether autocorrection should be enabled when the user is entering/editing the text. Possible values are: on: Enable autocorrection. off: Disable autocorrection.

        Parameters:
        autocorrect - the String value to set
      • getAutocapitalizeString

        protected String getAutocapitalizeString()

        Description copied from corresponding location in WebComponent:

        This is a property supported by Safari and Chrome that is used to control whether autocapitalization should be enabled when the user is entering/editing the text. Possible values are: characters: Characters capitalization. words: Words capitalization. sentences: Sentences capitalization. none: No capitalization.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the autocapitalize property from the webcomponent
      • setAutocapitalize

        protected void setAutocapitalize​(String autocapitalize)

        Description copied from corresponding location in WebComponent:

        This is a property supported by Safari and Chrome that is used to control whether autocapitalization should be enabled when the user is entering/editing the text. Possible values are: characters: Characters capitalization. words: Words capitalization. sentences: Sentences capitalization. none: No capitalization.

        Parameters:
        autocapitalize - the String value to set
      • isAutoselectBoolean

        protected boolean isAutoselectBoolean()

        Description copied from corresponding location in WebComponent:

        Specify that the value should be automatically selected when the field gains focus.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the autoselect property from the webcomponent
      • setAutoselect

        protected void setAutoselect​(boolean autoselect)

        Description copied from corresponding location in WebComponent:

        Specify that the value should be automatically selected when the field gains focus.

        Parameters:
        autoselect - the boolean value to set
      • isClearButtonVisibleBoolean

        protected boolean isClearButtonVisibleBoolean()

        Description copied from corresponding location in WebComponent:

        Set to true to display the clear icon which clears the input.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the clearButtonVisible property from the webcomponent
      • setClearButtonVisible

        protected void setClearButtonVisible​(boolean clearButtonVisible)

        Description copied from corresponding location in WebComponent:

        Set to true to display the clear icon which clears the input.

        Parameters:
        clearButtonVisible - the boolean value to set
      • getErrorMessageString

        protected String getErrorMessageString()

        Description copied from corresponding location in WebComponent:

        Error to show when the input value is invalid.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the errorMessage property from the webcomponent
      • setErrorMessage

        protected void setErrorMessage​(String errorMessage)

        Description copied from corresponding location in WebComponent:

        Error to show when the input value is invalid.

        Parameters:
        errorMessage - the String value to set
      • getLabelString

        protected String getLabelString()

        Description copied from corresponding location in WebComponent:

        String used for the label element.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the label property from the webcomponent
      • setLabel

        protected void setLabel​(String label)

        Description copied from corresponding location in WebComponent:

        String used for the label element.

        Parameters:
        label - the String value to set
      • getMaxlengthDouble

        protected double getMaxlengthDouble()

        Description copied from corresponding location in WebComponent:

        Maximum number of characters (in Unicode code points) that the user can enter.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the maxlength property from the webcomponent
      • setMaxlength

        protected void setMaxlength​(double maxlength)

        Description copied from corresponding location in WebComponent:

        Maximum number of characters (in Unicode code points) that the user can enter.

        Parameters:
        maxlength - the double value to set
      • getMinlengthDouble

        protected double getMinlengthDouble()

        Description copied from corresponding location in WebComponent:

        Minimum number of characters (in Unicode code points) that the user can enter.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the minlength property from the webcomponent
      • setMinlength

        protected void setMinlength​(double minlength)

        Description copied from corresponding location in WebComponent:

        Minimum number of characters (in Unicode code points) that the user can enter.

        Parameters:
        minlength - the double value to set
      • getNameString

        protected String getNameString()

        Description copied from corresponding location in WebComponent:

        The name of the control, which is submitted with the form data.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the name property from the webcomponent
      • setName

        protected void setName​(String name)

        Description copied from corresponding location in WebComponent:

        The name of the control, which is submitted with the form data.

        Parameters:
        name - the String value to set
      • getPlaceholderString

        protected String getPlaceholderString()

        Description copied from corresponding location in WebComponent:

        A hint to the user of what can be entered in the control.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the placeholder property from the webcomponent
      • setPlaceholder

        protected void setPlaceholder​(String placeholder)

        Description copied from corresponding location in WebComponent:

        A hint to the user of what can be entered in the control.

        Parameters:
        placeholder - the String value to set
      • isReadonlyBoolean

        protected boolean isReadonlyBoolean()

        Description copied from corresponding location in WebComponent:

        This attribute indicates that the user cannot modify the value of the control.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the readonly property from the webcomponent
      • setReadonly

        protected void setReadonly​(boolean readonly)

        Description copied from corresponding location in WebComponent:

        This attribute indicates that the user cannot modify the value of the control.

        Parameters:
        readonly - the boolean value to set
      • isRequiredBoolean

        protected boolean isRequiredBoolean()

        Description copied from corresponding location in WebComponent:

        Specifies that the user must fill in a value.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the required property from the webcomponent
      • setRequired

        protected void setRequired​(boolean required)

        Description copied from corresponding location in WebComponent:

        Specifies that the user must fill in a value.

        Parameters:
        required - the boolean value to set
      • isInvalidBoolean

        protected boolean isInvalidBoolean()

        Description copied from corresponding location in WebComponent:

        This property is set to true when the control value is invalid.

        Returns:
        the invalid property from the webcomponent
      • setInvalid

        protected void setInvalid​(boolean invalid)

        Description copied from corresponding location in WebComponent:

        This property is set to true when the control value is invalid.

        Parameters:
        invalid - the boolean value to set
      • isPreventInvalidInputBoolean

        protected boolean isPreventInvalidInputBoolean()

        Description copied from corresponding location in WebComponent:

        When set to true, user is prevented from typing a value that conflicts with the given pattern, maxlength or minlength properties.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the preventInvalidInput property from the webcomponent
      • setPreventInvalidInput

        protected void setPreventInvalidInput​(boolean preventInvalidInput)

        Description copied from corresponding location in WebComponent:

        When set to true, user is prevented from typing a value that conflicts with the given pattern, maxlength or minlength properties.

        Parameters:
        preventInvalidInput - the boolean value to set
      • getListString

        protected String getListString()

        Description copied from corresponding location in WebComponent:

        Identifies a list of pre-defined options to suggest to the user. The value must be the id of a element in the same document.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the list property from the webcomponent
      • setList

        protected void setList​(String list)

        Description copied from corresponding location in WebComponent:

        Identifies a list of pre-defined options to suggest to the user. The value must be the id of a element in the same document.

        Parameters:
        list - the String value to set
      • getPatternString

        protected String getPatternString()

        Description copied from corresponding location in WebComponent:

        A regular expression that the value is checked against. The pattern must match the entire value, not just some subset.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the pattern property from the webcomponent
      • setPattern

        protected void setPattern​(String pattern)

        Description copied from corresponding location in WebComponent:

        A regular expression that the value is checked against. The pattern must match the entire value, not just some subset.

        Parameters:
        pattern - the String value to set
      • getTitleString

        protected String getTitleString()

        Description copied from corresponding location in WebComponent:

        Message to show to the user when validation fails.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:
        the title property from the webcomponent
      • setTitle

        protected void setTitle​(String title)

        Description copied from corresponding location in WebComponent:

        The text usually displayed in a tooltip popup when the mouse is over the field.

        Parameters:
        title - the String value to set
      • checkValidity

        @NotSupported
        protected void checkValidity()

        Description copied from corresponding location in WebComponent:

        Returns true if the current input value satisfies all constraints (if any)

        This function is not supported by Flow because it returns a boolean. Functions with return types different than void are not supported at this moment.

      • validate

        @NotSupported
        protected void validate()

        Description copied from corresponding location in WebComponent:

        Returns true if value is valid. <iron-form> uses this to check the validity or all its elements.

        This function is not supported by Flow because it returns a boolean. Functions with return types different than void are not supported at this moment.

      • remove

        protected void remove​(Component... components)
        Removes the given child components from this component.
        Parameters:
        components - The components to remove.
        Throws:
        IllegalArgumentException - if any of the components is not a child of this component.
      • removeAll

        protected void removeAll()
        Removes all contents from this component, this includes child components, text content as well as child elements that have been added directly to this component using the Element API.