java.lang.Objectjavax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
javax.swing.text.StyledEditorKit
javax.swing.text.rtf.RTFEditorKit
public class RTFEditorKit
这是对 RTF 编辑功能的默认实现。Swing 团队未编写 RTF 支持。将来我们希望改进提供的支持。
| 嵌套类摘要 |
|---|
| 字段摘要 |
|---|
| 构造方法摘要 | |
|---|---|
RTFEditorKit() 构造一个 RTFEditorKit。 |
|
| 方法摘要 | |
|---|---|
String |
getContentType() 获取此工具包支持的 MIME 类型的数据。 |
void |
read(InputStream in, Document doc, int pos) 插入来自给定流的内容,该内容的格式需要适合于此类内容处理程序。 |
void |
read(Reader in, Document doc, int pos) 插入来自给定流的内容,该内容将被视为纯文本。 |
void |
write(OutputStream out, Document doc, int pos, int len) 以适合此类内容处理程序的格式,将文档中的内容写入给定流。 |
void |
write(Writer out, Document doc, int pos, int len) 将文档中的内容作为纯文本写入给定的流。 |
| 从类 javax.swing.text.StyledEditorKit 继承的方法 |
|---|
clone, createDefaultDocument, createInputAttributes, deinstall, getActions, getCharacterAttributeRun, getInputAttributes, getViewFactory, install |
| 从类 javax.swing.text.DefaultEditorKit 继承的方法 |
|---|
createCaret |
| 从类 java.lang.Object 继承的方法 |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public RTFEditorKit()
| 方法详细信息 |
|---|
public String getContentType()
text/rtf 类型。
DefaultEditorKit 中的
getContentType
public void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException
DefaultEditorKit 中的
read
in - 从中读取数据的流
doc - 插入的目标。
pos - 文档中存放内容的位置。
IOException - 如果出现任何 I/O 错误
BadLocationException - 如果 pos 表示文档中的无效位置。
public void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException
DefaultEditorKit 中的
write
out - 要向其写入的流
doc - 写入的源。
pos - 文档中获取内容的位置。
len - 要写出的数量。
IOException - 如果出现任何 I/O 错误
BadLocationException - 如果 pos 表示文档中的无效位置。
public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException
DefaultEditorKit 中的
read
in - 从中读取数据的流
doc - 插入的目标。
pos - 文档中存放内容的位置。
IOException - 如果发生任何 I/O 错误
BadLocationException - 如果 pos 表示文档中的无效位置。
public void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException
DefaultEditorKit 中的
write
out - 要向其写入的流
doc - 写入的源。
pos - 文档中获取内容的位置。
len - 要写出的数量。
IOException - 如果发生任何 I/O 错误
BadLocationException - 如果 pos 表示文档中的无效位置。