javax.swing.text
public class DefaultEditorKit extends EditorKit
EditorKit
a plain text Document
and several commands that together
make up a basic editor, like cut / copy + paste.
Nested Class Summary | |
---|---|
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.
|
Field Summary | |
---|---|
static String | backwardAction
The name of the Action that moves the caret one character
backwards.
|
static String | beepAction
The name of the Action that creates a beep in the speaker.
|
static String | beginAction
The name of the Action that moves the caret to the beginning
of the Document .
|
static String | beginLineAction
The name of the Action that moves the caret to the beginning
of the current line.
|
static String | beginParagraphAction
The name of the Action that moves the caret to the beginning
of the current paragraph.
|
static String | beginWordAction
The name of the Action that moves the caret to the beginning
of the current word.
|
static String | copyAction
The name of the Action that copies the selected content
into the system clipboard.
|
static String | cutAction
The name of the Action that copies the selected content
into the system clipboard and removes the selection.
|
static String | defaultKeyTypedAction
The name of the Action that is performed by default if
a key is typed and there is no keymap entry.
|
static String | deleteNextCharAction
The name of the Action that deletes the character that
follows the current caret position.
|
static String | deletePrevCharAction
The name of the Action that deletes the character that
precedes the current caret position.
|
static String | downAction
The name of the Action that moves the caret one line down.
|
static String | endAction
The name of the Action that moves the caret to the end
of the Document .
|
static String | endLineAction
The name of the Action that moves the caret to the end
of the current line.
|
static String | endParagraphAction
The name of the Action that moves the caret to the end
of the current paragraph.
|
static String | endWordAction
The name of the Action that moves the caret to the end
of the current word.
|
static 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 String | forwardAction
The name of the Action that moves the caret one character
forward.
|
static String | insertBreakAction
The name of the Action that inserts a line break.
|
static String | insertContentAction
The name of the Action that inserts some content.
|
static String | insertTabAction
The name of the Action that inserts a TAB.
|
static String | nextWordAction
The name of the Action that moves the caret to the beginning
of the next word.
|
static String | pageDownAction
The name of the Action that moves the caret one page down.
|
static String | pageUpAction
The name of the Action that moves the caret one page up.
|
static String | pasteAction
The name of the Action that copies content from the system
clipboard into the document.
|
static String | previousWordAction
The name of the Action that moves the caret to the beginning
of the previous word.
|
static String | readOnlyAction
The name of the Action that sets the editor in read only
mode.
|
static String | selectAllAction
The name of the Action that selects the whole document.
|
static String | selectionBackwardAction
The name of the Action that moves the caret one character
backwards, possibly extending the current selection.
|
static String | selectionBeginAction
The name of the Action that moves the caret to the beginning
of the document, possibly extending the current selection.
|
static String | selectionBeginLineAction
The name of the Action that moves the caret to the beginning
of the current line, possibly extending the current selection.
|
static String | selectionBeginParagraphAction
The name of the Action that moves the caret to the beginning
of the current paragraph, possibly extending the current selection.
|
static String | selectionBeginWordAction
The name of the Action that moves the caret to the beginning
of the current word, possibly extending the current selection.
|
static String | selectionDownAction
The name of the Action that moves the caret one line down,
possibly extending the current selection.
|
static String | selectionEndAction
The name of the Action that moves the caret to the end
of the document, possibly extending the current selection.
|
static String | selectionEndLineAction
The name of the Action that moves the caret to the end
of the current line, possibly extending the current selection.
|
static String | selectionEndParagraphAction
The name of the Action that moves the caret to the end
of the current paragraph, possibly extending the current selection.
|
static String | selectionEndWordAction
The name of the Action that moves the caret to the end
of the current word, possibly extending the current selection.
|
static String | selectionForwardAction
The name of the Action that moves the caret one character
forwards, possibly extending the current selection.
|
static String | selectionNextWordAction
The name of the Action that moves the caret to the beginning
of the next word, possibly extending the current selection.
|
static String | selectionPreviousWordAction
The name of the Action that moves the caret to the beginning
of the previous word, possibly extending the current selection.
|
static String | selectionUpAction
The name of the Action that moves the caret one line up,
possibly extending the current selection.
|
static String | selectLineAction
The name of the Action that selects the line around the
caret.
|
static String | selectParagraphAction
The name of the Action that selects the paragraph around the
caret.
|
static String | selectWordAction
The name of the Action that selects the word around the
caret.
|
static String | upAction
The name of the Action that moves the caret one line up.
|
static String | writableAction
The name of the Action that sets the editor in read-write
mode.
|
Constructor Summary | |
---|---|
DefaultEditorKit()
Creates a new DefaultEditorKit . |
Method Summary | |
---|---|
Caret | createCaret()
Creates the Caret for this EditorKit . |
Document | createDefaultDocument()
Creates the default {@link Document} that this EditorKit
supports. |
Action[] | getActions()
Returns the Action s supported by this EditorKit .
|
String | getContentType()
Returns the content type that this EditorKit supports.
|
ViewFactory | getViewFactory()
Returns a {@link ViewFactory} that is able to create {@link View}s for
the Element s that are used in this EditorKit 's
model. |
void | read(InputStream in, Document document, int offset)
Reads a document of the supported content type from an {@link InputStream}
into the actual {@link Document} object.
|
void | read(Reader in, Document document, int offset)
Reads a document of the supported content type from a {@link Reader}
into the actual {@link Document} object.
|
void | write(OutputStream out, Document document, int offset, int len)
Writes the Document (or a fragment of the
Document ) to an {@link OutputStream} in the
supported content type format.
|
void | write(Writer out, Document document, int offset, int len)
Writes the Document (or a fragment of the
Document ) to a {@link Writer} in the
supported content type format.
|
Action
that moves the caret one character
backwards.
See Also: getActions
Action
that creates a beep in the speaker.
See Also: getActions
Action
that moves the caret to the beginning
of the current line.
See Also: getActions
Action
that moves the caret to the beginning
of the current paragraph.
See Also: getActions
Action
that moves the caret to the beginning
of the current word.
See Also: getActions
Action
that copies the selected content
into the system clipboard.
See Also: getActions
Action
that copies the selected content
into the system clipboard and removes the selection.
See Also: getActions
Action
that is performed by default if
a key is typed and there is no keymap entry.
See Also: getActions
Action
that deletes the character that
follows the current caret position.
See Also: getActions
Action
that deletes the character that
precedes the current caret position.
See Also: getActions
Action
that moves the caret one line down.
See Also: getActions
Action
that moves the caret to the end
of the current line.
See Also: getActions
Action
that moves the caret to the end
of the current paragraph.
See Also: getActions
Action
that moves the caret to the end
of the current word.
See Also: getActions
Action
that moves the caret one character
forward.
See Also: getActions
Action
that inserts a line break.
See Also: getActions
Action
that inserts some content.
See Also: getActions
Action
that inserts a TAB.
See Also: getActions
Action
that moves the caret to the beginning
of the next word.
See Also: getActions
Action
that moves the caret one page down.
See Also: getActions
Action
that moves the caret one page up.
See Also: getActions
Action
that copies content from the system
clipboard into the document.
See Also: getActions
Action
that moves the caret to the beginning
of the previous word.
See Also: getActions
Action
that sets the editor in read only
mode.
See Also: getActions
Action
that selects the whole document.
See Also: getActions
Action
that moves the caret one character
backwards, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the beginning
of the document, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the beginning
of the current line, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the beginning
of the current paragraph, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the beginning
of the current word, possibly extending the current selection.
See Also: getActions
Action
that moves the caret one line down,
possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the end
of the document, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the end
of the current line, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the end
of the current paragraph, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the end
of the current word, possibly extending the current selection.
See Also: getActions
Action
that moves the caret one character
forwards, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the beginning
of the next word, possibly extending the current selection.
See Also: getActions
Action
that moves the caret to the beginning
of the previous word, possibly extending the current selection.
See Also: getActions
Action
that moves the caret one line up,
possibly extending the current selection.
See Also: getActions
Action
that selects the line around the
caret.
See Also: getActions
Action
that selects the paragraph around the
caret.
See Also: getActions
Action
that selects the word around the
caret.
See Also: getActions
Action
that moves the caret one line up.
See Also: getActions
Action
that sets the editor in read-write
mode.
See Also: getActions
DefaultEditorKit
.Caret
for this EditorKit
. This
returns a {@link DefaultCaret} in this case.
Returns: the Caret
for this EditorKit
EditorKit
supports. This is a {@link PlainDocument} in this case.
Returns: the default {@link Document} that this EditorKit
supports
Action
s supported by this EditorKit
.
Returns: the Action
s supported by this EditorKit
EditorKit
supports.
The DefaultEditorKit
supports the content type
text/plain
.
Returns: the content type that this EditorKit
supports
Element
s that are used in this EditorKit
's
model. This returns null which lets the UI of the text component supply
View
s.
Returns: a {@link ViewFactory} that is able to create {@link View}s for
the Element
s that are used in this
EditorKit
's model
Parameters: in the stream from which to read the document document the document model into which the content is read offset the offset inside to document where the content is inserted
Throws: BadLocationException if offset
is an invalid location
inside document
IOException if something goes wrong while reading from
in
Parameters: in the reader from which to read the document document the document model into which the content is read offset the offset inside to document where the content is inserted
Throws: BadLocationException if offset
is an invalid location
inside document
IOException if something goes wrong while reading from
in
Document
(or a fragment of the
Document
) to an {@link OutputStream} in the
supported content type format.
Parameters: out the stream to write to document the document that should be written out offset the beginning offset from where to write len the length of the fragment to write
Throws: BadLocationException if offset
or
offset + len
is an invalid location inside
document
IOException if something goes wrong while writing to
out
Document
(or a fragment of the
Document
) to a {@link Writer} in the
supported content type format.
Parameters: out the writer to write to document the document that should be written out offset the beginning offset from where to write len the length of the fragment to write
Throws: BadLocationException if offset
is an
invalid location inside document
. IOException if something goes wrong while writing to
out