APIdia Launch Partner
Top Description Constructors Methods
javax.swing.text.rtf

public Class RTFEditorKit

extends StyledEditorKit
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.awt.*, java.io.*, java.net.MalformedURLException, .URL, javax.swing.Action, javax.swing.*, javax.swing.text.*

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.
Author
Timothy Prinzing (of this class, not the package!)

Constructor Summary

AccessConstructor and Description
public
RTFEditorKit()

Constructs an RTFEditorKit.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the type
getContentType
()

Overrides javax.swing.text.DefaultEditorKit.getContentType.

Get the MIME type of the data that this kit represents support for.

public void
read(InputStream
The stream to read from
in
,
Document
The destination for the insertion.
doc
,
int
The location in the document to place the content.
pos
)

Overrides javax.swing.text.DefaultEditorKit.read.

Insert content from the given stream which is expected to be in a format appropriate for this kind of content handler.

public void
read(Reader
The stream to read from
in
,
Document
The destination for the insertion.
doc
,
int
The location in the document to place the content.
pos
)

Overrides javax.swing.text.DefaultEditorKit.read.

Insert content from the given stream, which will be treated as plain text.

public void
write(OutputStream
The stream to write to
out
,
Document
The source for the write.
doc
,
int
The location in the document to fetch the content.
pos
,
int
The amount to write out.
len
)

Overrides javax.swing.text.DefaultEditorKit.write.

Write content from a document to the given stream in a format appropriate for this kind of content handler.

public void
write(Writer
The stream to write to
out
,
Document
The source for the write.
doc
,
int
The location in the document to fetch the content.
pos
,
int
The amount to write out.
len
)

Overrides javax.swing.text.DefaultEditorKit.write.

Write content from a document to the given stream as plain text.

Inherited from javax.swing.text.StyledEditorKit:
clonecreateDefaultDocumentcreateInputAttributesdeinstallgetActionsgetCharacterAttributeRungetInputAttributesgetViewFactoryinstall

Constructor Detail

RTFEditorKitback to summary
public RTFEditorKit()

Constructs an RTFEditorKit.

Method Detail

getContentTypeback to summary
public String getContentType()

Overrides javax.swing.text.DefaultEditorKit.getContentType.

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

Returns:String

the type

readback to summary
public void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException

Overrides javax.swing.text.DefaultEditorKit.read.

Insert content from the given stream which is expected to be in a format appropriate for this kind of content handler.

Parameters
in:InputStream

The stream to read from

doc:Document

The destination for the insertion.

pos:int

The location in the document to place the content.

Exceptions
IOException:
on any I/O error
BadLocationException:
if pos represents an invalid location within the document.
readback to summary
public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException

Overrides javax.swing.text.DefaultEditorKit.read.

Insert content from the given stream, which will be treated as plain text.

Parameters
in:Reader

The stream to read from

doc:Document

The destination for the insertion.

pos:int

The location in the document to place the content.

Exceptions
IOException:
on any I/O error
BadLocationException:
if pos represents an invalid location within the document.
writeback to summary
public void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException

Overrides javax.swing.text.DefaultEditorKit.write.

Write content from a document to the given stream in a format appropriate for this kind of content handler.

Parameters
out:OutputStream

The stream to write to

doc:Document

The source for the write.

pos:int

The location in the document to fetch the content.

len:int

The amount to write out.

Exceptions
IOException:
on any I/O error
BadLocationException:
if pos represents an invalid location within the document.
writeback to summary
public void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException

Overrides javax.swing.text.DefaultEditorKit.write.

Write content from a document to the given stream as plain text.

Parameters
out:Writer

The stream to write to

doc:Document

The source for the write.

pos:int

The location in the document to fetch the content.

len:int

The amount to write out.

Exceptions
IOException:
on any I/O error
BadLocationException:
if pos represents an invalid location within the document.