|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.pandoragames.far.ui.swing.component.StreamedDocumentContent
public class StreamedDocumentContent
Implementation of javax.swing.text.AbstractDocument.Content
backed by a file. This implementation is specifically designed for large contents.
It currently is implemented read only, but write support may be added in
the future.
| Constructor Summary | |
|---|---|
StreamedDocumentContent(java.io.File file)
Instantiates this document with a File object, using the default character encoding. |
|
StreamedDocumentContent(FileBuffer fileBuffer)
Instantiates this document with a FileBuffer object. |
|
| Method Summary | |
|---|---|
javax.swing.text.Position |
createPosition(int offset)
Creates a position within the content that will track change as the content is mutated. |
void |
getChars(int where,
int len,
javax.swing.text.Segment txt)
Gets a sequence of characters and copies them into a Segment. |
java.lang.String |
getString(int where,
int len)
Fetches a string of characters contained in the sequence. |
javax.swing.undo.UndoableEdit |
insertString(int where,
java.lang.String str)
Throws a BadLocationException as this component is READ ONLY. |
int |
length()
Current length of the sequence of character content. |
javax.swing.undo.UndoableEdit |
remove(int where,
int nitems)
Throws a BadLocationException as this component is READ ONLY. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamedDocumentContent(java.io.File file)
throws java.io.IOException
file - to back the content
java.io.IOExceptionpublic StreamedDocumentContent(FileBuffer fileBuffer)
fileBuffer - to back the content| Method Detail |
|---|
public javax.swing.text.Position createPosition(int offset)
throws javax.swing.text.BadLocationException
createPosition in interface javax.swing.text.AbstractDocument.Contentoffset - the offset in the content >= 0
javax.swing.text.BadLocationException - for an invalid offset
public void getChars(int where,
int len,
javax.swing.text.Segment txt)
throws javax.swing.text.BadLocationException
getChars in interface javax.swing.text.AbstractDocument.Contentwhere - the starting offset >= 0len - the number of characters >= 0txt - the target location to copy into
javax.swing.text.BadLocationException - Thrown if the area covered by the arguments is not
contained in the character sequence.
public java.lang.String getString(int where,
int len)
throws javax.swing.text.BadLocationException
getString in interface javax.swing.text.AbstractDocument.Contentwhere - the starting offset >= 0len - the number of characters >= 0
javax.swing.text.BadLocationException - Thrown if the area covered by the arguments is not
contained in the character sequence.
public javax.swing.undo.UndoableEdit insertString(int where,
java.lang.String str)
throws javax.swing.text.BadLocationException
insertString in interface javax.swing.text.AbstractDocument.Contentjavax.swing.text.BadLocationExceptionpublic int length()
length in interface javax.swing.text.AbstractDocument.Content
public javax.swing.undo.UndoableEdit remove(int where,
int nitems)
throws javax.swing.text.BadLocationException
remove in interface javax.swing.text.AbstractDocument.Contentjavax.swing.text.BadLocationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||