|
||||||||||
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.TextInput
public class TextInput
A component that allows a user to enter a single line of unformatted text.
Nested Class Summary | |
---|---|
static interface |
TextInput.Skin
Text input skin interface. |
static interface |
TextInput.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 |
Field Summary | |
---|---|
static int |
DEFAULT_TEXT_SIZE
|
Constructor Summary | |
---|---|
TextInput()
|
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 input. |
CharSequence |
getCharacters()
Returns a character sequence representing the text input's content. |
int |
getInsertionPoint(int x)
|
int |
getMaximumLength()
Returns the maximum length of the text input's text content. |
String |
getPrompt()
Returns the text input's prompt. |
String |
getSelectedText()
Returns the currently 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 input. |
String |
getText(int beginIndex,
int endIndex)
Returns a portion of the text content of the text input. |
TextInput.TextBindMapping |
getTextBindMapping()
|
BindType |
getTextBindType()
|
ListenerList<TextInputBindingListener> |
getTextInputBindingListeners()
Returns the text input binding listener list. |
ListenerList<TextInputContentListener> |
getTextInputContentListeners()
Returns the text input text listener list. |
ListenerList<TextInputListener> |
getTextInputListeners()
Returns the text input listener list. |
ListenerList<TextInputSelectionListener> |
getTextInputSelectionListeners()
Returns the text input selection listener list. |
String |
getTextKey()
Returns the text input's text key. |
int |
getTextSize()
Returns the text size. |
Validator |
getValidator()
Gets the validator associated with this text input. |
void |
insertText(CharSequence text,
int index)
|
boolean |
isEditable()
Returns the text area's editable flag. |
boolean |
isPassword()
Returns the password flag. |
boolean |
isStrictValidation()
Returns the text input's strict validation flag. |
boolean |
isTextValid()
Reports whether this text input's text is currently valid as defined by its validator. |
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 |
setMaximumLength(int maximumLength)
Sets the maximum length of the text input's text content. |
void |
setPassword(boolean password)
Sets or clears the password flag. |
void |
setPrompt(String prompt)
Sets the text input's prompt. |
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 |
setStrictValidation(boolean strictValidation)
Sets the text input's strict validation flag. |
void |
setText(String text)
|
void |
setTextBindMapping(TextInput.TextBindMapping textBindMapping)
|
void |
setTextBindType(BindType textBindType)
|
void |
setTextKey(String textKey)
Sets the text input's text key. |
void |
setTextSize(int textSize)
Sets the text size. |
void |
setValidator(Validator validator)
Sets the validator associated with this text input. |
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 |
Field Detail |
---|
public static final int DEFAULT_TEXT_SIZE
Constructor Detail |
---|
public TextInput()
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)
public void insertText(CharSequence text, int index)
public void removeText(int index, int count)
public CharSequence getCharacters()
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 getTextSize()
public void setTextSize(int textSize)
textSize
- The number of characters to display in the text input.public int getMaximumLength()
public void setMaximumLength(int maximumLength)
maximumLength
- The maximum length of the text input's text content.public boolean isPassword()
public void setPassword(boolean password)
password
- true if this is a password text input; false,
otherwise.public String getPrompt()
public void setPrompt(String prompt)
prompt
- The prompt text, or null for no prompt.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 TextInput.TextBindMapping getTextBindMapping()
public void setTextBindMapping(TextInput.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 int getInsertionPoint(int x)
public Bounds getCharacterBounds(int index)
public Validator getValidator()
public void setValidator(Validator validator)
validator
- The validator to use, or null to use no validator.public boolean isStrictValidation()
public void setStrictValidation(boolean strictValidation)
strictValidation
- public boolean isTextValid()
public boolean isEditable()
public void setEditable(boolean editable)
editable
- public ListenerList<TextInputListener> getTextInputListeners()
public ListenerList<TextInputContentListener> getTextInputContentListeners()
public ListenerList<TextInputSelectionListener> getTextInputSelectionListeners()
public ListenerList<TextInputBindingListener> getTextInputBindingListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |