The default implementation of
EditorKit. This
EditorKit
a plain text
Document and several commands that together
make up a basic editor, like cut / copy + paste.
EndOfLineStringProperty
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__"
backwardAction
public static final String backwardAction
The name of the Action that moves the caret one character
backwards.
- Field Value:
- "caret-backward"
beepAction
public static final String beepAction
The name of the Action that creates a beep in the speaker.
beginAction
public static final String beginAction
The name of the Action that moves the caret to the beginning
of the Document.
- Field Value:
- "caret-begin"
beginLineAction
public static final String beginLineAction
The name of the Action that moves the caret to the beginning
of the current line.
- Field Value:
- "caret-begin-line"
beginParagraphAction
public static final String beginParagraphAction
The name of the Action that moves the caret to the beginning
of the current paragraph.
- Field Value:
- "caret-begin-paragraph"
beginWordAction
public static final String beginWordAction
The name of the Action that moves the caret to the beginning
of the current word.
- Field Value:
- "caret-begin-word"
copyAction
public static final String copyAction
The name of the Action that copies the selected content
into the system clipboard.
- Field Value:
- "copy-to-clipboard"
cutAction
public static final String cutAction
The name of the Action that copies the selected content
into the system clipboard and removes the selection.
- Field Value:
- "cut-to-clipboard"
defaultKeyTypedAction
public static final String defaultKeyTypedAction
The name of the Action that is performed by default if
a key is typed and there is no keymap entry.
- Field Value:
- "default-typed"
deleteNextCharAction
public static final String deleteNextCharAction
The name of the Action that deletes the character that
follows the current caret position.
- Field Value:
- "delete-next"
deletePrevCharAction
public static final String deletePrevCharAction
The name of the Action that deletes the character that
precedes the current caret position.
- Field Value:
- "delete-previous"
downAction
public static final String downAction
The name of the Action that moves the caret one line down.
endAction
public static final String endAction
The name of the Action that moves the caret to the end
of the Document.
endLineAction
public static final String endLineAction
The name of the Action that moves the caret to the end
of the current line.
- Field Value:
- "caret-end-line"
endParagraphAction
public static final String endParagraphAction
The name of the Action that moves the caret to the end
of the current paragraph.
- Field Value:
- "caret-end-paragraph"
endWordAction
public static final String endWordAction
The name of the Action that moves the caret to the end
of the current word.
- Field Value:
- "caret-end-word"
forwardAction
public static final String forwardAction
The name of the Action that moves the caret one character
forward.
- Field Value:
- "caret-forward"
insertBreakAction
public static final String insertBreakAction
The name of the Action that inserts a line break.
- Field Value:
- "insert-break"
insertContentAction
public static final String insertContentAction
The name of the Action that inserts some content.
- Field Value:
- "insert-content"
nextWordAction
public static final String nextWordAction
The name of the Action that moves the caret to the beginning
of the next word.
- Field Value:
- "caret-next-word"
pageDownAction
public static final String pageDownAction
The name of the Action that moves the caret one page down.
pageUpAction
public static final String pageUpAction
The name of the Action that moves the caret one page up.
pasteAction
public static final String pasteAction
The name of the Action that copies content from the system
clipboard into the document.
- Field Value:
- "paste-from-clipboard"
previousWordAction
public static final String previousWordAction
The name of the Action that moves the caret to the beginning
of the previous word.
- Field Value:
- "caret-previous-word"
readOnlyAction
public static final String readOnlyAction
The name of the Action that sets the editor in read only
mode.
- Field Value:
- "set-read-only"
selectAllAction
public static final String selectAllAction
The name of the Action that selects the whole document.
selectLineAction
public static final String selectLineAction
The name of the Action that selects the line around the
caret.
- Field Value:
- "select-line"
selectParagraphAction
public static final String selectParagraphAction
The name of the Action that selects the paragraph around the
caret.
- Field Value:
- "select-paragraph"
selectWordAction
public static final String selectWordAction
The name of the Action that selects the word around the
caret.
- Field Value:
- "select-word"
selectionBackwardAction
public static final String selectionBackwardAction
The name of the Action that moves the caret one character
backwards, possibly extending the current selection.
- Field Value:
- "selection-backward"
selectionBeginAction
public static final String selectionBeginAction
The name of the Action that moves the caret to the beginning
of the document, possibly extending the current selection.
- Field Value:
- "selection-begin"
selectionBeginLineAction
public static final String selectionBeginLineAction
The name of the Action that moves the caret to the beginning
of the current line, possibly extending the current selection.
- Field Value:
- "selection-begin-line"
selectionBeginParagraphAction
public static final String selectionBeginParagraphAction
The name of the Action that moves the caret to the beginning
of the current paragraph, possibly extending the current selection.
- Field Value:
- "selection-begin-paragraph"
selectionBeginWordAction
public static final String selectionBeginWordAction
The name of the Action that moves the caret to the beginning
of the current word, possibly extending the current selection.
- Field Value:
- "selection-begin-word"
selectionDownAction
public static final String selectionDownAction
The name of the Action that moves the caret one line down,
possibly extending the current selection.
- Field Value:
- "selection-down"
selectionEndAction
public static final String selectionEndAction
The name of the Action that moves the caret to the end
of the document, possibly extending the current selection.
- Field Value:
- "selection-end"
selectionEndLineAction
public static final String selectionEndLineAction
The name of the Action that moves the caret to the end
of the current line, possibly extending the current selection.
- Field Value:
- "selection-end-line"
selectionEndParagraphAction
public static final String selectionEndParagraphAction
The name of the Action that moves the caret to the end
of the current paragraph, possibly extending the current selection.
- Field Value:
- "selection-end-paragraph"
selectionEndWordAction
public static final String selectionEndWordAction
The name of the Action that moves the caret to the end
of the current word, possibly extending the current selection.
- Field Value:
- "selection-end-word"
selectionForwardAction
public static final String selectionForwardAction
The name of the Action that moves the caret one character
forwards, possibly extending the current selection.
- Field Value:
- "selection-forward"
selectionNextWordAction
public static final String selectionNextWordAction
The name of the Action that moves the caret to the beginning
of the next word, possibly extending the current selection.
- Field Value:
- "selection-next-word"
selectionPreviousWordAction
public static final String selectionPreviousWordAction
The name of the Action that moves the caret to the beginning
of the previous word, possibly extending the current selection.
- Field Value:
- "selection-previous-word"
selectionUpAction
public static final String selectionUpAction
The name of the Action that moves the caret one line up,
possibly extending the current selection.
- Field Value:
- "selection-up"
upAction
public static final String upAction
The name of the Action that moves the caret one line up.
writableAction
public static final String writableAction
The name of the Action that sets the editor in read-write
mode.
- Field Value:
- "set-writable"
getActions
public Action[] getActions()
Returns the Actions supported by this EditorKit.
- Overrides:
- getActions in interface EditorKit
- Returns:
- the
Actions supported by this EditorKit
getContentType
public String getContentType()
Returns the content type that this EditorKit supports.
The DefaultEditorKit supports the content type
text/plain.
- Overrides:
- getContentType in interface EditorKit
- Returns:
- the content type that this
EditorKit supports
read
public void read(InputStream in,
Document document,
int offset)
throws BadLocationException,
IOException
Reads a document of the supported content type from an
InputStream
into the actual
Document object.
- Overrides:
- read in interface EditorKit
- 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
read
public void read(Reader in,
Document document,
int offset)
throws BadLocationException,
IOException
Reads a document of the supported content type from a
Reader
into the actual
Document object.
- Overrides:
- read in interface EditorKit
- 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
write
public void write(OutputStream out,
Document document,
int offset,
int len)
throws BadLocationException,
IOException
Writes the
Document (or a fragment of the
Document) to an
OutputStream in the
supported content type format.
- Overrides:
- write in interface EditorKit
- 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
write
public void write(Writer out,
Document document,
int offset,
int len)
throws BadLocationException,
IOException
Writes the
Document (or a fragment of the
Document) to a
Writer in the
supported content type format.
- Overrides:
- write in interface EditorKit
- 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
DefaultEditorKit.java --
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.