public class TextArea extends AbstractTextField
Component.ErrorEvent, Component.Event, Component.Focusable, Component.ListenerClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerSizeable.UnitHasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<V>DESIGN_ATTR_PLAIN_TEXTSIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS| Constructor and Description |
|---|
TextArea()
Constructs an empty TextArea.
|
TextArea(HasValue.ValueChangeListener<String> valueChangeListener)
Constructs a new
TextArea with a value change listener. |
TextArea(String caption)
Constructs an empty TextArea with given caption.
|
TextArea(String caption,
HasValue.ValueChangeListener<String> valueChangeListener)
Constructs a new
TextArea with the given caption and a value
change listener. |
TextArea(String caption,
String value)
Constructs a TextArea with given caption and value.
|
TextArea(String caption,
String value,
HasValue.ValueChangeListener<String> valueChangeListener)
Constructs a new
TextArea with the given caption, initial text
contents and a value change listener. |
| Modifier and Type | Method and Description |
|---|---|
int |
getRows()
Gets the number of rows in the text area.
|
protected TextAreaState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected TextAreaState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
boolean |
isWordWrap()
Tests if the text area is in word-wrap mode.
|
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Reads the component state from the given design.
|
void |
setRows(int rows)
Sets the number of rows in the text area.
|
void |
setWordWrap(boolean wordWrap)
Sets the text area's word-wrap mode on or off.
|
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Writes the component state to the given design.
|
addBlurListener, addFocusListener, doSetValue, getCursorPosition, getCustomAttributes, getEmptyValue, getMaxLength, getPlaceholder, getValue, getValueChangeMode, getValueChangeTimeout, selectAll, setCursorPosition, setMaxLength, setPlaceholder, setSelection, setValue, setValueChangeMode, setValueChangeTimeoutaddValueChangeListener, createValueChange, focus, getTabIndex, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setTabIndex, setValueaddContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefinedaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisibleaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdgetHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefinedclear, getOptionalValue, isEmptypublic TextArea()
public TextArea(String caption)
caption - the caption for the field.public TextArea(String caption, String value)
caption - the caption for the fieldvalue - the value for the field, not nullpublic TextArea(HasValue.ValueChangeListener<String> valueChangeListener)
TextArea with a value change listener.
The listener is called when the value of this TextArea is changed
either by the user or programmatically.
valueChangeListener - the value change listener, not nullpublic TextArea(String caption, HasValue.ValueChangeListener<String> valueChangeListener)
TextArea with the given caption and a value
change listener.
The listener is called when the value of this TextArea is changed
either by the user or programmatically.
caption - the caption for the fieldvalueChangeListener - the value change listener, not nullpublic TextArea(String caption, String value, HasValue.ValueChangeListener<String> valueChangeListener)
TextArea with the given caption, initial text
contents and a value change listener.
The listener is called when the value of this TextArea is changed
either by the user or programmatically.
caption - the caption for the fieldvalue - the value for the field, not nullvalueChangeListener - the value change listener, not nullprotected TextAreaState getState()
AbstractComponentgetState in class AbstractTextFieldprotected TextAreaState getState(boolean markAsDirty)
AbstractClientConnectorgetState in class AbstractTextFieldmarkAsDirty - true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()public void setRows(int rows)
rows - the number of rows for this text area.public int getRows()
public void setWordWrap(boolean wordWrap)
wordWrap - true to use word-wrap mode false
otherwise.public boolean isWordWrap()
true if the component is in word-wrap mode,
false if not.public void readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
ComponentThe component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
readDesign in interface ComponentreadDesign in class AbstractTextFielddesign - The element to obtain the state fromdesignContext - The DesignContext instance used for parsing the designpublic void writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
ComponentThe component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
writeDesign in interface ComponentwriteDesign in class AbstractTextFielddesign - The element to write the component state to. Any previous
attributes or child nodes are not cleared.designContext - The DesignContext instance used for writing the designCopyright © 2017 Vaadin Ltd. All rights reserved.