|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The interface is used to represent text data. Actually the interface determines following three abilities to work with a text:
addTextListener and
removeTextListener methods to listen the text events.
| Method Summary | |
void |
addTextListener(TextListener l)
Adds the specified text listener to receive text events. |
int |
getExtraChar(int i)
Gets special extra char that is used to store extra information by the specified index. |
java.lang.String |
getLine(int line)
Returns the line at the specified line number. |
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). |
void |
remove(int offset,
int size)
Removes a text at the specified offset with the size. |
void |
removeTextListener(TextListener l)
Removes the specified text listener. |
void |
setExtraChar(int i,
int val)
Sets special extra char that is used to store extra information by the specified index. |
void |
setText(java.lang.String text)
Sets the specified text data. |
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. |
| Method Detail |
public java.lang.String getLine(int line)
line - the specified line number.public void setText(java.lang.String text)
text - the specified text data.public java.lang.String getText()
setText method.public int getSize()
public void write(java.lang.String s,
int offset)
s - the text to be inserted.offset - the offset where the text will be inserted.
public void write(char ch,
int offset)
ch - the character to be inserted.offset - the offset where the character will be inserted.
public void remove(int offset,
int size)
offset - the offset where the text will be removed.size - the size of the part that is going to be removed.public int getTextLength()
public void addTextListener(TextListener l)
l - the text listener.TextListener,
TextEventpublic void removeTextListener(TextListener l)
l - the text listener.TextListener,
TextEventpublic int getExtraChar(int i)
i - the specified extra char index.
public void setExtraChar(int i,
int val)
i - the specified extra char index.val - the specified extra char value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||