|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.opengl.gui.text.Document
public class Document
Defines the model that underlies the BUI text components.
| Nested Class Summary | |
|---|---|
static interface |
Document.Listener
Used to listen for changes to this document. |
| Constructor Summary | |
|---|---|
Document()
|
|
| Method Summary | |
|---|---|
void |
addListener(Document.Listener listener)
Registers a document listener. |
void |
addUndoableEditListener(UndoableEditListener listener)
Adds a listener for undoable edits. |
int |
getLength()
Returns the number of characters in the document. |
String |
getText()
Returns the entire text of the document. |
String |
getText(int offset,
int length)
Returns a subset of the text of the document. |
IntTuple |
getWordExtents(int start)
Given a location in the string, finds the extents (start and end offsets) of connected word or non-word characters (depending on the character at the start). |
int |
indexOfWordEnd(int from)
Finds the location of the first word end boundary after the specified position. |
boolean |
insert(int offset,
String text,
int undoId)
Inserts the specified text at the specified offset. |
int |
lastIndexOfWordStart(int from)
Finds the location of the last word start boundary before the specified position. |
boolean |
remove(int offset,
int length,
int undoId)
Deletes specified run of text at the specified offset. |
void |
removeListener(Document.Listener listener)
Clears a document listener registration. |
void |
removeUndoableEditListener(UndoableEditListener listener)
Removes a listener for undoable edits. |
boolean |
replace(int offset,
int length,
String text,
int undoId)
Replaces the specified run of text with the supplied new text. |
boolean |
setText(String text,
int undoId)
Replaces the current contents of the document with the specified text. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Document()
| Method Detail |
|---|
public void addListener(Document.Listener listener)
public void removeListener(Document.Listener listener)
public void addUndoableEditListener(UndoableEditListener listener)
public void removeUndoableEditListener(UndoableEditListener listener)
public String getText()
public String getText(int offset,
int length)
public boolean setText(String text,
int undoId)
undoId - an id used to group compound edits for undo (-1 if not undoable).
public int indexOfWordEnd(int from)
public int lastIndexOfWordStart(int from)
public IntTuple getWordExtents(int start)
public int getLength()
public boolean insert(int offset,
String text,
int undoId)
undoId - an id used to group compound edits for undo (-1 if not undoable).
public boolean remove(int offset,
int length,
int undoId)
undoId - an id used to group compound edits for undo (-1 if not undoable).
public boolean replace(int offset,
int length,
String text,
int undoId)
undoId - an id used to group compound edits for undo (-1 if not undoable).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||