|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.TextBoxBase
Abstract base class for all text entry widgets.
Nested Class Summary | |
static class |
TextBoxBase.TextAlignConstant
Text alignment constant, used in TextBoxBase#setTextAlignment(TextAlignConstant) . |
Field Summary | |
static TextBoxBase.TextAlignConstant |
ALIGN_CENTER
Center the text. |
static TextBoxBase.TextAlignConstant |
ALIGN_JUSTIFY
Justify the text. |
static TextBoxBase.TextAlignConstant |
ALIGN_LEFT
Align the text to the left edge. |
static TextBoxBase.TextAlignConstant |
ALIGN_RIGHT
Align the text to the right. |
Fields inherited from class java.lang.Object |
typeId, typeName |
Constructor Summary | |
protected |
TextBoxBase(Element elem)
Creates a text box that wraps the given browser element handle. |
Method Summary | |
void |
addChangeListener(ChangeListener listener)
Adds a listener interface to receive change events. |
void |
addClickListener(ClickListener listener)
Adds a listener interface to receive click events. |
void |
addKeyboardListener(KeyboardListener listener)
Adds a listener interface to receive keyboard events. |
void |
cancelKey()
If a keyboard event is currently being handled on this text box, calling this method will suppress it. |
int |
getCursorPos()
Gets the current position of the cursor (this also serves as the beginning of the text selection). |
protected TextBoxImpl |
getImpl()
|
String |
getSelectedText()
Gets the text currently selected within this text box. |
int |
getSelectionLength()
Gets the length of the current text selection. |
String |
getText()
Gets this object's text. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
void |
removeChangeListener(ChangeListener listener)
Removes a previously added listener interface. |
void |
removeClickListener(ClickListener listener)
Removes a previously added listener interface. |
void |
removeKeyboardListener(KeyboardListener listener)
Removes a previously added listener interface. |
void |
selectAll()
Selects all of the text in the box. |
void |
setCursorPos(int pos)
Sets the cursor position. |
void |
setKey(char key)
If a keyboard event is currently being handled by the text box, this method replaces the unicode character or key code associated with it. |
void |
setSelectionRange(int pos,
int length)
Sets the range of text to be selected. |
void |
setText(String text)
Sets this object's text. |
void |
setTextAlignment(TextBoxBase.TextAlignConstant align)
Sets the alignment of the text in the text box. |
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget |
addFocusListener, getTabIndex, isEnabled, removeFocusListener, setAccessKey, setEnabled, setFocus, setTabIndex |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
getParent, isAttached, onAttach, onDetach, onLoad |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
equals, finalize, hashCode |
Field Detail |
public static final TextBoxBase.TextAlignConstant ALIGN_CENTER
public static final TextBoxBase.TextAlignConstant ALIGN_JUSTIFY
public static final TextBoxBase.TextAlignConstant ALIGN_LEFT
public static final TextBoxBase.TextAlignConstant ALIGN_RIGHT
Constructor Detail |
protected TextBoxBase(Element elem)
Method Detail |
public void addChangeListener(ChangeListener listener)
SourcesChangeEvents
addChangeListener
in interface SourcesChangeEvents
listener
- the listener interface to addpublic void addClickListener(ClickListener listener)
SourcesClickEvents
addClickListener
in interface SourcesClickEvents
addClickListener
in class FocusWidget
public void addKeyboardListener(KeyboardListener listener)
SourcesKeyboardEvents
addKeyboardListener
in interface SourcesKeyboardEvents
addKeyboardListener
in class FocusWidget
public void cancelKey()
public int getCursorPos()
public String getSelectedText()
public int getSelectionLength()
public String getText()
HasText
getText
in interface HasText
public void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class FocusWidget
public void removeChangeListener(ChangeListener listener)
SourcesChangeEvents
removeChangeListener
in interface SourcesChangeEvents
listener
- the listener interface to removepublic void removeClickListener(ClickListener listener)
SourcesClickEvents
removeClickListener
in interface SourcesClickEvents
removeClickListener
in class FocusWidget
public void removeKeyboardListener(KeyboardListener listener)
SourcesKeyboardEvents
removeKeyboardListener
in interface SourcesKeyboardEvents
removeKeyboardListener
in class FocusWidget
public void selectAll()
public void setCursorPos(int pos)
pos
- the new cursor positionpublic void setKey(char key)
key
- the new key valuepublic void setSelectionRange(int pos, int length)
pos
- the position of the first character to be selectedlength
- the number of characters to be selectedpublic void setText(String text)
HasText
setText
in interface HasText
public void setTextAlignment(TextBoxBase.TextAlignConstant align)
align
- the text alignment (as specified by ALIGN_CENTER
,
ALIGN_JUSTIFY
, ALIGN_LEFT
, and
ALIGN_RIGHT
)protected TextBoxImpl getImpl()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |