All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.DefaultEditorKit

java.lang.Object
   |
   +----com.sun.java.swing.text.EditorKit
           |
           +----com.sun.java.swing.text.DefaultEditorKit

public class DefaultEditorKit
extends EditorKit
This is the set of things needed by a text component to be a reasonably functioning editor for some type of text document. This implementation provides a default implementation which treats text as plain text and provides a minimal set of actions for simple editor.


Variable Index

 o backwardAction
Name of the Action for moving the caret logically backward one position.
 o beepAction
Name of the action to create a beep.
 o beginAction
Name of the Action for moving the caret to the begining of the document.
 o beginLineAction
Name of the Action for moving the caret to the begining of the document.
 o beginParagraphAction
Name of the Action for moving the caret to the begining of the document.
 o beginWordAction
Name of the Action for moving the caret to the begining of the document.
 o copyAction
Name of the action to copy the selected region and place the contents into the system clipboard.
 o cutAction
Name of the action to cut the selected region and place the contents into the system clipboard.
 o defaultKeyTypedAction
Name of the action that is executed by default if a key typed event is received and there is no keymap entry.
 o deleteNextCharAction
Name of the action to delete the character of content that follows the current caret position.
 o deletePrevCharAction
Name of the action to delete the character of content that precedes the current caret position.
 o downAction
Name of the Action for moving the caret logically downward one position.
 o endAction
Name of the Action for moving the caret to the end of the document.
 o endLineAction
Name of the Action for moving the caret to the end of the document.
 o endParagraphAction
Name of the Action for moving the caret to the end of the document.
 o endWordAction
Name of the Action for moving the caret to the end of the document.
 o forwardAction
Name of the Action for moving the caret logically forward one position.
 o insertBreakAction
Name of the action to place a line/paragraph break into the document.
 o insertContentAction
Name of the action to place content into the associated document.
 o insertTabAction
Name of the action to place a tab character into the document.
 o nextWordAction
Name of the Action for moving the caret to the begining of the next word.
 o pageDownAction
Name of the action to page down vertically.
 o pageUpAction
Name of the action to page up vertically.
 o 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.
 o previousWordAction
Name of the Action for moving the caret to the begining of the previous word.
 o readOnlyAction
Name of the action to set the editor into read-only mode.
 o selectAllAction
Name of the Action for selecting the entire document
 o selectionBackwardAction
Name of the Action for extending the selection by moving the caret logically backward one position.
 o selectionBeginAction
Name of the Action for moving the caret to the begining of the document.
 o selectionBeginLineAction
Name of the Action for moving the caret to the begining of the document.
 o selectionBeginParagraphAction
Name of the Action for moving the caret to the begining of the document.
 o selectionBeginWordAction
Name of the Action for moving the caret to the begining of the document.
 o selectionDownAction
Name of the Action for moving the caret logically downward one position.
 o selectionEndAction
Name of the Action for moving the caret to the end of the document.
 o selectionEndLineAction
Name of the Action for moving the caret to the end of the document.
 o selectionEndParagraphAction
Name of the Action for moving the caret to the end of the document.
 o selectionEndWordAction
Name of the Action for moving the caret to the end of the document.
 o selectionForwardAction
Name of the Action for extending the selection by moving the caret logically forward one position.
 o selectionNextWordAction
Name of the Action for moving the selection to the begining of the next word.
 o selectionPreviousWordAction
Name of the Action for moving the selection to the begining of the previous word.
 o selectionUpAction
Name of the Action for moving the caret logically upward one position.
 o selectLineAction
Name of the Action for selecting a line around the caret.
 o selectParagraphAction
Name of the Action for selecting a paragraph around the caret.
 o selectWordAction
Name of the Action for selecting a word around the caret.
 o upAction
Name of the Action for moving the caret logically upward one position.
 o writableAction
Name of the action to set the editor into writeable mode.

Constructor Index

 o DefaultEditorKit()

Method Index

 o clone()
Create a copy of the editor kit.
 o createCaret()
Fetches a caret that can navigate through views produced by the associated ViewFactory.
 o createDefaultDocument()
Creates an uninitialized text storage model that is appropriate for this type of editor.
 o 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.
 o getContentType()
Gets the MIME type of the data that this kit represents support for.
 o getViewFactory()
Fetches a factory that is suitable for producing views of any models that are produced by this kit.
 o read(InputStream, Document, int)
Inserts content from the given stream which is expected to be in a format appropriate for this kind of content handler.
 o read(Reader, Document, int)
Inserts content from the given stream, which will be treated as plain text.
 o write(OutputStream, Document, int, int)
Writes content from a document to the given stream in a format appropriate for this kind of content handler.
 o write(Writer, Document, int, int)
Writes content from a document to the given stream as plain text.

Variables

 o insertContentAction
 public static final String insertContentAction
