gnu.kawa.swingviews
Class SwingContent
java.lang.Object
gnu.kawa.swingviews.SwingContent
- All Implemented Interfaces:
- javax.swing.text.AbstractDocument.Content
- Direct Known Subclasses:
- BufferContent
public class SwingContent
- extends java.lang.Object
- implements javax.swing.text.AbstractDocument.Content
A wrapper around a CharBuffer that implements Swing's Content.
This allows us to use a CharBuffer for a Document's Content.
Method Summary |
javax.swing.text.Position |
createPosition(int offset)
|
void |
getChars(int where,
int len,
javax.swing.text.Segment txt)
|
java.lang.String |
getString(int where,
int len)
|
javax.swing.undo.UndoableEdit |
insertString(int where,
java.lang.String str)
|
javax.swing.undo.UndoableEdit |
insertString(int where,
java.lang.String str,
boolean beforeMarkers)
|
int |
length()
|
javax.swing.undo.UndoableEdit |
remove(int where,
int nitems)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
buffer
public final CharBuffer buffer
SwingContent
public SwingContent(CharBuffer buffer)
SwingContent
public SwingContent(int initialSize)
SwingContent
public SwingContent()
length
public int length()
- Specified by:
length
in interface javax.swing.text.AbstractDocument.Content
getChars
public void getChars(int where,
int len,
javax.swing.text.Segment txt)
throws javax.swing.text.BadLocationException
- Specified by:
getChars
in interface javax.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:
getString
in interface javax.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:
remove
in interface javax.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:
insertString
in interface javax.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:
createPosition
in interface javax.swing.text.AbstractDocument.Content
- Throws:
javax.swing.text.BadLocationException