Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing.text
Class DefaultEditorKit

    java.lang.Object
      |
      +--javax.swing.text.EditorKit
            |
            +--javax.swing.text.DefaultEditorKit

Direct Known Subclasses:
  StyledEditorKit

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 a simple editor.

See Also:
  Serialized Form

Inner Class Summary
`static class` | `DefaultEditorKit.BeepAction` Creates a beep.
`static class` | `DefaultEditorKit.CopyAction` Coies the selected region and place its contents into the system clipboard.
`static class` | `DefaultEditorKit.CutAction` Cuts the selected region and place its contents into the system clipboard.
`static class` | `DefaultEditorKit.DefaultKeyTypedAction` The action that is executed by default if a key typed event is received and there is no keymap entry.
`static class` | `DefaultEditorKit.InsertBreakAction` Places a line/paragraph break into the document.
`static class` | `DefaultEditorKit.InsertContentAction` Places content into the associated document.
`static class` | `DefaultEditorKit.InsertTabAction` Places a tab character into the document.
`static class` | `DefaultEditorKit.PasteAction` Pastes the contents of the system clipboard into the selected region, or before the caret if nothing is selected.

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

Constructor Summary
`DefaultEditorKit()`

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

Methods inherited from class javax.swing.text.EditorKit
`deinstall, install`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### EndOfLineStringProperty

    public static final java.lang.String EndOfLineStringProperty

  When reading a document if a CRLF is encountered a property with this name is added and the value will be "\r\n".

### insertContentAction

    public static final java.lang.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()`

### insertBreakAction

    public static final java.lang.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()`

### insertTabAction

    public static final java.lang.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()`

### deletePrevCharAction

    public static final java.lang.String deletePrevCharAction

  Name of the action to delete the character of content that precedes the current caret position.
  See Also:
    `DeletePrevCharAction`, `getActions()`

### deleteNextCharAction

    public static final java.lang.String deleteNextCharAction

  Name of the action to delete the character of content that follows the current caret position.
  See Also:
    `DeleteNextCharAction`, `getActions()`

### readOnlyAction

    public static final java.lang.String readOnlyAction

  Name of the action to set the editor into read-only mode.
  See Also:
    `ReadOnlyAction`, `getActions()`

### writableAction

    public static final java.lang.String writableAction

  Name of the action to set the editor into writeable mode.
  See Also:
    `WritableAction`, `getActions()`

### cutAction

    public static final java.lang.String cutAction

  Name of the action to cut the selected region and place the contents into the system clipboard.
  See Also:
    `JTextComponent.cut()`, `getActions()`

### copyAction

    public static final java.lang.String copyAction

  Name of the action to copy the selected region and place the contents into the system clipboard.
  See Also:
    `JTextComponent.copy()`, `getActions()`

### pasteAction

    public static final java.lang.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:
    `JTextComponent.paste()`, `getActions()`

### beepAction

    public static final java.lang.String beepAction

  Name of the action to create a beep.
  See Also:
    `DefaultEditorKit.BeepAction`, `getActions()`

### pageUpAction

    public static final java.lang.String pageUpAction

  Name of the action to page up vertically.
  See Also:
    `PageUpAction`, `getActions()`

### pageDownAction

    public static final java.lang.String pageDownAction

  Name of the action to page down vertically.
  See Also:
    `PageDownAction`, `getActions()`

### forwardAction

    public static final java.lang.String forwardAction

  Name of the Action for moving the caret logically forward one position.
  See Also:
    `ForwardAction`, `getActions()`

### backwardAction

    public static final java.lang.String backwardAction

  Name of the Action for moving the caret logically backward one position.
  See Also:
    `BackwardAction`, `getActions()`

### selectionForwardAction

    public static final java.lang.String selectionForwardAction

  Name of the Action for extending the selection by moving the caret logically forward one position.
  See Also:
    `SelectionForwardAction`, `getActions()`

### selectionBackwardAction

    public static final java.lang.String selectionBackwardAction

  Name of the Action for extending the selection by moving the caret logically backward one position.
  See Also:
    `SelectionBackwardAction`, `getActions()`

### upAction

    public static final java.lang.String upAction

  Name of the Action for moving the caret logically upward one position.
  See Also:
    `UpAction`, `getActions()`

### downAction

    public static final java.lang.String downAction

  Name of the Action for moving the caret logically downward one position.
  See Also:
    `DownAction`, `getActions()`

### selectionUpAction

    public static final java.lang.String selectionUpAction

  Name of the Action for moving the caret logically upward one position, extending the selection.
  See Also:
    `UpAction`, `getActions()`

### selectionDownAction

    public static final java.lang.String selectionDownAction

  Name of the Action for moving the caret logically downward one position, extending the selection.
  See Also:
    `DownAction`, `getActions()`

### beginWordAction

    public static final java.lang.String beginWordAction

  Name of the Action for moving the caret to the begining of a word.
  See Also:
    `BeginAction`, `getActions()`

### endWordAction

    public static final java.lang.String endWordAction

  Name of the Action for moving the caret to the end of a word.
  See Also:
    `EndAction`, `getActions()`

### selectionBeginWordAction

    public static final java.lang.String selectionBeginWordAction

  Name of the Action for moving the caret to the begining of a word, extending the selection.
  See Also:
    `BeginWordAction`, `getActions()`

### selectionEndWordAction

    public static final java.lang.String selectionEndWordAction

  Name of the Action for moving the caret to the end of a word, extending the selection.
  See Also:
    `EndWordAction`, `getActions()`

### previousWordAction

    public static final java.lang.String previousWordAction

  Name of the Action for moving the caret to the begining of the previous word.
  See Also:
    `PreviousWordAction`, `getActions()`

### nextWordAction

    public static final java.lang.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:
    `NextWordAction`, `getActions()`

### selectionPreviousWordAction

    public static final java.lang.String selectionPreviousWordAction

  Name of the Action for moving the selection to the begining of the previous word, extending the selection.
  See Also:
    `PreviousWordAction`, `getActions()`

### selectionNextWordAction

    public static final java.lang.String selectionNextWordAction

  Name of the Action for moving the selection to the begining of the next word, extending the selection.
  See Also:
    `NextWordAction`, `getActions()`

### beginLineAction

    public static final java.lang.String beginLineAction

  Name of the Action for moving the caret to the begining of a line.
  See Also:
    `BeginAction`, `getActions()`

### endLineAction

    public static final java.lang.String endLineAction

  Name of the Action for moving the caret to the end of a line.
  See Also:
    `EndAction`, `getActions()`

### selectionBeginLineAction

    public static final java.lang.String selectionBeginLineAction

  Name of the Action for moving the caret to the begining of a line, extending the selection.
  See Also:
    `BeginLineAction`, `getActions()`

### selectionEndLineAction

    public static final java.lang.String selectionEndLineAction

  Name of the Action for moving the caret to the end of a line, extending the selection.
  See Also:
    `EndLineAction`, `getActions()`

### beginParagraphAction

    public static final java.lang.String beginParagraphAction

  Name of the Action for moving the caret to the begining of a paragraph.
  See Also:
    `BeginAction`, `getActions()`

### endParagraphAction

    public static final java.lang.String endParagraphAction

  Name of the Action for moving the caret to the end of a paragraph.
  See Also:
    `EndAction`, `getActions()`

### selectionBeginParagraphAction

    public static final java.lang.String selectionBeginParagraphAction

  Name of the Action for moving the caret to the begining of a paragraph, extending the selection.
  See Also:
    `BeginParagraphAction`, `getActions()`

### selectionEndParagraphAction

    public static final java.lang.String selectionEndParagraphAction

  Name of the Action for moving the caret to the end of a paragraph, extending the selection.
  See Also:
    `EndParagraphAction`, `getActions()`

### beginAction

    public static final java.lang.String beginAction

  Name of the Action for moving the caret to the begining of the document.
  See Also:
    `BeginAction`, `getActions()`

### endAction

    public static final java.lang.String endAction

  Name of the Action for moving the caret to the end of the document.
  See Also:
    `EndAction`, `getActions()`

### selectionBeginAction

    public static final java.lang.String selectionBeginAction

  Name of the Action for moving the caret to the begining of the document.
  See Also:
    `BeginAction`, `getActions()`

### selectionEndAction

    public static final java.lang.String selectionEndAction

  Name of the Action for moving the caret to the end of the document.
  See Also:
    `EndAction`, `getActions()`

### selectWordAction

    public static final java.lang.String selectWordAction

  Name of the Action for selecting a word around the caret.
  See Also:
    `SelectWordAction`, `getActions()`

### selectLineAction

    public static final java.lang.String selectLineAction

  Name of the Action for selecting a line around the caret.
  See Also:
    `SelectLineAction`, `getActions()`

### selectParagraphAction

    public static final java.lang.String selectParagraphAction

  Name of the Action for selecting a paragraph around the caret.
  See Also:
    `SelectParagraphAction`, `getActions()`

### selectAllAction

    public static final java.lang.String selectAllAction

  Name of the Action for selecting the entire document
  See Also:
    `SelectAllAction`, `getActions()`

### defaultKeyTypedAction

    public static final java.lang.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()`