Name of the action to place content into the associated document. If there is a selection, it is removed before the new content is added.

See Also:
DefaultEditorKit. InsertContentAction, getActions
 o insertBreakAction
 public static final String insertBreakAction
Name of the action to place a line/paragraph break into the document. If there is a selection, it is removed before the break is added.

See Also:
DefaultEditorKit. InsertBreakAction, getActions
 o insertTabAction
 public static final String insertTabAction
Name of the action to place a tab character into the document. If there is a selection, it is removed before the tab is added.

See Also:
DefaultEditorKit. InsertTabAction, getActions
 o deletePrevCharAction
 public static final String deletePrevCharAction
Name of the action to delete the character of content that precedes the current caret position.

See Also:
DefaultEditorKit. DeletePrevCharAction, getActions
 o deleteNextCharAction
 public static final String deleteNextCharAction
Name of the action to delete the character of content that follows the current caret position.

See Also:
DefaultEditorKit. DeleteNextCharAction, getActions
 o readOnlyAction
 public static final String readOnlyAction
Name of the action to set the editor into read-only mode.

See Also:
DefaultEditorKit. ReadOnlyAction, getActions
 o writableAction
 public static final String writableAction
Name of the action to set the editor into writeable mode.

See Also:
DefaultEditorKit. WritableAction, getActions
 o cutAction
 public static final String cutAction
Name of the action to cut the selected region and place the contents into the system clipboard.

See Also:
cut, getActions
 o copyAction
 public static final String copyAction
Name of the action to copy the selected region and place the contents into the system clipboard.

See Also:
copy, getActions
 o pasteAction
 public static final 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.

See Also:
paste, getActions
 o beepAction
 public static final String beepAction
Name of the action to create a beep.

See Also:
DefaultEditorKit. BeepAction, getActions
 o pageUpAction
 public static final String pageUpAction
Name of the action to page up vertically.

See Also:
DefaultEditorKit. PageUpAction, getActions
 o pageDownAction
 public static final String pageDownAction
Name of the action to page down vertically.

See Also:
DefaultEditorKit. PageDownAction, getActions
 o forwardAction
 public static final String forwardAction
Name of the Action for moving the caret logically forward one position.

See Also:
DefaultEditorKit. ForwardAction, getActions
 o backwardAction
 public static final String backwardAction
Name of the Action for moving the caret logically backward one position.

See Also:
DefaultEditorKit. BackwardAction, getActions
 o selectionForwardAction
 public static final String selectionForwardAction
Name of the Action for extending the selection by moving the caret logically forward one position.

See Also:
SelectionForwardAction, getActions
 o selectionBackwardAction
 public static final String selectionBackwardAction
Name of the Action for extending the selection by moving the caret logically backward one position.

See Also:
SelectionBackwardAction, getActions
 o upAction
 public static final String upAction
Name of the Action for moving the caret logically upward one position.

See Also:
DefaultEditorKit. UpAction, getActions
 o downAction
 public static final String downAction
Name of the Action for moving the caret logically downward one position.

See Also:
DefaultEditorKit. DownAction, getActions
 o selectionUpAction
 public static final String selectionUpAction
Name of the Action for moving the caret logically upward one position.

See Also:
DefaultEditorKit. UpAction, getActions
 o selectionDownAction
 public static final String selectionDownAction
Name of the Action for moving the caret logically downward one position.

See Also:
DefaultEditorKit. DownAction, getActions
 o beginWordAction
 public static final String beginWordAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginAction, getActions
 o endWordAction
 public static final String endWordAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndAction, getActions
 o selectionBeginWordAction
 public static final String selectionBeginWordAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginWordAction, getActions
 o selectionEndWordAction
 public static final String selectionEndWordAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndWordAction, getActions
 o previousWordAction
 public static final String previousWordAction
Name of the Action for moving the caret to the begining of the previous word.

See Also:
DefaultEditorKit. PreviousWordAction, getActions
 o nextWordAction
 public static final String nextWordAction
Name of the Action for moving the caret to the begining of the next word. to the next of the document.

See Also:
DefaultEditorKit. NextWordAction, getActions
 o selectionPreviousWordAction
 public static final String selectionPreviousWordAction
Name of the Action for moving the selection to the begining of the previous word.

See Also:
DefaultEditorKit. PreviousWordAction, getActions
 o selectionNextWordAction
 public static final String selectionNextWordAction
Name of the Action for moving the selection to the begining of the next word.

