Class WPasswordEdit


  • public class WPasswordEdit
    extends WLineEdit
    A password edit.

    A password edit is a line edit where the character are hidden.

    The widget corresponds to the HTML <input type="password"> tag.

    • Constructor Detail

      • WPasswordEdit

        public WPasswordEdit​(WContainerWidget parentContainer)
        Creates a password edit with empty content.
      • WPasswordEdit

        public WPasswordEdit​(java.lang.String content,
                             WContainerWidget parentContainer)
        Creates a password edit with given content.
    • Method Detail

      • setMaxLength

        public void setMaxLength​(int length)
        Description copied from class: WLineEdit
        Specifies the maximum length of text that can be entered.

        A value <= 0 indicates that there is no limit.

        The default value is -1.

        Overrides:
        setMaxLength in class WLineEdit
      • setNativeControl

        public void setNativeControl​(boolean nativeControl)
        Changes whether a native HTML5 control is used.

        When enabled the browser's native attribute for password input (<input type="password">) will be used instead of a validator.

        This option is set to false by default. @see WPasswordEdit#isNativeControl()

      • setMinLength

        public void setMinLength​(int length)
        Specifies the minimum length of text that can be entered.

        The default value is 0.

      • getMinLength

        public int getMinLength()
        Returns the minimum length of text that can be entered.

        See Also:
        setMinLength(int length)
      • setRequired

        public void setRequired​(boolean required)
        Specifies if the password is required.

        If true, the password cannot be empty.

        The default value is true.

      • setPattern

        public void setPattern​(java.lang.String newPattern)
        Specifies the pattern that the password must match.

        The default value is "".

      • setInvalidTooLongText

        public void setInvalidTooLongText​(java.lang.CharSequence text)
        Sets the message to display when the password is too long.

        The default value is "Password too long".

      • setInvalidTooShortText

        public void setInvalidTooShortText​(java.lang.CharSequence text)
        Sets the message to display when the password is too small.

        The default value is "Password too small".

      • setInvalidNoMatchText

        public void setInvalidNoMatchText​(java.lang.CharSequence text)
        Sets the message to display when the password does not match the pattern.

        The default value is "Invalid input".

      • setInvalidBlankText

        public void setInvalidBlankText​(java.lang.CharSequence text)
        Sets the message to display when the password is empty and required.

        The default value is "This field cannot be empty".

      • getType

        protected java.lang.String getType()
        Overrides:
        getType in class WLineEdit