public class

RTFEditorKit

extends StyledEditorKit
java.lang.Object
   ↳ javax.swing.text.EditorKit
     ↳ javax.swing.text.DefaultEditorKit
       ↳ javax.swing.text.StyledEditorKit
         ↳ javax.swing.text.rtf.RTFEditorKit

Class Overview

This is the default implementation of RTF editing functionality. The RTF support was not written by the Swing team. In the future we hope to improve the support provided.

Summary

[Expand]
Inherited Constants
From class javax.swing.text.DefaultEditorKit
Public Constructors
RTFEditorKit()
Constructs an RTFEditorKit.
Public Methods
String getContentType()
Get the MIME type of the data that this kit represents support for.
void read(InputStream in, Document doc, int pos)
Insert content from the given stream which is expected to be in a format appropriate for this kind of content handler.
void read(Reader in, Document doc, int pos)
Insert content from the given stream, which will be treated as plain text.
void write(Writer out, Document doc, int pos, int len)
Write content from a document to the given stream as plain text.
void write(OutputStream out, Document doc, int pos, int len)
Write content from a document to the given stream in a format appropriate for this kind of content handler.
[Expand]
Inherited Methods
From class javax.swing.text.StyledEditorKit
From class javax.swing.text.DefaultEditorKit
From class javax.swing.text.EditorKit
From class java.lang.Object

Public Constructors

public RTFEditorKit ()

Constructs an RTFEditorKit.

Public Methods

public String getContentType ()

Get the MIME type of the data that this kit represents support for. This kit supports the type text/rtf.

Returns
  • the type

public void read (InputStream in, Document doc, int pos)

Insert 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
BadLocationException if pos represents an invalid location within the document.

public void read (Reader in, Document doc, int pos)

Insert 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
BadLocationException if pos represents an invalid location within the document.

public void write (Writer out, Document doc, int pos, int len)

Write 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
BadLocationException if pos represents an invalid location within the document.

public void write (OutputStream out, Document doc, int pos, int len)

Write 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
BadLocationException if pos represents an invalid location within the document.