Package gnu.kawa.swingviews
Class SwingContent
- java.lang.Object
-
- gnu.kawa.swingviews.SwingContent
-
- All Implemented Interfaces:
AbstractDocument.Content
public class SwingContent extends Object implements AbstractDocument.Content
A wrapper around a CharBuffer that implements Swing's Content. This allows us to use a CharBuffer for a Document's Content.
-
-
Field Summary
Fields Modifier and Type Field Description CharBuffer
buffer
-
Constructor Summary
Constructors Constructor Description SwingContent()
SwingContent(int initialSize)
SwingContent(CharBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
createPosition(int offset)
void
getChars(int where, int len, Segment txt)
String
getString(int where, int len)
UndoableEdit
insertString(int where, String str)
UndoableEdit
insertString(int where, String str, boolean beforeMarkers)
int
length()
UndoableEdit
remove(int where, int nitems)
-
-
-
Field Detail
-
buffer
public final CharBuffer buffer
-
-
Constructor Detail
-
SwingContent
public SwingContent(CharBuffer buffer)
-
SwingContent
public SwingContent(int initialSize)
-
SwingContent
public SwingContent()
-
-
Method Detail
-
length
public int length()
- Specified by:
length
in interfaceAbstractDocument.Content
-
getChars
public void getChars(int where, int len, Segment txt) throws BadLocationException
- Specified by:
getChars
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
getString
public String getString(int where, int len) throws BadLocationException
- Specified by:
getString
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
remove
public UndoableEdit remove(int where, int nitems) throws BadLocationException
- Specified by:
remove
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
insertString
public UndoableEdit insertString(int where, String str, boolean beforeMarkers) throws BadLocationException
- Throws:
BadLocationException
-
insertString
public UndoableEdit insertString(int where, String str) throws BadLocationException
- Specified by:
insertString
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
createPosition
public Position createPosition(int offset) throws BadLocationException
- Specified by:
createPosition
in interfaceAbstractDocument.Content
- Throws:
BadLocationException
-
-