|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectswingwtx.swing.text.StringContent
This class is used to represent document content with a StringBuffer. Hopefully it should be efficient enough.
Constructor Summary | |
StringContent()
|
|
StringContent(int initialSize)
|
Method Summary | |
Position |
createPosition(int offset)
Creates an anonymous class implementing Position for the
offset given. |
void |
getChars(int where,
int len,
Segment txt)
Assigns the specified substring to the passed Segment |
java.lang.String |
getString(int where,
int len)
Retrieves a string from the content |
UndoableEdit |
insertString(int where,
java.lang.String str)
Inserts a string into the content at the specified position. |
int |
length()
Returns the content length |
UndoableEdit |
remove(int where,
int nitems)
Removes nitems chars from the content at the specified position. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringContent()
public StringContent(int initialSize)
Method Detail |
public Position createPosition(int offset) throws BadLocationException
Position
for the
offset given.
createPosition
in interface AbstractDocument.Content
BadLocationException
public int length()
length
in interface AbstractDocument.Content
public UndoableEdit insertString(int where, java.lang.String str) throws BadLocationException
insertString
in interface AbstractDocument.Content
BadLocationException
- if the position is invalid
FIXME: UNDO needs implementingpublic UndoableEdit remove(int where, int nitems) throws BadLocationException
remove
in interface AbstractDocument.Content
BadLocationException
- if the position is invalid
FIXME: UNDO needs implementingpublic java.lang.String getString(int where, int len) throws BadLocationException
getString
in interface AbstractDocument.Content
where
- The offsetlen
- The length of the string
BadLocationException
- if the position is invalidpublic void getChars(int where, int len, Segment txt) throws BadLocationException
getChars
in interface AbstractDocument.Content
where
- The offsetlen
- The lengthtxt
- The segment object to put the substring in
BadLocationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |