gnu.kawa.swingviews

Class SwingContent

Implemented Interfaces:
javax.swing.text.AbstractDocument.Content
Known Direct 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.

Field Summary

CharBuffer
buffer

Constructor Summary

SwingContent()
SwingContent(CharBuffer buffer)
SwingContent(int initialSize)

Method Summary

javax.swing.text.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 Details

buffer

public final CharBuffer buffer

Constructor Details

SwingContent

public SwingContent()

SwingContent

public SwingContent(CharBuffer buffer)

SwingContent

public SwingContent(int initialSize)

Method Details

createPosition

public javax.swing.text.Position createPosition(int offset)
            throws BadLocationException

getChars

public void getChars(int where,
                     int len,
                     Segment txt)
            throws BadLocationException

getString

public String getString(int where,
                        int len)
            throws BadLocationException

insertString

public UndoableEdit insertString(int where,
                                 String str)
            throws BadLocationException

insertString

public UndoableEdit insertString(int where,
                                 String str,
                                 boolean beforeMarkers)
            throws BadLocationException

length

public int length()

remove

public UndoableEdit remove(int where,
                           int nitems)
            throws BadLocationException