Module java.desktop

Class DefaultEditorKit

java.lang.Object
javax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
StyledEditorKit

public class DefaultEditorKit
extends EditorKit
This is the set of things needed by a text component to be a reasonably functioning editor for some type of text document. This implementation provides a default implementation which treats text as plain text and provides a minimal set of actions for a simple editor.
Newlines
There are two properties which deal with newlines. The system property, line.separator, is defined to be platform-dependent, either "\n", "\r", or "\r\n". There is also a property defined in DefaultEditorKit, called EndOfLineStringProperty, which is defined automatically when a document is loaded, to be the first occurrence of any of the newline characters. When a document is loaded, EndOfLineStringProperty is set appropriately, and when the document is written back out, the EndOfLineStringProperty is used. But while the document is in memory, the "\n" character is used to define a newline, regardless of how the newline is defined when the document is on disk. Therefore, for searching purposes, "\n" should always be used. When a new document is created, and the EndOfLineStringProperty has not been defined, it will use the System property when writing out the document.

Note that EndOfLineStringProperty is set on the Document using the get/putProperty methods. Subclasses may override this behavior.