APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot.ui

public Class EditableAtEndDocument

extends PlainDocument
Class Inheritance
Imports
javax.swing.text.*

This class implements a special type of document in which edits can only be performed at the end, from "mark" to the end of the document. Thanks to Scott Violet for suggesting to subclass a Document implementation for this purpose. (Can't do it with DocumentEvents or UndoableEditEvents; however, in 1.4, there will be a DocumentFilter which will allow this kind of functionality.)

Field Summary

Modifier and TypeField and Description
private int
Inherited from javax.swing.text.PlainDocument:
lineLimitAttributetabSizeAttribute

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Used to reset the contents of this document

public String
public void
insertString(int offset, String text, AttributeSet a)

Overrides javax.swing.text.PlainDocument.insertString.

Implements javax.swing.text.Document.insertString.

Inserts some content into the document.

public void
remove(int offs, int len)

Overrides javax.swing.text.AbstractDocument.remove.

Implements javax.swing.text.Document.remove.

Removes some content from the document.

public void
Inherited from javax.swing.text.PlainDocument:
createDefaultRootgetDefaultRootElementgetParagraphElementinsertUpdateremoveUpdate

Field Detail

markback to summary
private int mark

Constructor Detail

EditableAtEndDocumentback to summary
public EditableAtEndDocument()

Method Detail

clearback to summary
public void clear()

Used to reset the contents of this document

getMarkedTextback to summary
public String getMarkedText() throws BadLocationException
insertStringback to summary
public void insertString(int offset, String text, AttributeSet a) throws BadLocationException

Overrides javax.swing.text.PlainDocument.insertString.

Implements javax.swing.text.Document.insertString.

Doc from javax.swing.text.PlainDocument.insertString.

Inserts some content into the document. Inserting content causes a write lock to be held while the actual changes are taking place, followed by notification to the observers on the thread that grabbed the write lock.

This method is thread safe, although most Swing methods are not. Please see Concurrency in Swing for more information.

Exceptions
BadLocationException:
the given insert position is not a valid position within the document
removeback to summary
public void remove(int offs, int len) throws BadLocationException

Overrides javax.swing.text.AbstractDocument.remove.

Implements javax.swing.text.Document.remove.

Doc from javax.swing.text.AbstractDocument.remove.

Removes some content from the document. Removing content causes a write lock to be held while the actual changes are taking place. Observers are notified of the change on the thread that called this method.

This method is thread safe, although most Swing methods are not. Please see Concurrency in Swing for more information.

Exceptions
BadLocationException:
the given remove position is not a valid position within the document
setMarkback to summary
public void setMark()