|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WWebWidget
eu.webtoolkit.jwt.WInteractWidget
eu.webtoolkit.jwt.WFormWidget
eu.webtoolkit.jwt.WTextArea
public class WTextArea
A widget that provides a multi-line edit.
To act upon text changes, connect a slot to the WFormWidget#changed() signal. This signal is emitted when the user changed
the content, and subsequently removes the focus from the line edit.
To act upon editing, connect a slot to the
WInteractWidget#keyWentUp() signal.
At all times, the current content may be accessed with the
getText() method.
WTextArea is an inline widget.
The widget corresponds to an HTML <textarea> tag can be
styled using inline or external CSS as appropriate. The emptyText style can
be configured via .Wt-edit-emptyText.
WLineEdit| Field Summary |
|---|
| Fields inherited from class eu.webtoolkit.jwt.WWidget |
|---|
WT_GETPS_JS |
| Constructor Summary | |
|---|---|
WTextArea()
Creates a text area with empty content and optional parent. |
|
WTextArea(java.lang.String text)
Creates a text area with given content and optional parent. |
|
WTextArea(java.lang.String text,
WContainerWidget parent)
Creates a text area with given content and optional parent. |
|
WTextArea(WContainerWidget parent)
Creates a text area with empty content and optional parent. |
|
| Method Summary | |
|---|---|
protected int |
boxBorder(Orientation orientation)
Returns the widget's built-in border width. |
protected int |
boxPadding(Orientation orientation)
Returns the widget's built-in padding. |
int |
getColumns()
Returns the number of columns. |
int |
getCursorPosition()
Returns the current cursor position. |
int |
getRows()
Returns the number of rows. |
java.lang.String |
getSelectedText()
Returns the currently selected text. |
int |
getSelectionStart()
Returns the current selection start. |
java.lang.String |
getText()
Returns the current content. |
java.lang.String |
getValueText()
Returns the current value. |
boolean |
hasSelectedText()
Returns whether there is selected text. |
void |
setColumns(int columns)
Sets the number of columns. |
void |
setRows(int rows)
Sets the number of rows. |
void |
setText(java.lang.String text)
Sets the content of the text area. |
void |
setValueText(java.lang.String value)
Sets the current value. |
| Methods inherited from class eu.webtoolkit.jwt.WFormWidget |
|---|
blurred, changed, enableAjax, focussed, getEmptyText, getLabel, getTabIndex, getValidator, hasFocus, isReadOnly, propagateSetEnabled, refresh, remove, render, selected, setEmptyText, setEnabled, setFocus, setFocus, setHidden, setReadOnly, setTabIndex, setToolTip, setValidator, validate, validated |
| Methods inherited from class eu.webtoolkit.jwt.WInteractWidget |
|---|
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, touchEnded, touchMoved, touchStarted |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, createJavaScript, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, scheduleRender, scheduleRerender, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WTextArea(WContainerWidget parent)
public WTextArea()
Calls this((WContainerWidget)null)
public WTextArea(java.lang.String text,
WContainerWidget parent)
public WTextArea(java.lang.String text)
Calls this(text,
(WContainerWidget)null)
| Method Detail |
|---|
public void setColumns(int columns)
The default value is 20.
public void setRows(int rows)
The default value is 5.
public int getColumns()
setColumns(int columns)public int getRows()
setRows(int rows)public java.lang.String getText()
public void setText(java.lang.String text)
The default text is "".
public int getSelectionStart()
Returns -1 if there is no selected text.
hasSelectedText(),
getSelectedText()public java.lang.String getSelectedText()
Returns an empty string if there is currently no selected text.
hasSelectedText()public boolean hasSelectedText()
public int getCursorPosition()
Returns -1 if the widget does not have the focus.
public java.lang.String getValueText()
Returns getText().
getValueText in class WFormWidgetpublic void setValueText(java.lang.String value)
Calls setText().
setValueText in class WFormWidgetprotected int boxPadding(Orientation orientation)
WWidgetThis is used by the layout managers to correct for a built-in padding which interferes with setting a widget's width (or height) to 100%.
A layout manager needs to set the width to 100% only for form widgets (
WTextArea, WLineEdit, WComboBox, etc...).
Therefore, only for those widgets this needs to return the padding (the
default implementation returns 0).
For form widgets, the padding depends on the specific browser/platform combination, unless an explicit padding is set for the widget.
When setting an explicit padding for the widget using a style class, you will want to reimplement this method to return this padding in case you want to set the widget inside a layout manager.
boxPadding in class WWidgetWWidget.boxBorder(Orientation orientation)protected int boxBorder(Orientation orientation)
WWidgetThis is used by the layout managers to correct for a built-in border which interferes with setting a widget's width (or height) to 100%.
A layout manager needs to set the width to 100% only for form widgets (
WTextArea, WLineEdit, WComboBox, etc...).
Therefore, only for those widgets this needs to return the border width
(the default implementation returns 0).
For form widgets, the border width depends on the specific browser/platform combination, unless an explicit border is set for the widget.
When setting an explicit border for the widget using a style class, you will want to reimplement this method to return this border width, in case you want to set the widget inside a layout manager.
boxBorder in class WWidgetWWidget.boxPadding(Orientation orientation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||