|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jmex.bui.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. |
| Field Summary | |
|---|---|
protected ArrayList<Document.Listener> |
_listeners
|
protected String |
_text
|
| Constructor Summary | |
|---|---|
Document()
|
|
| Method Summary | |
|---|---|
void |
addListener(Document.Listener listener)
Registers a document listener. |
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. |
boolean |
insert(int offset,
String text)
Inserts the specified text at the specified offset. |
protected void |
notify(boolean inserted,
int offset,
int length)
Notifies document listeners. |
boolean |
remove(int offset,
int length)
Deletes specified run of text at the specified offset. |
void |
removeListener(Document.Listener listener)
Clears a document listener registration. |
boolean |
replace(int offset,
int length,
String text)
Replaces the specified run of text with the supplied new text. |
boolean |
setText(String text)
Replaces the current contents of the document with the specified text. |
protected boolean |
validateEdit(String oldText,
String newText)
Provides an opportunity for edits to be rejected before being applied to the document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String _text
protected ArrayList<Document.Listener> _listeners
| Constructor Detail |
|---|
public Document()
| Method Detail |
|---|
public void addListener(Document.Listener listener)
public void removeListener(Document.Listener listener)
public String getText()
public String getText(int offset,
int length)
public boolean setText(String text)
public int getLength()
public boolean insert(int offset,
String text)
public boolean remove(int offset,
int length)
public boolean replace(int offset,
int length,
String text)
protected boolean validateEdit(String oldText,
String newText)
protected void notify(boolean inserted,
int offset,
int length)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||