public abstract class EditorKit extends Object implements Cloneable, Serializable
 套件可以安全地存储编辑状态,因为该套件的实例将专用于文本组件。 通常可以通过克隆原型套件来创建新工具包。 该工具包将使用它的setComponent方法来建立它与JTextComponent的关系。 
| Constructor and Description | 
|---|
| EditorKit()
              构建一个EditorKit。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| Object | clone()
              创建一个编辑工具包的副本。 
             | 
| abstract Caret | createCaret()
              获取可以通过相关ViewFactory生成的视图浏览的插入符号。 
             | 
| abstract Document | createDefaultDocument()
              创建适用于此类型编辑器的未初始化文本存储模型。 
             | 
| void | deinstall(JEditorPane c)
              当该套件从JEditorPane中删除时调用。 
             | 
| abstract Action[] | getActions()
              获取可用于使用此套件生成的模型和视图的文本组件的一组命令。 
             | 
| abstract String | getContentType()
              获取此套件代表支持的数据的MIME类型。 
             | 
| abstract ViewFactory | getViewFactory()
              获取适合产生由该套件生产的任何型号的视图的工厂。 
             | 
| void | install(JEditorPane c)
              当该套件安装到JEditorPane中时调用。 
             | 
| abstract void | read(InputStream in, Document doc, int pos)
              插入来自给定流的内容,该内容预计以适合此类内容处理程序的格式。 
             | 
| abstract void | read(Reader in, Document doc, int pos)
              插入来自给定流的内容,该内容预计以适合此类内容处理程序的格式。 
             | 
| abstract void | write(OutputStream out, Document doc, int pos, int len)
              以适合此类内容处理程序的格式将内容从文档写入给定流。 
             | 
| abstract void | write(Writer out, Document doc, int pos, int len)
              以适合此类内容处理程序的格式将内容从文档写入给定流。 
             | 
public Object clone()
Object.clone() 。 
           如果该套件无法克隆,则返回null。 
          public void install(JEditorPane c)
c - JEditorPane 
           public void deinstall(JEditorPane c)
c - JEditorPane 
           public abstract String getContentType()
public abstract ViewFactory getViewFactory()
public abstract Action[] getActions()
public abstract Caret createCaret()
public abstract Document createDefaultDocument()
public abstract void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException
in - 要读取的流 
           doc - 插入的目的地。 
           pos - 放置内容> = 0的文档中的位置。 
           IOException - 在任何I / O错误 
           BadLocationException - 如果pos表示文档中的无效位置。 
           public abstract void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException
out - 要写入的流 
           doc - 写的来源。 
           pos - 文档中从> = 0获取内容的位置。 
           len - 写出的数量> = 0。 
           IOException - 在任何I / O错误 
           BadLocationException - 如果pos表示文档中的无效位置。 
           public abstract void read(Reader in, Document doc, int pos) throws IOException, BadLocationException
由于实际的文本编辑是基于unicode的,所以通常是阅读数据的首选方式。 一些类型的内容以8位形式存储,并且将有利于InputStream。
in - 要读取的流 
           doc - 插入的目的地。 
           pos - 放置内容> = 0的文档中的位置。 
           IOException - 任何I / O错误 
           BadLocationException - 如果pos表示文档中的无效位置。 
           public abstract void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException
由于实际的文本编辑是基于unicode的,所以这通常是写入数据的首选方式。 某些类型的内容以8位形式存储,并且将有利于OutputStream。
out - 要写入的流 
           doc - 写的来源。 
           pos - 文档中获取内容的位置> = 0。 
           len - 写出的数量> = 0。 
           IOException - 在任何I / O错误 
           BadLocationException - if pos represents an invalid location within the document. 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.