Constructor Detail

### DefaultEditorKit

    public DefaultEditorKit()

Method Detail

### clone

    public java.lang.Object clone()

  Creates a copy of the editor kit. This allows an implementation to serve as a prototype for others, so that they can be quickly created.
  Returns:
    the copy
  Overrides:
    clone in class EditorKit

### getContentType

    public java.lang.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

### 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

### 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

### 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

### createDefaultDocument

    public Document createDefaultDocument()

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

### read

    public void read(java.io.InputStream in,
                     Document doc,
                     int pos)
              throws java.io.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 >= 0.
  Throws:
    java.io.IOException - on any I/O error
    BadLocationException - if pos represents an invalid location within the document.
  Overrides:
    read in class EditorKit

### write

    public void write(java.io.OutputStream out,
                      Document doc,
                      int pos,
                      int len)
               throws java.io.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 >= 0.
    `len` - The amount to write out >= 0.
  Throws:
    java.io.IOException - on any I/O error
    BadLocationException - if pos represents an invalid location within the document.
  Overrides:
    write in class EditorKit

### read

    public void read(java.io.Reader in,
                     Document doc,
                     int pos)
              throws java.io.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 >= 0.
  Throws:
    java.io.IOException - on any I/O error
    BadLocationException - if pos represents an invalid location within the document.
  Overrides:
    read in class EditorKit

### write

    public void write(java.io.Writer out,
                      Document doc,
                      int pos,
                      int len)
               throws java.io.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 from >= 0.
    `len` - The amount to write out >= 0.
  Throws:
    java.io.IOException - on any I/O error
    BadLocationException - if pos is not within 0 and the length of the document.
  Overrides:
    write in class EditorKit

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.