Class ValueBox<T>

    • Constructor Detail

      • ValueBox

        protected ValueBox​(Element element,
                           Renderer<T> renderer,
                           Parser<T> parser)
        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
    • Method Detail

      • wrap

        public static <T> ValueBox<T> wrap​(Element element,
                                           Renderer<T> renderer,
                                           Parser<T> parser)
        Creates a ValueBox 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.
        Returns:
        the maximum length, in characters
      • getVisibleLength

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

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

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