borland Packages Class Hierarchy dx.text Package
java.lang.Object +----com.borland.dx.text.ItemEditMaskStr
Constructors Properties Methods
Implements ItemEditMask, ItemEditMaskRegionChar, Serializable
The ItemEditMaskStr
class implements the ItemEditMask
interface using pattern strings to control formatting, parsing, and edit interactions.
For information about constructing an edit mask, see string-based patterns.
public ItemEditMaskStr(String editMask, VariantFormatter formatter, int variantType)Constructs an
ItemEditMaskStr
object which implements a string-based ItemEditMask
.
You do not need to construct an ItemEditMask
for every text field, only those for which you want to constrain input on a character-by-character basis.
editMask
String
which controls the character-by-character editing semantics when used by a text control. If null or empty, it inherits the formatMask
from the formatter
parameter.
formatter
VariantFormatter
object used by this class. If this parameter is null, a default one will be constructed from the other parameters.
variantType
Variant
. variantType
defines the type of data returned from the getValue()
method. If it is zero, variantType
defaults to that of the formatter
.
VariantFormatStr
, ItemEditMask
public ItemEditMaskStr(String editMask, VariantFormatter formatter, int variantType, Locale locale)Constructs an
ItemEditMaskStr
object which implements a string-based ItemEditMask
.
You do not need to construct an ItemEditMask
for every text field, only those for which you want to constrain input on a character-by-character basis.
editMask
String
which controls the character-by-character editing semantics when used by a text control. If null or empty, it inherits the formatMask
from the formatter
parameter.
formatter
VariantFormatter
object used by this class. If this parameter is null, a default one will be constructed from the other parameters.
variantType
Variant
. variantType
defines the type of data returned from the getValue()
method. If it is zero, variantType
defaults to that of the formatter
.
locale
Locale
of the formatter
object is used. If formatter is also null, the current machine's default locale is used.
VariantFormatStr
, ItemEditMask
public boolean isPassword(int charPosition)Returns true if the indicated character position in the edit mask is to be treated as a password character. This is determined by the presence of "*" (the password symbol) in the edit mask. See String-based patterns for details.
charPosition
public char literalAt(int charPosition)Returns the literal character at the specified character position.
charPosition
protected boolean shiftLeft(ItemEditMaskState state)Shifts the entire contents of the edit buffer left by one position. It stops when it hits an illegal situation (such as moving a letter into a digit field). It also stops at the first character in the string; that is, it doesn't drop characters off the left. It starts at the
state.cursorPos
. If that cursorPos
is at a valid character, it converts that character into
a blankChar
. Blank characters are not shifted, so the first blank character stops the shift.
state