|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.lw.mask.MaskedText
This class implements text model interface for masked text.
Constructor Summary | |
MaskedText(java.lang.String mask)
Constructs the class with the specified mask. |
|
MaskedText(java.lang.String mask,
MaskValidator v)
Constructs the class with the specified mask and the given mask validator. |
Method Summary | |
void |
addTextListener(TextListener l)
Adds the specified text listener to receive text events. |
int |
findHandledTag(int offset,
int d)
Looks for the next handled (by the validator) character index in the text starting from the given offset. |
int |
getExtraChar(int i)
Gets special extra char that is used to store extra information by the specified index. |
java.lang.String |
getLine(int i)
Returns the line at the specified line number. |
java.lang.String |
getMask()
Gets the mask. |
int |
getSize()
Returns the line number of the text. |
java.lang.String |
getText()
Returns the original text data that have been set with setText method. |
int |
getTextLength()
Returns the text length (number of the text characters). |
MaskValidator |
getValidator()
Gets the mask validator. |
boolean |
isHandledOffset(int offset)
|
void |
remove(int offset,
int count)
Removes a text at the specified offset with the size. |
void |
removeTextListener(TextListener l)
Removes the specified text listener. |
void |
setExtraChar(int i,
int ch)
Sets special extra char that is used to store extra information by the specified index. |
void |
setMask(java.lang.String m)
Sets the specified mask. |
void |
setText(java.lang.String t)
Sets the specified text data. |
void |
setValidator(MaskValidator v)
Sets the specified mask validator. |
void |
write(char ch,
int offset)
Inserts the specified character at the given offset. |
void |
write(java.lang.String s,
int offset)
Inserts the specified text at the given offset. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MaskedText(java.lang.String mask)
mask
- the specified mask.public MaskedText(java.lang.String mask, MaskValidator v)
mask
- the specified mask.v
- the specified mask validator.Method Detail |
public java.lang.String getMask()
public void setMask(java.lang.String m)
m
- the specified mask.public java.lang.String getLine(int i)
TextModel
getLine
in interface TextModel
org.zaval.data.TextModel
line
- the specified line number.public MaskValidator getValidator()
public void setValidator(MaskValidator v)
v
- the specified mask validator.public java.lang.String getText()
TextModel
setText
method.getText
in interface TextModel
org.zaval.data.TextModel
public void setText(java.lang.String t)
TextModel
setText
in interface TextModel
org.zaval.data.TextModel
text
- the specified text data.public int getSize()
TextModel
getSize
in interface TextModel
org.zaval.data.TextModel
public int getTextLength()
TextModel
getTextLength
in interface TextModel
org.zaval.data.TextModel
public void write(char ch, int offset)
TextModel
write
in interface TextModel
org.zaval.data.TextModel
ch
- the character to be inserted.offset
- the offset where the character will be inserted.public void write(java.lang.String s, int offset)
TextModel
write
in interface TextModel
org.zaval.data.TextModel
s
- the text to be inserted.offset
- the offset where the text will be inserted.public void remove(int offset, int count)
TextModel
remove
in interface TextModel
org.zaval.data.TextModel
offset
- the offset where the text will be removed.size
- the size of the part that is going to be removed.public void addTextListener(TextListener l)
TextModel
addTextListener
in interface TextModel
org.zaval.data.TextModel
l
- the text listener.TextListener
,
TextEvent
public void removeTextListener(TextListener l)
TextModel
removeTextListener
in interface TextModel
org.zaval.data.TextModel
l
- the text listener.TextListener
,
TextEvent
public int getExtraChar(int i)
TextModel
getExtraChar
in interface TextModel
org.zaval.data.TextModel
i
- the specified extra char index.public void setExtraChar(int i, int ch)
TextModel
setExtraChar
in interface TextModel
org.zaval.data.TextModel
i
- the specified extra char index.val
- the specified extra char value.public int findHandledTag(int offset, int d)
offset
- the starting offset.d
- the look-up direction.public boolean isHandledOffset(int offset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |