javax.swing.text.rtf
Class RTFEditorKit

java.lang.Object
  extended by javax.swing.text.EditorKit
      extended by javax.swing.text.DefaultEditorKit
          extended by javax.swing.text.StyledEditorKit
              extended by javax.swing.text.rtf.RTFEditorKit
All Implemented Interfaces:
Serializable, Cloneable

public class RTFEditorKit
extends StyledEditorKit

Provides support for RTF data for use in JEditorPanes.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.StyledEditorKit
StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.StyledTextAction, StyledEditorKit.UnderlineAction
 
Nested classes/interfaces inherited from class javax.swing.text.DefaultEditorKit
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction
 
Field Summary
 
Fields inherited from class javax.swing.text.DefaultEditorKit
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deletePrevCharAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
 
Constructor Summary
RTFEditorKit()
          Constructs a new RTFEditorKit.
 
Method Summary
 String getContentType()
          Returns the MIME content type.
 void read(InputStream stream, Document doc, int pos)
          Reads RTF data from stream into doc at the specified position pos.
 void read(Reader reader, Document doc, int pos)
          Reads RTF data from reader into doc at the specified position pos.
 
Methods inherited from class javax.swing.text.StyledEditorKit
clone, createDefaultDocument, createInputAttributes, deinstall, getActions, getCharacterAttributeRun, getInputAttributes, getViewFactory, install
 
Methods inherited from class javax.swing.text.DefaultEditorKit
createCaret, write, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTFEditorKit

public RTFEditorKit()
Constructs a new RTFEditorKit.

Method Detail

getContentType

public String getContentType()
Returns the MIME content type. In the case of RTFEditorKit this is 'text/rtf'

Overrides:
getContentType in class DefaultEditorKit
Returns:
the MIME content type for RTFEditorKit

read

public void read(InputStream stream,
                 Document doc,
                 int pos)
          throws IOException,
                 BadLocationException
Reads RTF data from stream into doc at the specified position pos.

Overrides:
read in class DefaultEditorKit
Parameters:
stream - the InputStream from where we read RTF data
doc - the Document into which we read the RTF data
pos - the position where to start
Throws:
IOException - if an IO error occurs
BadLocationException - if the position is not valid

read

public void read(Reader reader,
                 Document doc,
                 int pos)
          throws IOException,
                 BadLocationException
Reads RTF data from reader into doc at the specified position pos.

Overrides:
read in class DefaultEditorKit
Parameters:
reader - the Reader from where we read RTF data
doc - the Document into which we read the RTF data
pos - the position where to start
Throws:
IOException - if an IO error occurs
BadLocationException - if the position is not valid