| org.wings.text.SDocument
All known Subclasses: org.wings.text.DefaultDocument,
Method Summary | |
public void | addDocumentListener(SDocumentListener listener) Registers the given observer to begin receiving notifications
when changes are made to the document. | public SDocumentListener[] | getDocumentListeners() Returns an array of all the SDocumentListener s added
to this SDocument via addDocumentListener(). | public int | getLength() Returns number of characters of content currently
in the document. | public String | getText(int offset, int length) Fetches the text contained within the given portion
of the document.
Parameters: offset - the offset into the document representing the desiredstart of the text >= 0 Parameters: length - the length of the desired string >= 0 the text, in a String of length >= 0 throws: BadLocationException - some portion of the given rangewas not a valid part of the document. | public String | getText() | public void | insert(int offset, String string) Inserts a string of content. | public void | remove(int offs, int len) Removes a portion of the content of the document.
This will cause a DocumentEvent of type
DocumentEvent.EventType.REMOVE to be sent to the
registered DocumentListeners, unless an exception
is thrown. | public void | removeDocumentListener(SDocumentListener listener) Unregisters the given observer from the notification list
so it will no longer receive change updates. | public void | setText(String text) |
addDocumentListener | public void addDocumentListener(SDocumentListener listener)(Code) | | Registers the given observer to begin receiving notifications
when changes are made to the document.
Parameters: listener - the observer to register See Also: SDocument.removeDocumentListener |
getLength | public int getLength()(Code) | | Returns number of characters of content currently
in the document.
number of characters >= 0 |
getText | public String getText(int offset, int length) throws BadLocationException(Code) | | Fetches the text contained within the given portion
of the document.
Parameters: offset - the offset into the document representing the desiredstart of the text >= 0 Parameters: length - the length of the desired string >= 0 the text, in a String of length >= 0 throws: BadLocationException - some portion of the given rangewas not a valid part of the document. The location in the exceptionis the first bad position encountered. |
insert | public void insert(int offset, String string) throws BadLocationException(Code) | | Inserts a string of content. This will cause a DocumentEvent
of type DocumentEvent.EventType.INSERT to be sent to the
registered DocumentListers, unless an exception is thrown.
The DocumentEvent will be delivered by calling the
insertUpdate method on the DocumentListener.
The offset and length of the generated DocumentEvent
will indicate what change was actually made to the Document.
Parameters: offset - the offset into the document to insert the content >= 0.All positions that track change at or after the given locationwill move. Parameters: string - the string to insert |
removeDocumentListener | public void removeDocumentListener(SDocumentListener listener)(Code) | | Unregisters the given observer from the notification list
so it will no longer receive change updates.
Parameters: listener - the observer to register See Also: SDocument.addDocumentListener |
|
|