JavaTM Platform
Standard Ed. 6

类 javax.swing.text.html.HTMLDocument
的使用

使用 HTMLDocument 的软件包
javax.swing.text.html 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。 
 

javax.swing.text.html 中 HTMLDocument 的使用
 

返回 HTMLDocument 的 javax.swing.text.html 中的方法
protected  HTMLDocument HTMLEditorKit.HTMLTextAction.getHTMLDocument(JEditorPane e)
           
 

参数类型为 HTMLDocument 的 javax.swing.text.html 中的方法
protected  int HTMLEditorKit.HTMLTextAction.elementCountToTag(HTMLDocument doc, int offset, HTML.Tag tag)
          返回要获得表示 tag 的元素时,从最深的叶元素开始所需的元素数。
protected  Element HTMLEditorKit.HTMLTextAction.findElementMatchingTag(HTMLDocument doc, int offset, HTML.Tag tag)
          返回在 offset 处与 tag 匹配的最深的元素。
protected  Element[] HTMLEditorKit.HTMLTextAction.getElementsAt(HTMLDocument doc, int offset)
          返回包含 offset 的 Elements 数组。
protected  void HTMLEditorKit.InsertHTMLTextAction.insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
          当在边界上插入时调用。
protected  void HTMLEditorKit.InsertHTMLTextAction.insertAtBoundry(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)
          已过时。 从 Java 2 平台 v1.3 开始,使用 insertAtBoundary
 void HTMLEditorKit.insertHTML(HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag)
          将 HTML 插入现有文档。
protected  void HTMLEditorKit.InsertHTMLTextAction.insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag)
          HTMLEditorKit.insertHTML 的一个覆盖。
 

参数类型为 HTMLDocument 的 javax.swing.text.html 中的构造方法
HTMLWriter(Writer w, HTMLDocument doc)
          创建新的 HTMLWriter。
HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
          创建新的 HTMLWriter。
 


JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。