|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.TextArea
public class TextArea
A component that allows a user to enter multiple lines of unformatted text.
Nested Class Summary | |
---|---|
static class |
TextArea.Paragraph
Class representing a paragraph of text. |
static interface |
TextArea.ParagraphListener
Paragraph listener interface. |
class |
TextArea.ParagraphSequence
Text area paragraph sequence. |
static class |
TextArea.ScrollDirection
Enum representing a scroll direction. |
static interface |
TextArea.Skin
Text area skin interface. |
static interface |
TextArea.TextBindMapping
Translates between text and context data during data binding. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Constructor Summary | |
---|---|
TextArea()
|
Method Summary | |
---|---|
void |
clear()
Clears any bound values in the component. |
void |
clearSelection()
Clears the selection. |
void |
copy()
Places any selected text on the clipboard. |
void |
cut()
Places any selected text on the clipboard and deletes it from the text input. |
char |
getCharacterAt(int index)
Returns the character at a given index. |
Bounds |
getCharacterBounds(int index)
|
int |
getCharacterCount()
Returns the number of characters in the text area, including line break characters. |
boolean |
getExpandTabs()
|
int |
getInsertionPoint(int x,
int y)
|
int |
getMaximumLength()
Returns the maximum length of the text area's text content. |
int |
getNextInsertionPoint(int x,
int from,
TextArea.ScrollDirection direction)
|
int |
getParagraphAt(int index)
Returns the index of the paragraph containing a given character index. |
TextArea.ParagraphSequence |
getParagraphs()
Returns the text area's paragraph sequence. |
int |
getRowAt(int index)
|
int |
getRowCount()
|
int |
getRowLength(int index)
|
int |
getRowOffset(int index)
|
String |
getSelectedText()
Returns the selected text. |
Span |
getSelection()
Returns a span representing the current selection. |
int |
getSelectionLength()
Returns the length of the selection. |
int |
getSelectionStart()
Returns the starting index of the selection. |
String |
getText()
Returns the text content of the text area. |
String |
getText(int beginIndex,
int endIndex)
Returns a portion of the text content of the text area. |
ListenerList<TextAreaBindingListener> |
getTextAreaBindingListeners()
|
ListenerList<TextAreaContentListener> |
getTextAreaContentListeners()
|
ListenerList<TextAreaListener> |
getTextAreaListeners()
|
ListenerList<TextAreaSelectionListener> |
getTextAreaSelectionListeners()
|
TextArea.TextBindMapping |
getTextBindMapping()
|
BindType |
getTextBindType()
|
String |
getTextKey()
Returns the text area's text key. |
void |
insertText(CharSequence text,
int index)
|
boolean |
isEditable()
Returns the text area's editable flag. |
void |
load(Object context)
Copies bound values from the bind context to the component. |
void |
paste()
Inserts text from the clipboard into the text input. |
void |
removeText(int index,
int count)
|
void |
selectAll()
Selects all text. |
void |
setEditable(boolean editable)
Sets the text area's editable flag. |
void |
setExpandTabs(boolean expandTabs)
Sets whether tab characters ( \t ) are expanded to
an appropriate number of spaces during setText(java.lang.String) and
insertText(java.lang.CharSequence, int) operations. |
void |
setMaximumLength(int maximumLength)
Sets the maximum length of the text area's text content. |
void |
setSelection(int selectionStart,
int selectionLength)
Sets the selection. |
void |
setSelection(Span selection)
Sets the selection. |
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
void |
setText(Reader textReader)
|
void |
setText(String text)
Sets the text content of the text area. |
void |
setText(URL textURL)
|
void |
setTextBindMapping(TextArea.TextBindMapping textBindMapping)
|
void |
setTextBindType(BindType textBindType)
|
void |
setTextKey(String textKey)
Sets the text area's text key. |
void |
store(Object context)
Copies bound values from the component to the bind context. |
void |
undo()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextArea()
Method Detail |
---|
protected void setSkin(Skin skin)
Component
setSkin
in class Component
skin
- The new skin.public String getText()
public String getText(int beginIndex, int endIndex)
beginIndex
- endIndex
-
public void setText(String text)
text
- public void setText(URL textURL) throws IOException
IOException
public void setText(Reader textReader) throws IOException
IOException
public void insertText(CharSequence text, int index)
public void removeText(int index, int count)
public TextArea.ParagraphSequence getParagraphs()
public int getParagraphAt(int index)
index
- public char getCharacterAt(int index)
index
- public int getCharacterCount()
public void cut()
public void copy()
public void paste()
public void undo()
public int getSelectionStart()
public int getSelectionLength()
public Span getSelection()
public void setSelection(int selectionStart, int selectionLength)
selectionStart
- The starting index of the selection.selectionLength
- The length of the selection.public final void setSelection(Span selection)
selection
- setSelection(int, int)
public void selectAll()
public void clearSelection()
public String getSelectedText()
public int getMaximumLength()
public void setMaximumLength(int maximumLength)
maximumLength
- The maximum length of the text area's text content.public boolean isEditable()
public void setEditable(boolean editable)
editable
- public String getTextKey()
public void setTextKey(String textKey)
textKey
- The text key, or null to clear the binding.public BindType getTextBindType()
public void setTextBindType(BindType textBindType)
public TextArea.TextBindMapping getTextBindMapping()
public void setTextBindMapping(TextArea.TextBindMapping textBindMapping)
public void load(Object context)
Component
load
in class Component
public void store(Object context)
Component
store
in class Component
public void clear()
Component
clear
in class Component
public boolean getExpandTabs()
public void setExpandTabs(boolean expandTabs)
\t
) are expanded to
an appropriate number of spaces during setText(java.lang.String)
and
insertText(java.lang.CharSequence, int)
operations.
expandTabs
- true
to replace tab characters
with space characters (depending on the
setting of the TextArea.Skin.getTabWidth()
value) or false
to leave tabs alone.
Note: this only affects tabs encountered during
program operations; tabs entered via the keyboard
by the user are always expanded, regardless of
this setting.public int getInsertionPoint(int x, int y)
public int getNextInsertionPoint(int x, int from, TextArea.ScrollDirection direction)
public int getRowAt(int index)
public int getRowOffset(int index)
public int getRowLength(int index)
public int getRowCount()
public Bounds getCharacterBounds(int index)
public ListenerList<TextAreaListener> getTextAreaListeners()
public ListenerList<TextAreaContentListener> getTextAreaContentListeners()
public ListenerList<TextAreaSelectionListener> getTextAreaSelectionListeners()
public ListenerList<TextAreaBindingListener> getTextAreaBindingListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |