Class TextBox

    • Constructor Detail

      • TextBox

        public TextBox()
        Creates an empty text box.
      • TextBox

        protected TextBox​(Element element)
        This constructor may be used by subclasses to explicitly use an existing element. This element must be an <input> element whose type is 'text'.
        Parameters:
        element - the element to be used
      • TextBox

        TextBox​(Element element,
                java.lang.String styleName)
    • Method Detail

      • wrap

        public static TextBox wrap​(Element element)
        Creates a TextBox widget that wraps an existing <input type='text'> element. This element must already be attached to the document. If the element is removed from the document, you must call RootPanel.detachNow(Widget).
        Parameters:
        element - the element to be wrapped
      • getMaxLength

        public int getMaxLength()
        Gets the maximum allowable length of the text box.
        Returns:
        the maximum length, in characters
      • getVisibleLength

        public int getVisibleLength()
        Gets the number of visible characters in the text box.
        Returns:
        the number of visible characters
      • setMaxLength

        public void setMaxLength​(int length)
        Sets the maximum allowable length of the text box.
        Parameters:
        length - the maximum length, in characters
      • setVisibleLength

        public void setVisibleLength​(int length)
        Sets the number of visible characters in the text box.
        Parameters:
        length - the number of visible characters