| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectjavax.swing.text.EditorKitjavax.swing.text.DefaultEditorKitpublic class DefaultEditorKitextends EditorKitEditorKit. This EditorKit
a plain text Document and several commands that together
make up a basic editor, like cut / copy + paste.
Nested Class Summary | |
static class |
|
static class |
|
static class |
|
static class |
|
static class |
|
static class |
|
static class |
|
static class |
|
Field Summary | |
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
Constructor Summary | |
| |
Method Summary | |
Caret |
|
Document |
|
Action[] |
|
String |
|
ViewFactory |
|
void |
|
void | |
void |
|
void | |
Methods inherited from class javax.swing.text.EditorKit | |
clone, createCaret, createDefaultDocument, deinstall, getActions, getContentType, getViewFactory, install, read, read, write, write | |
Methods inherited from class java.lang.Object | |
clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait | |
public static final 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".
- Field Value:
- "__EndOfLine__"
public static final String backwardAction
The name of theActionthat moves the caret one character backwards.
- Field Value:
- "caret-backward"
- See Also:
getActions()
public static final String beepAction
The name of theActionthat creates a beep in the speaker.
- Field Value:
- "beep"
- See Also:
getActions()
public static final String beginAction
The name of theActionthat moves the caret to the beginning of theDocument.
- Field Value:
- "caret-begin"
- See Also:
getActions()
public static final String beginLineAction
The name of theActionthat moves the caret to the beginning of the current line.
- Field Value:
- "caret-begin-line"
- See Also:
getActions()
public static final String beginParagraphAction
The name of theActionthat moves the caret to the beginning of the current paragraph.
- Field Value:
- "caret-begin-paragraph"
- See Also:
getActions()
public static final String beginWordAction
The name of theActionthat moves the caret to the beginning of the current word.
- Field Value:
- "caret-begin-word"
- See Also:
getActions()
public static final String copyAction
The name of theActionthat copies the selected content into the system clipboard.
- Field Value:
- "copy-to-clipboard"
- See Also:
getActions()
public static final String cutAction
The name of theActionthat copies the selected content into the system clipboard and removes the selection.
- Field Value:
- "cut-to-clipboard"
- See Also:
getActions()
public static final String defaultKeyTypedAction
The name of theActionthat is performed by default if a key is typed and there is no keymap entry.
- Field Value:
- "default-typed"
- See Also:
getActions()
public static final String deleteNextCharAction
The name of theActionthat deletes the character that follows the current caret position.
- Field Value:
- "delete-next"
- See Also:
getActions()
public static final String deletePrevCharAction
The name of theActionthat deletes the character that precedes the current caret position.
- Field Value:
- "delete-previous"
- See Also:
getActions()
public static final String downAction
The name of theActionthat moves the caret one line down.
- Field Value:
- "caret-down"
- See Also:
getActions()
public static final String endAction
The name of theActionthat moves the caret to the end of theDocument.
- Field Value:
- "caret-end"
- See Also:
getActions()
public static final String endLineAction
The name of theActionthat moves the caret to the end of the current line.
- Field Value:
- "caret-end-line"
- See Also:
getActions()
public static final String endParagraphAction
The name of theActionthat moves the caret to the end of the current paragraph.
- Field Value:
- "caret-end-paragraph"
- See Also:
getActions()
public static final String endWordAction
The name of theActionthat moves the caret to the end of the current word.
- Field Value:
- "caret-end-word"
- See Also:
getActions()
public static final String forwardAction
The name of theActionthat moves the caret one character forward.
- Field Value:
- "caret-forward"
- See Also:
getActions()
public static final String insertBreakAction
The name of theActionthat inserts a line break.
- Field Value:
- "insert-break"
- See Also:
getActions()
public static final String insertContentAction
The name of theActionthat inserts some content.
- Field Value:
- "insert-content"
- See Also:
getActions()
public static final String insertTabAction
The name of theActionthat inserts a TAB.
- Field Value:
- "insert-tab"
- See Also:
getActions()
public static final String nextWordAction
The name of theActionthat moves the caret to the beginning of the next word.
- Field Value:
- "caret-next-word"
- See Also:
getActions()
public static final String pageDownAction
The name of theActionthat moves the caret one page down.
- Field Value:
- "page-down"
- See Also:
getActions()
public static final String pageUpAction
The name of theActionthat moves the caret one page up.
- Field Value:
- "page-up"
- See Also:
getActions()
public static final String pasteAction
The name of theActionthat copies content from the system clipboard into the document.
- Field Value:
- "paste-from-clipboard"
- See Also:
getActions()
public static final String previousWordAction
The name of theActionthat moves the caret to the beginning of the previous word.
- Field Value:
- "caret-previous-word"
- See Also:
getActions()
public static final String readOnlyAction
The name of theActionthat sets the editor in read only mode.
- Field Value:
- "set-read-only"
- See Also:
getActions()
public static final String selectAllAction
The name of theActionthat selects the whole document.
- Field Value:
- "select-all"
- See Also:
getActions()
public static final String selectLineAction
The name of theActionthat selects the line around the caret.
- Field Value:
- "select-line"
- See Also:
getActions()
public static final String selectParagraphAction
The name of theActionthat selects the paragraph around the caret.
- Field Value:
- "select-paragraph"
- See Also:
getActions()
public static final String selectWordAction
The name of theActionthat selects the word around the caret.
- Field Value:
- "select-word"
- See Also:
getActions()
public static final String selectionBackwardAction
The name of theActionthat moves the caret one character backwards, possibly extending the current selection.
- Field Value:
- "selection-backward"
- See Also:
getActions()
public static final String selectionBeginAction
The name of theActionthat moves the caret to the beginning of the document, possibly extending the current selection.
- Field Value:
- "selection-begin"
- See Also:
getActions()
public static final String selectionBeginLineAction
The name of theActionthat moves the caret to the beginning of the current line, possibly extending the current selection.
- Field Value:
- "selection-begin-line"
- See Also:
getActions()
public static final String selectionBeginParagraphAction
The name of theActionthat moves the caret to the beginning of the current paragraph, possibly extending the current selection.
- Field Value:
- "selection-begin-paragraph"
- See Also:
getActions()
public static final String selectionBeginWordAction
The name of theActionthat moves the caret to the beginning of the current word, possibly extending the current selection.
- Field Value:
- "selection-begin-word"
- See Also:
getActions()
public static final String selectionDownAction
The name of theActionthat moves the caret one line down, possibly extending the current selection.
- Field Value:
- "selection-down"
- See Also:
getActions()
public static final String selectionEndAction
The name of theActionthat moves the caret to the end of the document, possibly extending the current selection.
- Field Value:
- "selection-end"
- See Also:
getActions()
public static final String selectionEndLineAction
The name of theActionthat moves the caret to the end of the current line, possibly extending the current selection.
- Field Value:
- "selection-end-line"
- See Also:
getActions()
public static final String selectionEndParagraphAction
The name of theActionthat moves the caret to the end of the current paragraph, possibly extending the current selection.
- Field Value:
- "selection-end-paragraph"
- See Also:
getActions()
public static final String selectionEndWordAction
The name of theActionthat moves the caret to the end of the current word, possibly extending the current selection.
- Field Value:
- "selection-end-word"
- See Also:
getActions()
public static final String selectionForwardAction
The name of theActionthat moves the caret one character forwards, possibly extending the current selection.
- Field Value:
- "selection-forward"
- See Also:
getActions()
public static final String selectionNextWordAction
The name of theActionthat moves the caret to the beginning of the next word, possibly extending the current selection.
- Field Value:
- "selection-next-word"
- See Also:
getActions()
public static final String selectionPreviousWordAction
The name of theActionthat moves the caret to the beginning of the previous word, possibly extending the current selection.
- Field Value:
- "selection-previous-word"
- See Also:
getActions()
public static final String selectionUpAction
The name of theActionthat moves the caret one line up, possibly extending the current selection.
- Field Value:
- "selection-up"
- See Also:
getActions()
public static final String upAction
The name of theActionthat moves the caret one line up.
- Field Value:
- "caret-up"
- See Also:
getActions()
public static final String writableAction
The name of theActionthat sets the editor in read-write mode.
- Field Value:
- "set-writable"
- See Also:
getActions()
public Caret createCaret()
- Overrides:
- createCaret in interface EditorKit
- Returns:
- the
Caretfor thisEditorKit
public Document createDefaultDocument()
- Overrides:
- createDefaultDocument in interface EditorKit
- Returns:
- the default
Documentthat thisEditorKitsupports
public Action[] getActions()
Returns theActions supported by thisEditorKit.
- Overrides:
- getActions in interface EditorKit
- Returns:
- the
Actions supported by thisEditorKit
public String getContentType()
Returns the content type that thisEditorKitsupports. TheDefaultEditorKitsupports the content typetext/plain.
- Overrides:
- getContentType in interface EditorKit
- Returns:
- the content type that this
EditorKitsupports
public ViewFactory getViewFactory()
Returns aViewFactorythat is able to createViews for theElements that are used in thisEditorKit's model. This returns null which lets the UI of the text component supplyViews.
- Overrides:
- getViewFactory in interface EditorKit
- Returns:
- a
ViewFactorythat is able to createViews for theElements that are used in thisEditorKit's model
public void read(InputStream in, Document document, int offset) throws BadLocationException, IOException
Reads a document of the supported content type from anInputStreaminto the actualDocumentobject.
- Parameters:
in- 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 inserted
- Throws:
BadLocationException- ifoffsetis an invalid location insidedocumentIOException- if something goes wrong while reading fromin
public void read(Reader in, Document document, int offset) throws BadLocationException, IOException
- Parameters:
in- 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 inserted
- Throws:
BadLocationException- ifoffsetis an invalid location insidedocumentIOException- if something goes wrong while reading fromin
public void write(OutputStream out, Document document, int offset, int len) throws BadLocationException, IOException
Writes theDocument(or a fragment of theDocument) to anOutputStreamin the supported content type format.
- Parameters:
out- 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 write
- Throws:
BadLocationException- ifoffsetoroffset + lenis an invalid location insidedocumentIOException- if something goes wrong while writing toout
public void write(Writer out, Document document, int offset, int len) throws BadLocationException, IOException
Writes theDocument(or a fragment of theDocument) to aWriterin the supported content type format.
- Parameters:
out- 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 write
- Throws:
BadLocationException- ifoffsetis an invalid location insidedocument.IOException- if something goes wrong while writing toout