public class nUIEntryElement extends nUIElementDisplay
Modifier and Type | Field and Description |
---|---|
static int |
FORMAT_NUMBER_ANY
Entry format that asks the OS for a "numbers"/"PIN"/"phone number"-style keyboard in order to help limit the input.
|
static int |
FORMAT_PIN_HIDDEN
Hidden entry format that asks the OS for a "numbers only"/"PIN"-style keyboard in order to help limit the input.
|
static int |
FORMAT_STRING_ANY
Entry format where a free-form String made up of any characters may be entered.
|
static int |
FORMAT_STRING_HIDDEN
Hidden entry format where a free-form String made up of any characters may be entered.
|
Y_IDENTIFIER_PREV_BOTTOM
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
Constructor and Description |
---|
nUIEntryElement() |
nUIEntryElement(java.util.Hashtable properties) |
nUIEntryElement(java.lang.String text)
Default data-entry constructor
|
nUIEntryElement(java.lang.String text,
java.util.Hashtable properties) |
Modifier and Type | Method and Description |
---|---|
int |
getFontStyle()
Gets the current font style used for text on this button.
|
java.lang.String |
getFormat()
Gets the current format String.
|
java.lang.String |
getHintText()
Gets the hint text.
|
int |
getHintTextColor()
Get the current hint text color for this element, as an AARRGGBB value.
|
int |
getLines()
Gets the current number of lines shown to the user to type into.
|
java.lang.String |
getText()
Gets the currently entered text.
|
int |
getTextColor() |
boolean |
isGrowingOnTextEntry()
Determine if this entry element will grow (assuming it is also multi-line) to fit the content added to it.
|
void |
setEditing(boolean editing) |
void |
setFontSize(float points)
Sets font size in density-independent or scale-independent pixels depending on target device.
|
void |
setFontStyle(int font_style)
Sets the style of the font to use.
|
void |
setFormat(int intFormat)
Sets the allowable text format of this entry element, using one of the
FORMAT_* constants defined in this class. |
void |
setGrowingOnTextEntry(boolean grow)
For multi-line text fields, allow the entry element to start at one line only and expand as
content is added.
|
void |
setHintText(java.lang.String hinttext)
Sets the hint text to display when no text is shown.
|
void |
setHintTextColor(int argb)
Set the color of the hint text for this element.
|
void |
setLines(int lines)
Sets the number of lines shown to the user to type into.
|
void |
setText(java.lang.String text)
Sets the text to display.
|
void |
setTextColor(int color) |
applyBackground, applyBackground, applyBackground
getBackgroundDrawable, getBottom, getElementIdentifier, getFocusable, getGesturable, getHeight, getInnerHeight, getInnerWidth, getInnerX, getInnerY, getLeft, getMaxChildX, getMaxChildY, getProperties, getProperty, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, getX, getY, insertAtInternal, isEnabled, isVisible, onRemoved, remove, setBackgroundDrawable, setBottom, setElementIdentifier, setEnabled, setFocusable, setGesturable, setHeight, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setProperties, setProperty, setRight, setTop, setTriggerable, setVisible, setWidth, setX, setY
add, addEventListener, childElementAt, childIndexOf, getFirstChild, getId, getLastChild, getNextSibling, getParent, getPrevSibling, getTag, insertAfter, insertAt, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setId, setTag, setUnlinkChildrenOnRemoval
public static final int FORMAT_STRING_ANY
setFormat("**")
public static final int FORMAT_NUMBER_ANY
setFormat("N*")
public static final int FORMAT_STRING_HIDDEN
setFormat("H**")
public static final int FORMAT_PIN_HIDDEN
setFormat("HN*")
public nUIEntryElement()
public nUIEntryElement(java.util.Hashtable properties)
public nUIEntryElement(java.lang.String text)
text
- The default text to display to begin withpublic nUIEntryElement(java.lang.String text, java.util.Hashtable properties)
public int getTextColor()
public void setTextColor(int color)
public void setFontStyle(int font_style)
font_style
- Any of nUIConstants.style_*
java.lang.IllegalArgumentException
- if font_style is not validpublic int getFontStyle()
nUIConstants.style_*
public void setFontSize(float points)
points
- - DP or SP units.public void setLines(int lines)
lines
- Number of lines to displayjava.lang.IllegalArgumentException
- is lines is less than or equal to 0public int getLines()
public void setText(java.lang.String text)
text
- Text to displayjava.lang.NullPointerException
- if text is nullpublic java.lang.String getText()
public void setHintText(java.lang.String hinttext)
hinttext
- Hint text to displayjava.lang.NullPointerException
- if text is nullpublic java.lang.String getHintText()
public void setFormat(int intFormat)
FORMAT_*
constants defined in this class.public java.lang.String getFormat()
public void setEditing(boolean editing)
public void setGrowingOnTextEntry(boolean grow)
setLines()
.grow
- true if the entry should grow with the text, false if it should start at a fixed size.public boolean isGrowingOnTextEntry()
true
if the element will grow, false
if it's a fixed size.public void setHintTextColor(int argb)
argb
- an AARRGGBB color.public int getHintTextColor()