borland Packages  Class Hierarchy  dx.text Package 

ItemEditMask interface

com.borland.dx.text.ItemEditMask

About the ItemEditMask interface

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.


ItemEditMask methods

Methods defined in this interface


ItemEditMask methods

delete(com.borland.dx.text.ItemEditMaskState, int, int)

  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.

Parameters:

state
The ItemEditMaskState returned by prepare().
startPos
The starting position within the edit buffer (where 0 is the first character) to begin the deletion.
count
The number of characters to delete.

getFinalValue(com.borland.dx.text.ItemEditMaskState, com.borland.dx.dataset.Variant)

  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.

Parameters:

state
The state of the control returned by prepare().
value
The Variant used to store the parsed results.

getFinalValue(com.borland.dx.text.ItemEditMaskState, com.borland.dx.dataset.Variant, int)

  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.

Parameters:

state
The state of the control returned by prepare().
value
The Variant used to store the parsed results.
variantType
The data type for the Variant.

insert(com.borland.dx.text.ItemEditMaskState, char)

  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.

Parameters:

state
The ItemEditMaskStateSte returned by prepare().
c
The character to be inserted. It is known that the character is not a navigation keystroke, but the implementor of this method must decide if the character is legal.

isComplete(com.borland.dx.text.ItemEditMaskState)

  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.

Parameters:

state
The ItemEditMaskState returned by prepare().

move(com.borland.dx.text.ItemEditMaskState, int)

  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.

Parameters:

state
The ItemEditMaskState returned by prepare().
keyCode
Always one of the following: In the case of the two mouse events, the state.cursorPos contains the desired mouse position. This method should alter that position if it desires.

prepare(com.borland.dx.dataset.Variant)

  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.

Parameters:

value
A 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.