public class DefaultEditorKit extends EditorKit
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultEditorKit
Creates a beep.
|
static class |
DefaultEditorKit
Copies the selected region and place its contents into the system clipboard.
|
static class |
DefaultEditorKit
Cuts the selected region and place its contents into the system clipboard.
|
static class |
DefaultEditorKit
The action that is executed by default if a
key typed event is received and there is no keymap entry.
|
static class |
DefaultEditorKit
Places a line/paragraph break into the document.
|
static class |
DefaultEditorKit
Places content into the associated document.
|
static class |
DefaultEditorKit
Places a tab character into the document.
|
static class |
DefaultEditorKit
Pastes the contents of the system clipboard into the selected region, or before the caret if nothing is selected.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
backwardAction
Name of the Action for moving the caret logically backward one position.
|
static String |
beepAction
Name of the action to create a beep.
|
static String |
beginAction
Name of the
Action for moving the caret to the beginning of the document.
|
static String |
beginLineAction
Name of the
Action for moving the caret to the beginning of a line.
|
static String |
beginParagraphAction
Name of the
Action for moving the caret to the beginning of a paragraph.
|
static String |
beginWordAction
Name of the
Action for moving the caret to the beginning of a word.
|
static String |
copyAction
Name of the action to copy the selected region and place the contents into the system clipboard.
|
static String |
cutAction
Name of the action to cut the selected region and place the contents into the system clipboard.
|
static String |
defaultKeyTypedAction
Name of the action that is executed by default if a
key typed event is received and there is no keymap entry.
|
static String |
deleteNextCharAction
Name of the action to delete the character of content that follows the current caret position.
|
static String |
deleteNextWordAction
Name of the action to delete the word that follows the beginning of the selection.
|
static String |
deletePrevCharAction
Name of the action to delete the character of content that precedes the current caret position.
|
static String |
deletePrevWordAction
Name of the action to delete the word that precedes the beginning of the selection.
|
static String |
downAction
Name of the Action for moving the caret logically downward one position.
|
static String |
endAction
Name of the
Action for moving the caret to the end of the document.
|
static String |
endLineAction
Name of the
Action for moving the caret to the end of a line.
|
static String |
EndOfLineStringProperty
When reading a document if a CRLF is encountered a property with this name is added and the value will be "\r\n".
|
static String |
endParagraphAction
Name of the
Action for moving the caret to the end of a paragraph.
|
static String |
endWordAction
Name of the Action for moving the caret to the end of a word.
|
static String |
forwardAction
Name of the Action for moving the caret logically forward one position.
|
static String |
insertBreakAction
Name of the action to place a line/paragraph break into the document.
|
static String |
insertContentAction
Name of the action to place content into the associated document.
|
static String |
insertTabAction
Name of the action to place a tab character into the document.
|
static String |
nextWordAction
Name of the
Action for moving the caret to the beginning of the next word.
|
static String |
pageDownAction
Name of the action to page down vertically.
|
static String |
pageUpAction
Name of the action to page up vertically.
|
static String |
pasteAction
Name of the action to paste the contents of the system clipboard into the selected region, or before the caret if nothing is selected.
|
static String |
previousWordAction
Name of the
Action for moving the caret to the beginning of the previous word.
|
static String |
readOnlyAction
Name of the action to set the editor into read-only mode.
|
static String |
selectAllAction
Name of the Action for selecting the entire document
|
static String |
selectionBackwardAction
Name of the Action for extending the selection by moving the caret logically backward one position.
|
static String |
selectionBeginAction
Name of the
Action for moving the caret to the beginning of the document.
|
static String |
selectionBeginLineAction
Name of the
Action for moving the caret to the beginning of a line, extending the selection.
|
static String |
selectionBeginParagraphAction
Name of the
Action for moving the caret to the beginning of a paragraph, extending the selection.
|
static String |
selectionBeginWordAction
Name of the
Action for moving the caret to the beginning of a word, extending the selection.
|
static String |
selectionDownAction
Name of the Action for moving the caret logically downward one position, extending the selection.
|
static String |
selectionEndAction
Name of the Action for moving the caret to the end of the document.
|
static String |
selectionEndLineAction
Name of the
Action for moving the caret to the end of a line, extending the selection.
|
static String |
selectionEndParagraphAction
Name of the
Action for moving the caret to the end of a paragraph, extending the selection.
|
static String |
selectionEndWordAction
Name of the Action for moving the caret to the end of a word, extending the selection.
|
static String |
selectionForwardAction
Name of the Action for extending the selection by moving the caret logically forward one position.
|
static String |
selectionNextWordAction
Name of the
Action for moving the selection to the beginning of the next word, extending the selection.
|
static String |
selectionPreviousWordAction
Name of the
Action for moving the selection to the beginning of the previous word, extending the selection.
|
static String |
selectionUpAction
Name of the Action for moving the caret logically upward one position, extending the selection.
|
static String |
selectLineAction
Name of the Action for selecting a line around the caret.
|
static String |
selectParagraphAction
Name of the Action for selecting a paragraph around the caret.
|
static String |
selectWordAction
Name of the Action for selecting a word around the caret.
|
static String |
upAction
Name of the Action for moving the caret logically upward one position.
|
static String |
writableAction
Name of the action to set the editor into writeable mode.
|
| Constructor and Description |
|---|
DefaultEditorKit()
default constructor for DefaultEditorKit
|
| Modifier and Type | Method and Description |
|---|---|
Caret |
createCaret()
Fetches a caret that can navigate through views produced by the associated ViewFactory.
|
Document |
createDefaultDocument()
Creates an uninitialized text storage model (PlainDocument) that is appropriate for this type of editor.
|
Action |
getActions()
Fetches the set of commands that can be used on a text component that is using a model and view produced by this kit.
|
String |
getContentType()
Gets the MIME type of the data that this kit represents support for.
|
ViewFactory |
getViewFactory()
Fetches a factory that is suitable for producing views of any models that are produced by this kit.
|
void |
read(InputStream
Inserts content from the given stream which is expected to be in a format appropriate for this kind of content handler.
|
void |
read(Reader
Inserts content from the given stream, which will be treated as plain text.
|
void |
write(OutputStream
Writes content from a document to the given stream in a format appropriate for this kind of content handler.
|
void |
write(Writer
Writes content from a document to the given stream as plain text.
|
public static final StringEndOfLineStringProperty
public static final StringinsertContentAction
getActions(),
Constant Field Values
public static final StringinsertBreakAction
getActions(),
Constant Field Values
public static final StringinsertTabAction
getActions(),
Constant Field Values
public static final StringdeletePrevCharAction
getActions(),
Constant Field Values
public static final StringdeleteNextCharAction
getActions(),
Constant Field Values
public static final StringdeleteNextWordAction
getActions(),
JTextComponent.getSelectionStart() ,
Constant Field Values
public static final StringdeletePrevWordAction
getActions(),
JTextComponent.getSelectionStart() ,
Constant Field Values
public static final StringreadOnlyAction
getActions(),
Constant Field Values
public static final StringwritableAction
getActions(),
Constant Field Values
public static final StringcutAction
JTextComponent.cut() ,
getActions(),
Constant Field Values
public static final StringcopyAction
JTextComponent.copy() ,
getActions(),
Constant Field Values
public static final StringpasteAction
JTextComponent.paste() ,
getActions(),
Constant Field Values
public static final StringbeepAction
getActions(),
Constant Field Values
public static final StringpageUpAction
getActions(),
Constant Field Values
public static final StringpageDownAction
getActions(),
Constant Field Values
public static final StringforwardAction
getActions(),
Constant Field Values
public static final StringbackwardAction
getActions(),
Constant Field Values
public static final StringselectionForwardAction
getActions(),
Constant Field Values
public static final StringselectionBackwardAction
getActions(),
Constant Field Values
public static final StringupAction
getActions(),
Constant Field Values
public static final StringdownAction
getActions(),
Constant Field Values
public static final StringselectionUpAction
getActions(),
Constant Field Values
public static final StringselectionDownAction
getActions(),
Constant Field Values
public static final StringbeginWordAction
Action for moving the caret to the beginning of a word.
getActions(),
Constant Field Values
public static final StringendWordAction
getActions(),
Constant Field Values
public static final StringselectionBeginWordAction
Action for moving the caret to the beginning of a word, extending the selection.
getActions(),
Constant Field Values
public static final StringselectionEndWordAction
getActions(),
Constant Field Values
public static final StringpreviousWordAction
Action for moving the caret to the beginning of the previous word.
getActions(),
Constant Field Values
public static final StringnextWordAction
Action for moving the caret to the beginning of the next word.
getActions(),
Constant Field Values
public static final StringselectionPreviousWordAction
Action for moving the selection to the beginning of the previous word, extending the selection.
getActions(),
Constant Field Values
public static final StringselectionNextWordAction
Action for moving the selection to the beginning of the next word, extending the selection.
getActions(),
Constant Field Values
public static final StringbeginLineAction
Action for moving the caret to the beginning of a line.
getActions(),
Constant Field Values
public static final StringendLineAction
Action for moving the caret to the end of a line.
getActions(),
Constant Field Values
public static final StringselectionBeginLineAction
Action for moving the caret to the beginning of a line, extending the selection.
getActions(),
Constant Field Values
public static final StringselectionEndLineAction
Action for moving the caret to the end of a line, extending the selection.
getActions(),
Constant Field Values
public static final StringbeginParagraphAction
Action for moving the caret to the beginning of a paragraph.
getActions(),
Constant Field Values
public static final StringendParagraphAction
Action for moving the caret to the end of a paragraph.
getActions(),
Constant Field Values
public static final StringselectionBeginParagraphAction
Action for moving the caret to the beginning of a paragraph, extending the selection.
getActions(),
Constant Field Values
public static final StringselectionEndParagraphAction
Action for moving the caret to the end of a paragraph, extending the selection.
getActions(),
Constant Field Values
public static final StringbeginAction
Action for moving the caret to the beginning of the document.
getActions(),
Constant Field Values
public static final StringendAction
Action for moving the caret to the end of the document.
getActions(),
Constant Field Values
public static final StringselectionBeginAction
Action for moving the caret to the beginning of the document.
getActions(),
Constant Field Values
public static final StringselectionEndAction
getActions(),
Constant Field Values
public static final StringselectWordAction
getActions(),
Constant Field Values
public static final StringselectLineAction
getActions(),
Constant Field Values
public static final StringselectParagraphAction
getActions(),
Constant Field Values
public static final StringselectAllAction
getActions(),
Constant Field Values
public static final StringdefaultKeyTypedAction
getActions(),
Constant Field Values
public DefaultEditorKit()
public StringgetContentType()
text/plain.
getContentType in class
EditorKit
public ViewFactorygetViewFactory()
getViewFactory in class
EditorKit
public Action[] getActions()
getActions in class
EditorKit
public CaretcreateCaret()
createCaret in class
EditorKit
public DocumentcreateDefaultDocument()
createDefaultDocument in class
EditorKit
public void read(InputStreamin, Document doc, int pos) throws IOException , BadLocationException
read in class
EditorKit
in - The stream to read from
doc - The destination for the insertion.
pos - The location in the document to place the content >=0.
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
public void write(OutputStreamout, Document doc, int pos, int len) throws IOException , BadLocationException
write in class
EditorKit
out - The stream to write to
doc - The source for the write.
pos - The location in the document to fetch the content >=0.
len - The amount to write out >=0.
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
public void read(Readerin, Document doc, int pos) throws IOException , BadLocationException
read in class
EditorKit
in - The stream to read from
doc - The destination for the insertion.
pos - The location in the document to place the content >=0.
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
public void write(Writerout, Document doc, int pos, int len) throws IOException , BadLocationException
write in class
EditorKit
out - The stream to write to
doc - The source for the write.
pos - The location in the document to fetch the content from >=0.
len - The amount to write out >=0.
IOException - on any I/O error
BadLocationException - if pos is not within 0 and the length of the document.