Class TextArea

    • Constructor Detail

      • TextArea

        public TextArea()
        Creates an empty text area.
      • TextArea

        protected TextArea​(Element element)
        This constructor may be used by subclasses to explicitly use an existing element. This element must be a <textarea> element.
        Parameters:
        element - the element to be used
    • Method Detail

      • wrap

        public static TextArea wrap​(Element element)
        Creates a TextArea widget that wraps an existing <textarea> 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
      • getCharacterWidth

        public int getCharacterWidth()
        Gets the requested width of the text box (this is not an exact value, as not all characters are created equal).
        Returns:
        the requested width, in characters
      • getCursorPos

        public int getCursorPos()
        Description copied from class: ValueBoxBase
        Gets the current position of the cursor (this also serves as the beginning of the text selection).
        Overrides:
        getCursorPos in class ValueBoxBase<java.lang.String>
        Returns:
        the cursor's position
      • getSelectionLength

        public int getSelectionLength()
        Description copied from class: ValueBoxBase
        Gets the length of the current text selection.
        Overrides:
        getSelectionLength in class ValueBoxBase<java.lang.String>
        Returns:
        the text selection length
      • getVisibleLines

        public int getVisibleLines()
        Gets the number of text lines that are visible.
        Returns:
        the number of visible lines
      • setCharacterWidth

        public void setCharacterWidth​(int width)
        Sets the requested width of the text box (this is not an exact value, as not all characters are created equal).
        Parameters:
        width - the requested width, in characters
      • setVisibleLines

        public void setVisibleLines​(int lines)
        Sets the number of text lines that are visible.
        Parameters:
        lines - the number of visible lines