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 CharBufferbuffer
-
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 PositioncreatePosition(int offset)voidgetChars(int where, int len, Segment txt)StringgetString(int where, int len)UndoableEditinsertString(int where, String str)UndoableEditinsertString(int where, String str, boolean beforeMarkers)intlength()UndoableEditremove(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:
lengthin interfaceAbstractDocument.Content
-
getChars
public void getChars(int where, int len, Segment txt) throws BadLocationException- Specified by:
getCharsin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
getString
public String getString(int where, int len) throws BadLocationException
- Specified by:
getStringin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
remove
public UndoableEdit remove(int where, int nitems) throws BadLocationException
- Specified by:
removein 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:
insertStringin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
createPosition
public Position createPosition(int offset) throws BadLocationException
- Specified by:
createPositionin interfaceAbstractDocument.Content- Throws:
BadLocationException
-
-