com.google.gwt.user.client.ui
Class TextArea
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.FocusWidget
com.google.gwt.user.client.ui.ValueBoxBase<java.lang.String>
com.google.gwt.user.client.ui.TextBoxBase
com.google.gwt.user.client.ui.TextArea
- All Implemented Interfaces:
- HasAllFocusHandlers, HasAllKeyHandlers, HasAllMouseHandlers, HasBlurHandlers, HasChangeHandlers, HasClickHandlers, HasFocusHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasValueChangeHandlers<java.lang.String>, HasHandlers, AutoDirectionHandler.Target, HasDirection, HasDirectionEstimator, EventListener, Focusable, HasFocus, HasName, HasText, HasValue<java.lang.String>, SourcesChangeEvents, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents, TakesValue<java.lang.String>
public class TextArea
- extends TextBoxBase
A text box that allows multiple lines of text to be entered.
CSS Style Rules
- .gwt-TextArea { primary style }
- .gwt-TextArea-readonly { dependent style set when the text area is read-only }
Example
|
Constructor Summary |
TextArea()
Creates an empty text area. |
|
Method Summary |
int |
getCharacterWidth()
Gets the requested width of the text box (this is not an exact value, as
not all characters are created equal). |
int |
getCursorPos()
Gets the current position of the cursor (this also serves as the beginning
of the text selection). |
int |
getSelectionLength()
Gets the length of the current text selection. |
int |
getVisibleLines()
Gets the number of text lines that are visible. |
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). |
void |
setVisibleLines(int lines)
Sets the number of text lines that are visible. |
static TextArea |
wrap(Element element)
Creates a TextArea widget that wraps an existing <textarea>
element. |
| Methods inherited from class com.google.gwt.user.client.ui.ValueBoxBase |
addChangeHandler, addChangeListener, addValueChangeHandler, cancelKey, getDirection, getDirectionEstimator, getName, getSelectedText, getText, getValueOrThrow, isReadOnly, onBrowserEvent, removeChangeListener, selectAll, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setKey, setName, setReadOnly, setSelectionRange, setText, setTextAlignment, setValue, setValue |
| Methods inherited from class com.google.gwt.user.client.ui.FocusWidget |
addBlurHandler, addClickHandler, addClickListener, addFocusHandler, addFocusListener, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, getTabIndex, isEnabled, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TextArea
public TextArea()
- Creates an empty text area.
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