public class DefaultEditorKit extends EditorKit
EditorKit. This EditorKit
a plain text Document and several commands that together
make up a basic editor, like cut / copy + paste.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultEditorKit.BeepAction
Creates a beep on the PC speaker.
|
static class |
DefaultEditorKit.CopyAction
Copies the selected content into the system clipboard.
|
static class |
DefaultEditorKit.CutAction
Copies the selected content into the system clipboard and deletes the
selection.
|
static class |
DefaultEditorKit.DefaultKeyTypedAction
This action is executed as default action when a KEY_TYPED
event is received and no keymap entry exists for that.
|
static class |
DefaultEditorKit.InsertBreakAction
This action inserts a newline character into the document
of the text component.
|
static class |
DefaultEditorKit.InsertContentAction
Places content into the associated editor.
|
static class |
DefaultEditorKit.InsertTabAction
Inserts a TAB character into the text editor.
|
static class |
DefaultEditorKit.PasteAction
Copies content from the system clipboard into the editor.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
backwardAction
The name of the
Action that moves the caret one character
backwards. |
static java.lang.String |
beepAction
The name of the
Action that creates a beep in the speaker. |
static java.lang.String |
beginAction
The name of the
Action that moves the caret to the beginning
of the Document. |
static java.lang.String |
beginLineAction
The name of the
Action that moves the caret to the beginning
of the current line. |
static java.lang.String |
beginParagraphAction
The name of the
Action that moves the caret to the beginning
of the current paragraph. |
static java.lang.String |
beginWordAction
The name of the
Action that moves the caret to the beginning
of the current word. |
static java.lang.String |
copyAction
The name of the
Action that copies the selected content
into the system clipboard. |
static java.lang.String |
cutAction
The name of the
Action that copies the selected content
into the system clipboard and removes the selection. |
static java.lang.String |
defaultKeyTypedAction
The name of the
Action that is performed by default if
a key is typed and there is no keymap entry. |
static java.lang.String |
deleteNextCharAction
The name of the
Action that deletes the character that
follows the current caret position. |
static java.lang.String |
deletePrevCharAction
The name of the
Action that deletes the character that
precedes the current caret position. |
static java.lang.String |
downAction
The name of the
Action that moves the caret one line down. |
static java.lang.String |
endAction
The name of the
Action that moves the caret to the end
of the Document. |
static java.lang.String |
endLineAction
The name of the
Action that moves the caret to the end
of the current line. |
static java.lang.String |
EndOfLineStringProperty
When a document is read and an CRLF is encountered, then we add a property
with this name and a value of "\r\n".
|
static java.lang.String |
endParagraphAction
The name of the
Action that moves the caret to the end
of the current paragraph. |
static java.lang.String |
endWordAction
The name of the
Action that moves the caret to the end
of the current word. |
static java.lang.String |
forwardAction
The name of the
Action that moves the caret one character
forward. |
static java.lang.String |
insertBreakAction
The name of the
Action that inserts a line break. |
static java.lang.String |
insertContentAction
The name of the
Action that inserts some content. |
static java.lang.String |
insertTabAction
The name of the
Action that inserts a TAB. |
static java.lang.String |
nextWordAction
The name of the
Action that moves the caret to the beginning
of the next word. |
static java.lang.String |
pageDownAction
The name of the
Action that moves the caret one page down. |
static java.lang.String |
pageUpAction
The name of the
Action that moves the caret one page up. |
static java.lang.String |
pasteAction
The name of the
Action that copies content from the system
clipboard into the document. |
static java.lang.String |
previousWordAction
The name of the
Action that moves the caret to the beginning
of the previous word. |
static java.lang.String |
readOnlyAction
The name of the
Action that sets the editor in read only
mode. |
static java.lang.String |
selectAllAction
The name of the
Action that selects the whole document. |
static java.lang.String |
selectionBackwardAction
The name of the
Action that moves the caret one character
backwards, possibly extending the current selection. |
static java.lang.String |
selectionBeginAction
The name of the
Action that moves the caret to the beginning
of the document, possibly extending the current selection. |
static java.lang.String |
selectionBeginLineAction
The name of the
Action that moves the caret to the beginning
of the current line, possibly extending the current selection. |
static java.lang.String |
selectionBeginParagraphAction
The name of the
Action that moves the caret to the beginning
of the current paragraph, possibly extending the current selection. |
static java.lang.String |
selectionBeginWordAction
The name of the
Action that moves the caret to the beginning
of the current word, possibly extending the current selection. |
static java.lang.String |
selectionDownAction
The name of the
Action that moves the caret one line down,
possibly extending the current selection. |
static java.lang.String |
selectionEndAction
The name of the
Action that moves the caret to the end
of the document, possibly extending the current selection. |
static java.lang.String |
selectionEndLineAction
The name of the
Action that moves the caret to the end
of the current line, possibly extending the current selection. |
static java.lang.String |
selectionEndParagraphAction
The name of the
Action that moves the caret to the end
of the current paragraph, possibly extending the current selection. |
static java.lang.String |
selectionEndWordAction
The name of the
Action that moves the caret to the end
of the current word, possibly extending the current selection. |
static java.lang.String |
selectionForwardAction
The name of the
Action that moves the caret one character
forwards, possibly extending the current selection. |
static java.lang.String |
selectionNextWordAction
The name of the
Action that moves the caret to the beginning
of the next word, possibly extending the current selection. |
static java.lang.String |
selectionPreviousWordAction
The name of the
Action that moves the caret to the beginning
of the previous word, possibly extending the current selection. |
static java.lang.String |
selectionUpAction
The name of the
Action that moves the caret one line up,
possibly extending the current selection. |
static java.lang.String |
selectLineAction
The name of the
Action that selects the line around the
caret. |
static java.lang.String |
selectParagraphAction
The name of the
Action that selects the paragraph around the
caret. |
static java.lang.String |
selectWordAction
The name of the
Action that selects the word around the
caret. |
static java.lang.String |
upAction
The name of the
Action that moves the caret one line up. |
static java.lang.String |
writableAction
The name of the
Action that sets the editor in read-write
mode. |
| Constructor and Description |
|---|
DefaultEditorKit()
Creates a new
DefaultEditorKit. |
| Modifier and Type | Method and Description |
|---|---|
Caret |
createCaret()
Creates the
Caret for this EditorKit. |
Document |
createDefaultDocument()
Creates the default
Document that this EditorKit
supports. |
javax.swing.Action[] |
getActions()
Returns the
Actions supported by this EditorKit. |
java.lang.String |
getContentType()
Returns the content type that this
EditorKit supports. |
ViewFactory |
getViewFactory()
Returns a
ViewFactory that is able to create Views for
the Elements that are used in this EditorKit's
model. |
void |
read(java.io.InputStream in,
Document document,
int offset)
Reads a document of the supported content type from an
InputStream
into the actual Document object. |
void |
read(java.io.Reader in,
Document document,
int offset)
Reads a document of the supported content type from a
Reader
into the actual Document object. |
void |
write(java.io.OutputStream out,
Document document,
int offset,
int len)
Writes the
Document (or a fragment of the
Document) to an OutputStream in the
supported content type format. |
void |
write(java.io.Writer out,
Document document,
int offset,
int len)
Writes the
Document (or a fragment of the
Document) to a Writer in the
supported content type format. |
public static final java.lang.String backwardAction
Action that moves the caret one character
backwards.getActions(),
Constant Field Valuespublic static final java.lang.String beepAction
Action that creates a beep in the speaker.getActions(),
Constant Field Valuespublic static final java.lang.String beginAction
Action that moves the caret to the beginning
of the Document.getActions(),
Constant Field Valuespublic static final java.lang.String beginLineAction
Action that moves the caret to the beginning
of the current line.getActions(),
Constant Field Valuespublic static final java.lang.String beginParagraphAction
Action that moves the caret to the beginning
of the current paragraph.getActions(),
Constant Field Valuespublic static final java.lang.String beginWordAction
Action that moves the caret to the beginning
of the current word.getActions(),
Constant Field Valuespublic static final java.lang.String copyAction
Action that copies the selected content
into the system clipboard.getActions(),
Constant Field Valuespublic static final java.lang.String cutAction
Action that copies the selected content
into the system clipboard and removes the selection.getActions(),
Constant Field Valuespublic static final java.lang.String defaultKeyTypedAction
Action that is performed by default if
a key is typed and there is no keymap entry.getActions(),
Constant Field Valuespublic static final java.lang.String deleteNextCharAction
Action that deletes the character that
follows the current caret position.getActions(),
Constant Field Valuespublic static final java.lang.String deletePrevCharAction
Action that deletes the character that
precedes the current caret position.getActions(),
Constant Field Valuespublic static final java.lang.String downAction
Action that moves the caret one line down.getActions(),
Constant Field Valuespublic static final java.lang.String endAction
Action that moves the caret to the end
of the Document.getActions(),
Constant Field Valuespublic static final java.lang.String endLineAction
Action that moves the caret to the end
of the current line.getActions(),
Constant Field Valuespublic static final java.lang.String EndOfLineStringProperty
public static final java.lang.String endParagraphAction
Action that moves the caret to the end
of the current paragraph.getActions(),
Constant Field Valuespublic static final java.lang.String endWordAction
Action that moves the caret to the end
of the current word.getActions(),
Constant Field Valuespublic static final java.lang.String forwardAction
Action that moves the caret one character
forward.getActions(),
Constant Field Valuespublic static final java.lang.String insertBreakAction
Action that inserts a line break.getActions(),
Constant Field Valuespublic static final java.lang.String insertContentAction
Action that inserts some content.getActions(),
Constant Field Valuespublic static final java.lang.String insertTabAction
Action that inserts a TAB.getActions(),
Constant Field Valuespublic static final java.lang.String nextWordAction
Action that moves the caret to the beginning
of the next word.getActions(),
Constant Field Valuespublic static final java.lang.String pageDownAction
Action that moves the caret one page down.getActions(),
Constant Field Valuespublic static final java.lang.String pageUpAction
Action that moves the caret one page up.getActions(),
Constant Field Valuespublic static final java.lang.String pasteAction
Action that copies content from the system
clipboard into the document.getActions(),
Constant Field Valuespublic static final java.lang.String previousWordAction
Action that moves the caret to the beginning
of the previous word.getActions(),
Constant Field Valuespublic static final java.lang.String readOnlyAction
Action that sets the editor in read only
mode.getActions(),
Constant Field Valuespublic static final java.lang.String selectAllAction
Action that selects the whole document.getActions(),
Constant Field Valuespublic static final java.lang.String selectionBackwardAction
Action that moves the caret one character
backwards, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionBeginAction
Action that moves the caret to the beginning
of the document, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionBeginLineAction
Action that moves the caret to the beginning
of the current line, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionBeginParagraphAction
Action that moves the caret to the beginning
of the current paragraph, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionBeginWordAction
Action that moves the caret to the beginning
of the current word, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionDownAction
Action that moves the caret one line down,
possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionEndAction
Action that moves the caret to the end
of the document, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionEndLineAction
Action that moves the caret to the end
of the current line, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionEndParagraphAction
Action that moves the caret to the end
of the current paragraph, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionEndWordAction
Action that moves the caret to the end
of the current word, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionForwardAction
Action that moves the caret one character
forwards, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionNextWordAction
Action that moves the caret to the beginning
of the next word, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionPreviousWordAction
Action that moves the caret to the beginning
of the previous word, possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectionUpAction
Action that moves the caret one line up,
possibly extending the current selection.getActions(),
Constant Field Valuespublic static final java.lang.String selectLineAction
Action that selects the line around the
caret.getActions(),
Constant Field Valuespublic static final java.lang.String selectParagraphAction
Action that selects the paragraph around the
caret.getActions(),
Constant Field Valuespublic static final java.lang.String selectWordAction
Action that selects the word around the
caret.getActions(),
Constant Field Valuespublic static final java.lang.String upAction
Action that moves the caret one line up.getActions(),
Constant Field Valuespublic static final java.lang.String writableAction
Action that sets the editor in read-write
mode.getActions(),
Constant Field Valuespublic DefaultEditorKit()
DefaultEditorKit.public Caret createCaret()
createCaret in class EditorKitCaret for this EditorKitpublic Document createDefaultDocument()
createDefaultDocument in class EditorKitDocument that this EditorKit
supportspublic javax.swing.Action[] getActions()
Actions supported by this EditorKit.getActions in class EditorKitActions supported by this EditorKitpublic java.lang.String getContentType()
EditorKit supports.
The DefaultEditorKit supports the content type
text/plain.getContentType in class EditorKitEditorKit supportspublic ViewFactory getViewFactory()
ViewFactory that is able to create Views for
the Elements that are used in this EditorKit's
model. This returns null which lets the UI of the text component supply
Views.getViewFactory in class EditorKitViewFactory that is able to create Views for
the Elements that are used in this
EditorKit's modelpublic void read(java.io.InputStream in, Document document, int offset) throws BadLocationException, java.io.IOException
InputStream
into the actual Document object.read in class EditorKitin - the stream from which to read the documentdocument - the document model into which the content is readoffset - the offset inside to document where the content is insertedBadLocationException - if offset is an invalid location
inside documentjava.io.IOException - if something goes wrong while reading from
inpublic void read(java.io.Reader in, Document document, int offset) throws BadLocationException, java.io.IOException
Reader
into the actual Document object.read in class EditorKitin - the reader from which to read the documentdocument - the document model into which the content is readoffset - the offset inside to document where the content is insertedBadLocationException - if offset is an invalid location
inside documentjava.io.IOException - if something goes wrong while reading from
inpublic void write(java.io.OutputStream out, Document document, int offset, int len) throws BadLocationException, java.io.IOException
Document (or a fragment of the
Document) to an OutputStream in the
supported content type format.write in class EditorKitout - the stream to write todocument - the document that should be written outoffset - the beginning offset from where to writelen - the length of the fragment to writeBadLocationException - if offset or
offset + lenis an invalid location inside
documentjava.io.IOException - if something goes wrong while writing to
outpublic void write(java.io.Writer out, Document document, int offset, int len) throws BadLocationException, java.io.IOException
Document (or a fragment of the
Document) to a Writer in the
supported content type format.write in class EditorKitout - the writer to write todocument - the document that should be written outoffset - the beginning offset from where to writelen - the length of the fragment to writeBadLocationException - if offset is an
invalid location inside document.java.io.IOException - if something goes wrong while writing to
out