|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.text.TextPointer
public final class TextPointer
A pointer to a position in an ITextBuffer.
| Constructor Summary | |
|---|---|
TextPointer()
Creates an empty TextPointer. |
|
TextPointer(ITextBuffer b)
Creates a TextPointer that points to the beginning of the given ITextBuffer. |
|
TextPointer(ITextBuffer b,
int pos)
Creates a TextPointer that points to the given position in the given ITextBuffer. |
|
| Method Summary | |
|---|---|
void |
deleteTo(int pos)
Deletes all the text from the position pointed to by this instance of TextPointer to the position given as the parameter in the ITextBuffer which this TextPointer is pointing to. |
void |
dispose()
Deletes all the text from the position pointed to by this instance of TextPointer to the position pointed to by the TextPointer given as the parameter in the ITextBuffer which this instance of TextPointer is pointing to. |
boolean |
findNext(char ch)
Moves the position of this TextPointer to the next instance of the character given as the parameter, starting from the current position. |
boolean |
findNext(java.lang.String s)
Moves the position of this TextPointer to the next instance of the String given as the parameter, starting from the current position. |
boolean |
findPrev(char ch)
Moves the position of this TextPointer to the previous instance of the character given as the parameter, starting from the current position. |
int |
getPosition()
|
ITextBuffer |
getTextBuffer()
|
java.lang.String |
getTextTo(int pos)
Returns the text from the position pointed to by this TextPointer to the position given by the parameter in the ITextBuffer which this TextPointer is pointing to. |
java.lang.String |
getTextTo(TextPointer p)
Returns the text from the position pointed to by this TextPointer to the position pointed to by the TextPointer passed as the parameter in the ITextBuffer which this instance of TextPointer is pointing to. |
void |
insertText(java.lang.String s)
Inserts the String passed in as the parameter in the position of this TextPointer into the ITextBuffer which this TextPointer points to. |
void |
offset(int relativePos)
Offsets the current position of this TextPointer by the given parameter. |
void |
setListener(ITextPointerListener l)
Sets the ITextPointerListener to be notified of changes in this TextPointer. |
void |
setPosition(int pos)
Sets the position of this TextPointer. |
void |
setPosition(TextPointer p)
Sets the position of this TextPointer to the position of the TextPointer passed in as the parameter. |
void |
setTextBuffer(ITextBuffer b)
Sets the TextBuffer which this TextPointer is to be pointing to, and adds itself as an ITextBufferListener with the new ITextBuffer. |
void |
textChanged(ITextBuffer b,
int start,
int end)
implementation of ITextBufferListener.textChanged() |
void |
textMoved(ITextBuffer b,
int start,
int offset)
implementation of ITextBufferListener.textMoved() |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextPointer()
public TextPointer(ITextBuffer b)
public TextPointer(ITextBuffer b,
int pos)
| Method Detail |
|---|
public void deleteTo(int pos)
public void dispose()
public int getPosition()
public ITextBuffer getTextBuffer()
public java.lang.String getTextTo(int pos)
public java.lang.String getTextTo(TextPointer p)
public boolean findNext(char ch)
public boolean findNext(java.lang.String s)
public boolean findPrev(char ch)
public void insertText(java.lang.String s)
public void offset(int relativePos)
public void setListener(ITextPointerListener l)
public void setPosition(int pos)
public void setPosition(TextPointer p)
public void setTextBuffer(ITextBuffer b)
public void textChanged(ITextBuffer b,
int start,
int end)
textChanged in interface ITextBufferListenerb - a reference to the text buffer that changed.start - the starting index of the changed text.end - the ending index of the changed text.
public void textMoved(ITextBuffer b,
int start,
int offset)
textMoved in interface ITextBufferListenerb - a reference to the text buffer that moved.start - the starting index of the moved text.offset - the relative number of characters the text has moved towards the end of the buffer.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||