|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wings.text.DefaultDocument
public class DefaultDocument
| Field Summary | |
|---|---|
protected ArrayList |
delayedEvents
All delayed events are stored here |
| Constructor Summary | |
|---|---|
DefaultDocument()
|
|
DefaultDocument(String text)
|
|
| Method Summary | |
|---|---|
void |
addDocumentListener(SDocumentListener listener)
Registers the given observer to begin receiving notifications when changes are made to the document. |
protected void |
fireChangeUpdate(int offset,
int length)
|
void |
fireDelayedFinalEvents()
fire remaining delayed events. |
void |
fireDelayedIntermediateEvents()
fire delayed events which describes a "in progress" state change, like TreeWillExpand, or ListSelectionEvent with getIsAdjusting() true, ... |
protected void |
fireInsertUpdate(int offset,
int length)
|
protected void |
fireRemoveUpdate(int offset,
int length)
|
boolean |
getDelayEvents()
|
SDocumentListener[] |
getDocumentListeners()
Returns an array of all the SDocumentListeners added
to this SDocument via addDocumentListener(). |
int |
getLength()
Returns number of characters of content currently in the document. |
String |
getText()
|
String |
getText(int offset,
int length)
Fetches the text contained within the given portion of the document. |
void |
insert(int offset,
String string)
Inserts a string of content. |
void |
remove(int offset,
int length)
Removes a portion of the content of the document. |
void |
removeDocumentListener(SDocumentListener listener)
Unregisters the given observer from the notification list so it will no longer receive change updates. |
void |
setDelayEvents(boolean b)
if this is set to true, events are not fired immediately. |
void |
setText(String text)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ArrayList delayedEvents
| Constructor Detail |
|---|
public DefaultDocument()
public DefaultDocument(String text)
| Method Detail |
|---|
public void setText(String text)
setText in interface SDocumentpublic String getText()
getText in interface SDocument
public String getText(int offset,
int length)
throws BadLocationException
SDocument
getText in interface SDocumentoffset - the offset into the document representing the desired
start of the text >= 0length - the length of the desired string >= 0
BadLocationException - some portion of the given range
was not a valid part of the document. The location in the exception
is the first bad position encountered.public int getLength()
SDocument
getLength in interface SDocument
public void remove(int offset,
int length)
throws BadLocationException
SDocument
remove in interface SDocumentoffset - the offset from the beginning >= 0length - the number of characters to remove >= 0
BadLocationException - some portion of the removal range
was not a valid part of the document. The location in the exception
is the first bad position encountered.DocumentEvent,
DocumentListener,
UndoableEditEvent,
UndoableEditListener
public void insert(int offset,
String string)
throws BadLocationException
SDocument
insert in interface SDocumentoffset - the offset into the document to insert the content >= 0.
All positions that track change at or after the given location
will move.string - the string to insert
BadLocationExceptionpublic SDocumentListener[] getDocumentListeners()
SDocumentSDocumentListeners added
to this SDocument via addDocumentListener().
getDocumentListeners in interface SDocumentSDocumentListeners added or an
empty array if no listeners are presentSDocument.addDocumentListener(org.wings.event.SDocumentListener),
SDocument.removeDocumentListener(org.wings.event.SDocumentListener)public void addDocumentListener(SDocumentListener listener)
SDocument
addDocumentListener in interface SDocumentlistener - the observer to registerSDocument.removeDocumentListener(org.wings.event.SDocumentListener)public void removeDocumentListener(SDocumentListener listener)
SDocument
removeDocumentListener in interface SDocumentlistener - the observer to registerSDocument.addDocumentListener(org.wings.event.SDocumentListener)
protected void fireInsertUpdate(int offset,
int length)
protected void fireRemoveUpdate(int offset,
int length)
protected void fireChangeUpdate(int offset,
int length)
public boolean getDelayEvents()
getDelayEvents in interface SDelayedEventModelpublic void setDelayEvents(boolean b)
SDelayedEventModel
setDelayEvents in interface SDelayedEventModelpublic void fireDelayedIntermediateEvents()
SDelayedEventModel
fireDelayedIntermediateEvents in interface SDelayedEventModelpublic void fireDelayedFinalEvents()
SDelayedEventModel
fireDelayedFinalEvents in interface SDelayedEventModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||