|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.widgets.form.fields.FormItem
com.smartgwt.client.widgets.form.fields.TextItem
public class TextItem
FormItem for managing a text field.
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
TextItem()
|
|
TextItem(JavaScriptObject jsObj)
|
|
TextItem(String name)
|
|
TextItem(String name,
String title)
|
Method Summary | |
---|---|
void |
deselectValue()
If this item currently has focus, clear the current selection. |
void |
deselectValue(boolean start)
If this item currently has focus, clear the current selection. |
CharacterCasing |
getCharacterCasing()
Should entered characters be converted to upper or lowercase? Also applies to values applied with FormItem.setValue(int) . |
int |
getHeight()
Default height for text items. |
String |
getHint()
Returns the hint text for this item. |
String |
getKeyPressFilter()
Sets a keypress filter regular expression to limit valid characters that can be entered by the user. |
Integer |
getLength()
if set, maximum number of characters for this field |
String |
getMask()
Input mask used to filter text entry. |
Boolean |
getMaskOverwriteMode()
During entry into masked field, should keystrokes overwrite current position value? By default new keystrokes are inserted into the field. |
String |
getMaskPadChar()
Character that is used to fill required empty mask positions to display text while control has no focus. |
String |
getMaskPromptChar()
Character that is used to fill required empty mask positions to display text while control has focus. |
Boolean |
getMaskSaveLiterals()
Should entered mask value be saved with embedded literals? |
static TextItem |
getOrCreateRef(JavaScriptObject jsObj)
|
int[] |
getSelectionRange()
For text-based items, this method returns the indices of the start/end of the current selection. |
Boolean |
getSelectOnFocus()
Allows the 'selectOnFocus' behavior to be
configured on a per-FormItem basis. |
Boolean |
getShowHintInField()
If showing hint for this form item, should it be shown within the field? |
String |
getTextBoxStyle()
Base CSS class name for this item's input element. |
int |
getWidth()
Default width for fields. |
void |
selectValue()
Put focus in this item and select the entire value. |
void |
setCharacterCasing(CharacterCasing characterCasing)
Should entered characters be converted to upper or lowercase? Also applies to values applied with FormItem.setValue(int) . |
void |
setHeight(int height)
Default height for text items. |
void |
setKeyPressFilter(String keyPressFilter)
Sets a keypress filter regular expression to limit valid characters that can be entered by the user. |
void |
setLength(Integer length)
if set, maximum number of characters for this field |
void |
setMask(String mask)
Input mask used to filter text entry. |
void |
setMaskOverwriteMode(Boolean maskOverwriteMode)
During entry into masked field, should keystrokes overwrite current position value? By default new keystrokes are inserted into the field. |
void |
setMaskPadChar(String maskPadChar)
Character that is used to fill required empty mask positions to display text while control has no focus. |
void |
setMaskPromptChar(String maskPromptChar)
Character that is used to fill required empty mask positions to display text while control has focus. |
void |
setMaskSaveLiterals(Boolean maskSaveLiterals)
Should entered mask value be saved with embedded literals? |
void |
setSelectionRange(int start,
int end)
Puts focus into this form item and selects characters between the given indices. |
void |
setSelectOnFocus(Boolean selectOnFocus)
Allows the 'selectOnFocus' behavior to be
configured on a per-FormItem basis. |
void |
setShowHintInField(Boolean showHintInField)
If showing hint for this form item, should it be shown within the field? |
void |
setTextBoxStyle(String textBoxStyle)
Base CSS class name for this item's input element. |
void |
setWidth(int width)
Default width for fields. |
Methods inherited from class com.smartgwt.client.core.RefDataClass |
---|
getRef, getRef |
Methods inherited from class com.smartgwt.client.core.DataClass |
---|
doAddHandler, fireEvent, getAttributeAsIntArray, getAttributeAsMap, getAttributeAsObject, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute |
Methods inherited from class com.smartgwt.client.core.JsObject |
---|
setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public TextItem()
public TextItem(JavaScriptObject jsObj)
public TextItem(String name)
public TextItem(String name, String title)
Method Detail |
---|
public static TextItem getOrCreateRef(JavaScriptObject jsObj)
public void setWidth(int width)
setWidth
in class FormItem
width
- width Default value is 150public int getWidth()
getWidth
in class FormItem
public void setHeight(int height)
setHeight
in class FormItem
height
- height Default value is 19public int getHeight()
getHeight
in class FormItem
public void setTextBoxStyle(String textBoxStyle)
setTextBoxStyle
in class FormItem
textBoxStyle
- textBoxStyle Default value is "textItem"public String getTextBoxStyle()
getTextBoxStyle
in class FormItem
public void setLength(Integer length)
length
- length Default value is nullpublic Integer getLength()
public void setSelectOnFocus(Boolean selectOnFocus)
'selectOnFocus'
behavior to be
configured on a per-FormItem basis. Normally all items in a form default to the value of selectOnFocus
.
setSelectOnFocus
in class FormItem
selectOnFocus
- selectOnFocus Default value is nullpublic Boolean getSelectOnFocus()
'selectOnFocus'
behavior to be
configured on a per-FormItem basis. Normally all items in a form default to the value of selectOnFocus
.
getSelectOnFocus
in class FormItem
public void setShowHintInField(Boolean showHintInField)
CSS style for the hint is textBoxStyle
with the suffix "Hint" appended to it.
Note : This is an advanced setting
showHintInField
- showHintInField Default value is nullpublic Boolean getShowHintInField()
CSS style for the hint is textBoxStyle
with the suffix "Hint" appended to it.
public void setCharacterCasing(CharacterCasing characterCasing)
FormItem.setValue(int)
. Note: character casing cannot be used at the same time
as a mask
.
Note : This is an advanced setting
characterCasing
- characterCasing Default value is TextItem.DEFAULTpublic CharacterCasing getCharacterCasing()
FormItem.setValue(int)
. Note: character casing cannot be used at the same time
as a mask
.
public void setKeyPressFilter(String keyPressFilter)
Note: keypress filtering cannot be used at the same time as a mask
.
Set the keyPressFilter for this item
Note : This is an advanced setting
keyPressFilter
- new keyPress filter for the item. Default value is nullpublic String getKeyPressFilter()
Note: keypress filtering cannot be used at the same time as a mask
.
public void setMask(String mask)
Sample masks:
Character | Description |
---|---|
0 | Digit (0 through 9) or plus [+] or minus [-] signs |
9 | Digit or space |
# | Digit |
L | Letter (A through Z) |
? | Letter (A through Z) or space |
A | Letter or digit |
a | Letter or digit |
C | Any character or space |
< | Causes all characters that follow to be convered to lowercase |
> | Causes all characters that follow to be convered to uppercase |
Any character not matching one of the above mask characters or that is escaped with a backslash (\) is considered to be a literal.
Custom mask characters can be defined by standard regular expression character set or range. For example, a hexadecimal color code mask could be:
Note: input mask cannot be used
at the same time as a keyPressFilter
.
Set the mask for this item.
Note that the current value of the field is cleared when changing the mask.
Note : This is an advanced setting
mask
- mask to apply to text item. Default value is nullpublic String getMask()
Sample masks:
Character | Description |
---|---|
0 | Digit (0 through 9) or plus [+] or minus [-] signs |
9 | Digit or space |
# | Digit |
L | Letter (A through Z) |
? | Letter (A through Z) or space |
A | Letter or digit |
a | Letter or digit |
C | Any character or space |
< | Causes all characters that follow to be convered to lowercase |
> | Causes all characters that follow to be convered to uppercase |
Any character not matching one of the above mask characters or that is escaped with a backslash (\) is considered to be a literal.
Custom mask characters can be defined by standard regular expression character set or range. For example, a hexadecimal color code mask could be:
Note: input mask cannot be used
at the same time as a keyPressFilter
.
public void setMaskOverwriteMode(Boolean maskOverwriteMode)
Note : This is an advanced setting
maskOverwriteMode
- maskOverwriteMode Default value is nullpublic Boolean getMaskOverwriteMode()
public void setMaskSaveLiterals(Boolean maskSaveLiterals)
Note : This is an advanced setting
maskSaveLiterals
- maskSaveLiterals Default value is nullpublic Boolean getMaskSaveLiterals()
public void setMaskPadChar(String maskPadChar)
Note : This is an advanced setting
maskPadChar
- maskPadChar Default value is " "public String getMaskPadChar()
public void setMaskPromptChar(String maskPromptChar)
Note : This is an advanced setting
maskPromptChar
- maskPromptChar Default value is "_"public String getMaskPromptChar()
public String getHint()
hint
, or null if there is no hint to show.
getHint
in class FormItem
public void setSelectionRange(int start, int end)
start
- selection starting character indexend
- end of selection character indexpublic void selectValue()
public void deselectValue()
public void deselectValue(boolean start)
start
- By default the text insertion cursor will be moved to the end of the current value - pass in this parameter to move to
the start insteadpublic int[] getSelectionRange()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |