Java Doc for HTMLWriter.java in  » 6.0-JDK-Core » swing » javax » swing » text » html » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing.text.html 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.text.AbstractWriter
      javax.swing.text.html.HTMLWriter

HTMLWriter
public class HTMLWriter extends AbstractWriter (Code)
This is a writer for HTMLDocuments.
author:
   Sunita Mani
version:
   1.26, 02/02/00



Constructor Summary
public  HTMLWriter(Writer w, HTMLDocument doc)
     Creates a new HTMLWriter.
public  HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
     Creates a new HTMLWriter.

Method Summary
protected  voidcloseOutUnwantedEmbeddedTags(AttributeSet attr)
     Searches the attribute set and for each tag that is stored in the tag vector.
protected  voidcomment(Element elem)
     Writes out comments.
 AttributeSetconvertToHTML(AttributeSet from, MutableAttributeSet to)
     Convert the give set of attributes to be html for the purpose of writing them out.
protected  voidemptyTag(Element elem)
     Writes out all empty elements (all tags that have no corresponding end tag).
protected  voidendTag(Element elem)
     Writes out an end tag for the element.
protected  booleanisBlockTag(AttributeSet attr)
     Determines if the HTML.Tag associated with the element is a block tag.
protected  booleanmatchNameAttribute(AttributeSet attr, HTML.Tag tag)
     Returns true if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter.
protected  voidoutput(char[] chars, int start, int length)
     This method is overriden to map any character entities, such as < to &lt;.
protected  voidselectContent(AttributeSet attr)
     Writes out the content of the SELECT form element.
protected  voidstartTag(Element elem)
     Writes out a start tag for the element.
protected  booleansynthesizedElement(Element elem)
     Returns true if the element is a synthesized element.
protected  voidtext(Element elem)
     Writes out text.
protected  voidtextAreaContent(AttributeSet attr)
     Writes out text that is contained in a TEXTAREA form element.
public  voidwrite()
     Iterates over the Element tree and controls the writing out of all the tags and its attributes.
 voidwriteAdditionalComments()
     Writes out any additional comments (comments outside of the body) stored under the property HTMLDocument.AdditionalComments.
protected  voidwriteAttributes(AttributeSet attr)
     Writes out the attribute set.
 voidwriteComment(String string)
     Writes out comment string.
protected  voidwriteEmbeddedTags(AttributeSet attr)
     Searches for embedded tags in the AttributeSet and writes them out.
protected  voidwriteLineSeparator()
     Writes the line separator.
 voidwriteMaps(Enumeration maps)
     Outputs the maps as elements.
protected  voidwriteOption(Option option)
     Writes out the content of the Option form element.
 booleanwriteStyle(String name, Style style, boolean outputStyle)
     Outputs the named style.
 voidwriteStyleEndTag()
    
 voidwriteStyleStartTag()
    
 voidwriteStyles(StyleSheet sheet)
     Outputs the styles as a single element.


Constructor Detail
HTMLWriter
public HTMLWriter(Writer w, HTMLDocument doc)(Code)
Creates a new HTMLWriter.
Parameters:
  w - a Writer
Parameters:
  doc - an HTMLDocument



HTMLWriter
public HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)(Code)
Creates a new HTMLWriter.
Parameters:
  w - a Writer
Parameters:
  doc - an HTMLDocument
Parameters:
  pos - the document location from which to fetch the content
Parameters:
  len - the amount to write out




Method Detail
closeOutUnwantedEmbeddedTags
protected void closeOutUnwantedEmbeddedTags(AttributeSet attr) throws IOException(Code)
Searches the attribute set and for each tag that is stored in the tag vector. If the tag isnt found, then the tag is removed from the vector and a corresponding end tag is written out.
exception:
  IOException - on any I/O error



comment
protected void comment(Element elem) throws BadLocationException, IOException(Code)
Writes out comments.
Parameters:
  elem - an Element
exception:
  IOException - on any I/O error
exception:
  BadLocationException - if pos represents an invalidlocation within the document.



convertToHTML
AttributeSet convertToHTML(AttributeSet from, MutableAttributeSet to)(Code)
Convert the give set of attributes to be html for the purpose of writing them out. Any keys that have been converted will not appear in the resultant set. Any keys not converted will appear in the resultant set the same as the received set.

This will put the converted values into to, unless it is null in which case a temporary AttributeSet will be returned.




emptyTag
protected void emptyTag(Element elem) throws BadLocationException, IOException(Code)
Writes out all empty elements (all tags that have no corresponding end tag).
Parameters:
  elem - an Element
exception:
  IOException - on any I/O error
exception:
  BadLocationException - if pos represents an invalidlocation within the document.



endTag
protected void endTag(Element elem) throws IOException(Code)
Writes out an end tag for the element.
Parameters:
  elem - an Element
exception:
  IOException - on any I/O error



isBlockTag
protected boolean isBlockTag(AttributeSet attr)(Code)
Determines if the HTML.Tag associated with the element is a block tag.
Parameters:
  attr - an AttributeSet true if tag is block tag, false otherwise.



matchNameAttribute
protected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag)(Code)
Returns true if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter.



output
protected void output(char[] chars, int start, int length) throws IOException(Code)
This method is overriden to map any character entities, such as < to &lt;. super.output will be invoked to write the content.
since:
   1.3



selectContent
protected void selectContent(AttributeSet attr) throws IOException(Code)
Writes out the content of the SELECT form element.
Parameters:
  attr - the AttributeSet associated with the form element
exception:
  IOException - on any I/O error



startTag
protected void startTag(Element elem) throws IOException, BadLocationException(Code)
Writes out a start tag for the element. Ignores all synthesized elements.
Parameters:
  elem - an Element
exception:
  IOException - on any I/O error



synthesizedElement
protected boolean synthesizedElement(Element elem)(Code)
Returns true if the element is a synthesized element. Currently we are only testing for the p-implied tag.



text
protected void text(Element elem) throws BadLocationException, IOException(Code)
Writes out text. If a range is specified when the constructor is invoked, then only the appropriate range of text is written out.
Parameters:
  elem - an Element
exception:
  IOException - on any I/O error
exception:
  BadLocationException - if pos represents an invalidlocation within the document.



textAreaContent
protected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException(Code)
Writes out text that is contained in a TEXTAREA form element.
Parameters:
  attr - an AttributeSet
exception:
  IOException - on any I/O error
exception:
  BadLocationException - if pos represents an invalidlocation within the document.



write
public void write() throws IOException, BadLocationException(Code)
Iterates over the Element tree and controls the writing out of all the tags and its attributes.
exception:
  IOException - on any I/O error
exception:
  BadLocationException - if pos represents an invalidlocation within the document.



writeAdditionalComments
void writeAdditionalComments() throws IOException(Code)
Writes out any additional comments (comments outside of the body) stored under the property HTMLDocument.AdditionalComments.



writeAttributes
protected void writeAttributes(AttributeSet attr) throws IOException(Code)
Writes out the attribute set. Ignores all attributes with a key of type HTML.Tag, attributes with a key of type StyleConstants, and attributes with a key of type HTML.Attribute.ENDTAG.
Parameters:
  attr - an AttributeSet
exception:
  IOException - on any I/O error



writeComment
void writeComment(String string) throws IOException(Code)
Writes out comment string.
Parameters:
  string - the comment
exception:
  IOException - on any I/O error
exception:
  BadLocationException - if pos represents an invalidlocation within the document.



writeEmbeddedTags
protected void writeEmbeddedTags(AttributeSet attr) throws IOException(Code)
Searches for embedded tags in the AttributeSet and writes them out. It also stores these tags in a vector so that when appropriate the corresponding end tags can be written out.
exception:
  IOException - on any I/O error



writeLineSeparator
protected void writeLineSeparator() throws IOException(Code)
Writes the line separator. This is overriden to make sure we don't replace the newline content in case it is outside normal ascii.
since:
   1.3



writeMaps
void writeMaps(Enumeration maps) throws IOException(Code)
Outputs the maps as elements. Maps are not stored as elements in the document, and as such this is used to output them.



writeOption
protected void writeOption(Option option) throws IOException(Code)
Writes out the content of the Option form element.
Parameters:
  option - an Option
exception:
  IOException - on any I/O error



writeStyle
boolean writeStyle(String name, Style style, boolean outputStyle) throws IOException(Code)
Outputs the named style. outputStyle indicates whether or not a style has been output yet. This will return true if a style is written.



writeStyleEndTag
void writeStyleEndTag() throws IOException(Code)



writeStyleStartTag
void writeStyleStartTag() throws IOException(Code)



writeStyles
void writeStyles(StyleSheet sheet) throws IOException(Code)
Outputs the styles as a single element. Styles are not stored as elements, but part of the document. For the time being styles are written out as a comment, inside a style tag.



Fields inherited from javax.swing.text.AbstractWriter
final protected static char NEWLINE(Code)(Java Doc)

Methods inherited from javax.swing.text.AbstractWriter
protected void decrIndent()(Code)(Java Doc)
protected boolean getCanWrapLines()(Code)(Java Doc)
protected int getCurrentLineLength()(Code)(Java Doc)
protected Document getDocument()(Code)(Java Doc)
protected ElementIterator getElementIterator()(Code)(Java Doc)
public int getEndOffset()(Code)(Java Doc)
protected int getIndentLevel()(Code)(Java Doc)
protected int getIndentSpace()(Code)(Java Doc)
protected int getLineLength()(Code)(Java Doc)
public String getLineSeparator()(Code)(Java Doc)
public int getStartOffset()(Code)(Java Doc)
protected String getText(Element elem) throws BadLocationException(Code)(Java Doc)
protected Writer getWriter()(Code)(Java Doc)
protected boolean inRange(Element next)(Code)(Java Doc)
protected void incrIndent()(Code)(Java Doc)
protected void indent() throws IOException(Code)(Java Doc)
protected boolean isLineEmpty()(Code)(Java Doc)
protected void output(char[] content, int start, int length) throws IOException(Code)(Java Doc)
protected void setCanWrapLines(boolean newValue)(Code)(Java Doc)
protected void setCurrentLineLength(int length)(Code)(Java Doc)
protected void setIndentSpace(int space)(Code)(Java Doc)
protected void setLineLength(int l)(Code)(Java Doc)
public void setLineSeparator(String value)(Code)(Java Doc)
protected void text(Element elem) throws BadLocationException, IOException(Code)(Java Doc)
abstract protected void write() throws IOException, BadLocationException(Code)(Java Doc)
protected void write(char ch) throws IOException(Code)(Java Doc)
protected void write(String content) throws IOException(Code)(Java Doc)
protected void write(char[] chars, int startIndex, int length) throws IOException(Code)(Java Doc)
protected void writeAttributes(AttributeSet attr) throws IOException(Code)(Java Doc)
protected void writeLineSeparator() throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.