See Also:
DefaultEditorKit. NextWordAction, getActions
 o beginLineAction
 public static final String beginLineAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginAction, getActions
 o endLineAction
 public static final String endLineAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndAction, getActions
 o selectionBeginLineAction
 public static final String selectionBeginLineAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginLineAction, getActions
 o selectionEndLineAction
 public static final String selectionEndLineAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndLineAction, getActions
 o beginParagraphAction
 public static final String beginParagraphAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginAction, getActions
 o endParagraphAction
 public static final String endParagraphAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndAction, getActions
 o selectionBeginParagraphAction
 public static final String selectionBeginParagraphAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginParagraphAction, getActions
 o selectionEndParagraphAction
 public static final String selectionEndParagraphAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndParagraphAction, getActions
 o beginAction
 public static final String beginAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginAction, getActions
 o endAction
 public static final String endAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndAction, getActions
 o selectionBeginAction
 public static final String selectionBeginAction
Name of the Action for moving the caret to the begining of the document.

See Also:
DefaultEditorKit. BeginAction, getActions
 o selectionEndAction
 public static final String selectionEndAction
Name of the Action for moving the caret to the end of the document.

See Also:
DefaultEditorKit. EndAction, getActions
 o selectWordAction
 public static final String selectWordAction
Name of the Action for selecting a word around the caret.

See Also:
DefaultEditorKit. SelectWordAction, getActions
 o selectLineAction
 public static final String selectLineAction
Name of the Action for selecting a line around the caret.

See Also:
DefaultEditorKit. SelectLineAction, getActions
 o selectParagraphAction
 public static final String selectParagraphAction
Name of the Action for selecting a paragraph around the caret.

See Also:
DefaultEditorKit. SelectParagraphAction, getActions
 o selectAllAction
 public static final String selectAllAction
Name of the Action for selecting the entire document

See Also:
DefaultEditorKit. SelectAllAction, getActions
 o defaultKeyTypedAction
 public static final String defaultKeyTypedAction
Name of the action that is executed by default if a key typed event is received and there is no keymap entry.

See Also:
DefaultEditorKit. DefaultKeyTypedAction, getActions

Constructors

 o DefaultEditorKit
 public DefaultEditorKit()

Methods

 o clone
 public Object clone()
Create a copy of the editor kit. This allows an implementation to serve as a prototype for others, so that they can be quickly created.

Overrides:
clone in class EditorKit
 o getContentType
 public String getContentType()
Gets the MIME type of the data that this kit represents support for. The default is text/plain.

Returns:
the type
Overrides:
getContentType in class EditorKit
 o getViewFactory
 public ViewFactory getViewFactory()
Fetches a factory that is suitable for producing views of any models that are produced by this kit. The default is to have the UI produce the factory, so this method has no implementation.

Returns:
the view factory
Overrides:
getViewFactory in class EditorKit
 o getActions
 public 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.

Returns:
the command list
Overrides:
getActions in class EditorKit
 o createCaret
 public Caret createCaret()
Fetches a caret that can navigate through views produced by the associated ViewFactory.

Returns:
the caret
Overrides:
createCaret in class EditorKit
 o createDefaultDocument
 public Document createDefaultDocument()
Creates an uninitialized text storage model that is appropriate for this type of editor.

Returns:
the model
Overrides:
createDefaultDocument in class EditorKit
 o read
 public void read(InputStream in,
                  Document doc,
                  int pos) throws IOException, BadLocationException
Inserts content from the given stream which is expected to be in a format appropriate for this kind of content handler.

Parameters:
in - The stream to read from
doc - The destination for the insertion.
pos - The location in the document to place the content.
Throws: IOException
on any I/O error
Throws: BadLocationException
if pos represents an invalid location within the document.
Overrides:
read in class EditorKit
 o write
 public void write(OutputStream out,
                   Document doc,
                   int pos,
                   int len) throws IOException, BadLocationException
Writes content from a document to the given stream in a format appropriate for this kind of content handler.

Parameters:
out - The stream to write to
doc - The source for the write.
pos - The location in the document to fetch the content.
len - The amount to write out.
Throws: IOException
on any I/O error
Throws: BadLocationException
if pos represents an invalid location within the document.
Overrides:
write in class EditorKit
 o read
 public void read(Reader in,
                  Document doc,
                  int pos) throws IOException, BadLocationException
Inserts content from the given stream, which will be treated as plain text.

Parameters:
in - The stream to read from
doc - The destination for the insertion.
pos - The location in the document to place the content.
Throws: IOException
on any I/O error
Throws: BadLocationException
if pos represents an invalid location within the document.
Overrides:
read in class EditorKit
 o write
 public void write(Writer out,
                   Document doc,
                   int pos,
                   int len) throws IOException, BadLocationException
Writes content from a document to the given stream as plain text.

Parameters:
out - The stream to write to
doc - The source for the write.
pos - The location in the document to fetch the content.
len - The amount to write out.
Throws: IOException
on any I/O error
Throws: BadLocationException
if pos represents an invalid location within the document.
Overrides:
write in class EditorKit

All Packages  Class Hierarchy  This Package  Previous  Next  Index