borland Packages Class Hierarchy dx.text Package
com.borland.dx.text.ItemEditMask
Methods
Implemented by ItemEditMaskStr
The ItemEditMask
interface provides an open interface for character-by-character input validation. There is an ItemEditMaskStr
implementation which uses a control string to validate characters.
public boolean delete(ItemEditMaskState state, int startPos, int count)Deletes the given range of characters from the edit buffer and returns true if deletion occurred and the edit string has changed. If
delete()
returns false, the deletion could not take place.
Usually each deleted character is replaced with an underscore character.
state
ItemEditMaskState
returned by prepare()
.
startPos
count
public void getFinalValue(ItemEditMaskState state, Variant value)Fetches the results from parsing the current edit buffer, storing the results into the
value
parameter. getFinalValue()
never returns a null Variant
, but it does throw an InvalidFormatException
if the current edit buffer cannot be parsed. This exception class contains the cursor position where the failure occurred.
state
prepare()
.
value
Variant
used to store the parsed results.
public void getFinalValue(ItemEditMaskState state, Variant value, int variantType)Fetches the results from parsing the current edit buffer, storing the results into the
value
parameter. getFinalValue()
never returns a null Variant
, but it does throw an InvalidFormatException
if the current edit buffer cannot be parsed. This exception class contains the cursor position where the failure occurred.
state
prepare()
.
value
Variant
used to store the parsed results.
variantType
Variant
.
public boolean insert(ItemEditMaskState state, char c)Inserts the specified character at the position given by
state.cursorPos
. If insert()
returns true, the insert succeeded and the display string state is now different. If insert()
returns false, the insert was refused. No error reporting or beeping occurs as the control is expected to do that.
state
ItemEditMaskStateSte
returned by prepare()
.
c
public boolean isComplete(ItemEditMaskState state)Determines whether all the required fields in the edit buffer have been provided. If
isComplete
returns true, all required fields have been filled in. If it returns false, state.cursorPos
is set at the first required character which has been left emtpy. This method does not perform validation.
state
ItemEditMaskState
returned by prepare()
.
public boolean move(ItemEditMaskState state, int keyCode)Handles the given navigation request starting from the specified cursor position. If the cursor position changes,
move()
returns true. If nothing happened, move()
returns false.
state
ItemEditMaskState
returned by prepare()
.
keyCode
Event.HOME
Event.END
Event.LEFT
Event.RIGHT
Event.MOUSE_DOWN
Event.MOUSE_UP
state.cursorPos
contains the desired mouse position. This method should alter that position if it desires.
public ItemEditMaskState prepare(Variant value)The initial method called when setting up for editing against the
ItemEditMask
interface. It returns an ItemEditMaskState
, an object allocated within the prepare()
method but which should be owned by the control doing the editing. It contains state information regarding the current edit string and cursor position.
A null return value signifies that the ItemEditMask
interface should not be used (meaning there will be no character-by-character checking during editing). prepare()
instantiates some private data which is owned by the edit control.
value
Variant
containing the data to be formatted into the edit buffer. A null value or value.isNull()
specifies that the initial edit string is empty (except for embedded literals and underscore characters where characters should be entered). This value
parameter is not recorded, so it can fall out of scope.