Package gnu.kawa.swingviews
Class SwingContent
- java.lang.Object
-
- gnu.kawa.swingviews.SwingContent
-
- All Implemented Interfaces:
javax.swing.text.AbstractDocument.Content
public class SwingContent extends java.lang.Object implements javax.swing.text.AbstractDocument.ContentA 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 javax.swing.text.PositioncreatePosition(int offset)voidgetChars(int where, int len, javax.swing.text.Segment txt)java.lang.StringgetString(int where, int len)javax.swing.undo.UndoableEditinsertString(int where, java.lang.String str)javax.swing.undo.UndoableEditinsertString(int where, java.lang.String str, boolean beforeMarkers)intlength()javax.swing.undo.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 interfacejavax.swing.text.AbstractDocument.Content
-
getChars
public void getChars(int where, int len, javax.swing.text.Segment txt) throws javax.swing.text.BadLocationException- Specified by:
getCharsin interfacejavax.swing.text.AbstractDocument.Content- Throws:
javax.swing.text.BadLocationException
-
getString
public java.lang.String getString(int where, int len) throws javax.swing.text.BadLocationException- Specified by:
getStringin interfacejavax.swing.text.AbstractDocument.Content- Throws:
javax.swing.text.BadLocationException
-
remove
public javax.swing.undo.UndoableEdit remove(int where, int nitems) throws javax.swing.text.BadLocationException- Specified by:
removein interfacejavax.swing.text.AbstractDocument.Content- Throws:
javax.swing.text.BadLocationException
-
insertString
public javax.swing.undo.UndoableEdit insertString(int where, java.lang.String str, boolean beforeMarkers) throws javax.swing.text.BadLocationException- Throws:
javax.swing.text.BadLocationException
-
insertString
public javax.swing.undo.UndoableEdit insertString(int where, java.lang.String str) throws javax.swing.text.BadLocationException- Specified by:
insertStringin interfacejavax.swing.text.AbstractDocument.Content- Throws:
javax.swing.text.BadLocationException
-
createPosition
public javax.swing.text.Position createPosition(int offset) throws javax.swing.text.BadLocationException- Specified by:
createPositionin interfacejavax.swing.text.AbstractDocument.Content- Throws:
javax.swing.text.BadLocationException
-
-