Generated by
JDiff

javax.swing.text.html Documentation Differences

This file contains all the changes in documentation in the package javax.swing.text.html as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class BlockView

A view implementation to display a block (as a box) with CSS specifications. @author Timothy Prinzing @version 1.17 0425 02/2202/9900
Class BlockView, void setParent(View)

SetsEstablishes the parent ofview thefor this view. This is reimplementedguaranteed to provide thebe superclass behavior as well as callingcalled before any other methods if the loadChildren method if thisparent view does not alreadyis have childrenfunctioning properly. The

children should not be loaded inThis is implemented to forward to the constructor becausesuperclass the act of settingas well as call the parent may cause them tosetPropertiesFromAttributes trymethod to search upset the hierarchyparagraph (toproperties getfrom the hostingcss Container for example)attributes. If this view has children (theThe viewcall is beingmade moved from one place inat this time to ensure the view hierarchyability to another) theresolve loadChildrenupward method will not be calledthrough the parents view attributes. @param parent the new parent ofor null if the view null ifis being noneremoved from a parent it was previously added to


Class CSS

Defines a set of CSS attributes as a typesafe enumeration. The htmlHTML View implementations use cssCSS attributes to determine how they will render. This also defines methods to map between CSS/HTML/StyleConstants. Any shorthand properties such as font are mapped to the intrinsic properties.

The following describes the CSS properties that are suppored by the rendering engine:

The following are modeled but currently not rendered.

Note: for the time being we do not fully support relative units unless noted so that p { margin-top: 10% } will be treated as if no margin-top was specified. @author Timothy Prinzing @author Scott Violet @version 1.13 0430 02/2202/9900 @see StyleSheet


Class CSS.Attribute

Definitions to be used as a key on AttributeSet's that might hold cssCSS attributes. Since this is a closed set (i.e. defined exactly by the specification) it is final and cannot be extended.
Class CSS.Attribute, String toString()

The string representation of the attribute. This should exactly match the string specified in the cssCSS specification.

Class CSS, Attribute getAttribute(String)

Translate a string to a CSS.Attribute object. This will return null if there is no attribute by the given name. @param name the name of the cssCSS attribute to fetch the typesafe enumeration for. @returns the CSS.Attribute object or null if the string doesn't represent a valid attribute key.

Class FormView

Component decorator that implements the view interface for form elements <input> <textarea> and <select>. The model for the component is stored as an attribute of the the element (using StyleConstants.ModelAttribute) and is used to build the component of the view. The type of the model is assumed to of the type that would be set by HTMLDocument.HTMLReader.FormAction. If there are multiple views mapped over the document they will share the embedded component models.

The components produced get their opaque property set to false. The following table shows what components get built by this view.
Element Type Component built
input type button JButton
input type checkbox JCheckBox
input type image JButton
input type password JPasswordField
input type radio JRadioButton
input type reset JButton
input type submit JButton
input type text JTextField
select size > 1 or multiple attribute defined JList in a JScrollPane
select size unspecified or 1 JComboBox
textarea JTextArea in a JScrollPane
@author Timothy Prinzing @author Sunita Mani @version 1.6 1114 02/1902/9800

Class FormView, void imageSubmit(String)

This method is called to submit a form in response to a click on an image. i.e-- an <INPUT> form element of type "image". @param the mouse click coordinates.
Class FormView, String SUBMIT

If a value attribute is not specified for a FORM input element of type "submit" or "reset" then thesethis default stringsstring areis used. @deprecated As of 1.3 value now comes from UIManager property FormView.submitButtonText

Class HTML

Constants used in the HTMLDocument. These are basically tag and attribute definitions. @author Timothy Prinzing @author Sunita Mani @version 1.26 0431 02/2202/9900

Class HTMLDocument

A document that models htmlHTML. The purpose of this model is to support both browsing and editing. As a result the structure described by an htmlHTML document is not exactly replicated by default. The element structure that is modeled by default is built by the class HTMLDocument.HTMLReader which implements the HTMLEditorKit.ParserCallback protocol that the parser expects. To change the structure one can subclass HTMLReader and reimplement the method getReader to return the new reader implementation. The documentation for HTMLReader should be consulted for the details of the default structure created. The intent is that the document be non-lossy (although reproducing the htmlHTML format may result in a different format).

The document models only htmlHTML and makes no attempt to store view attributes in it. The elements are identified by the StyleContext.NameAttribute attribute which should always have a value of type HTML.Tag that identifies the kind of element. Some of the elements are (such as comments) are synthesized. The HTMLFactory uses this attribute to determine what kind of view to build.

This document supports incremental loading. The TokenThreshold property controls how much of the parse is buffered before trying to update the element structure of the document. This property is set by the EditorKit so that subclasses can disable it.

The Base property determines the URL against which relative URL'sURLs are resolved against. By default this will be the Document.StreamDescriptionProperty if the value of the property is a URL. If a <baseBASE> tag is encountered the base will become the URL specified by that tag. Because the base URL is a property it can of course be set directly.

The default content storage mechanism for this document is a gap buffer (GapContent). Alternatives can be supplied by using the constructor that takes a Content implementation. @author Timothy Prinzing @author Scott Violet @author Sunita Mani @version 1.115 04133 02/2202/9900


Class HTMLDocument.BlockElement

An element that represents a structualstructural block of htmlHTML.
Class HTMLDocument.BlockElement, constructor HTMLDocument.BlockElement(HTMLDocument, Element, AttributeSet)

Constructs a composite element that initially contains no children. @param parent Thethe parent element @param a the attributes for the element

Class HTMLDocument.HTMLReader

An htmlHTML reader to load an htmlHTML document with an htmlHTML element structure. This is a set of callbacks from the parser implemented to create a set of elements tagged with attributes. The parse builds up tokens (ElementSpec) that describe the element subtree desired and burst it into the document under the protection of a write lock using the insert method on the document outer class.

The reader can be configured by registering actions (of type HTMLDocument.HTMLReader.TagAction) that describe how to handle the action. The idea behind the actions provided is that the most natural text editing operations can be provided if the element structure boils down to paragraphs with runs of some kind of style in them. Some things are more naturally specified structurally so arbitrary structure should be allowed above the paragraphs but will need to be edited with structural actions. The implecationimplication of this is that some of the htmlHTML elements specified in the stream being parsed will be collapsed into attributes and in some cases paragraphs will be synthesized. When htmlHTML elements have been converted to attributes the attribute key will be of type HTML.Tag and the value will be of type AttributeSet so that no information is lost. This enables many of the existing actions to work so that the user can type input hit the return key backspace delete etc and have a reasonable result. Selections can be created and attributes applied or removed etc. With this in mind the work done by the reader can be categorized into the following kinds of tasks:

Block
Build the structure like it's specified in the stream. This produces elements that contain other elements.
Paragraph
Like block except that it's expected that the element will be used with a paragraph view so a paragraph element won't need to be synthesized.
Character
Contribute the element as an attribute that will start and stop at arbitrary text locations. This will ultimately be mixed into a run of text with all of the currently flattened htmlHTML character elements.
Special
Produce an embedded graphical element.
Form
Produce an element that is like the embedded graphical element except that it also has a component model associated with it.
Hidden
Create an element that is hidden from view when the document is being viewed read-only and visible when the document is being edited. This is useful to keep the model from losing information and used to store things like comments and unrecognized tags.

Currently <APPLET> <PARAM> <MAP> <AREA> <LINK> <SCRIPT> and <STYLE> are unsupported.

The assignment of the actions described is shown in the following table for the tags defined in HTML.Tag.
HTML.Tag.A CharacterAction
HTML.Tag.ADDRESS CharacterAction
HTML.Tag.APPLET HiddenAction
HTML.Tag.AREA AreaAction
HTML.Tag.B CharacterAction
HTML.Tag.BASE BaseAction
HTML.Tag.BASEFONT CharacterAction
HTML.Tag.BIG CharacterAction
HTML.Tag.BLOCKQUOTEBlockAction
HTML.Tag.BODY BlockAction
HTML.Tag.BR SpecialAction
HTML.Tag.CAPTION BlockAction
HTML.Tag.CENTER BlockAction
HTML.Tag.CITE CharacterAction
HTML.Tag.CODE CharacterAction
HTML.Tag.DD BlockAction
HTML.Tag.DFN CharacterAction
HTML.Tag.DIR BlockAction
HTML.Tag.DIV BlockAction
HTML.Tag.DL BlockAction
HTML.Tag.DT ParagraphAction
HTML.Tag.EM CharacterAction
HTML.Tag.FONT CharacterAction
HTML.Tag.FORM CharacterAction
HTML.Tag.FRAME SpecialAction
HTML.Tag.FRAMESET BlockAction
HTML.Tag.H1 ParagraphAction
HTML.Tag.H2 ParagraphAction
HTML.Tag.H3 ParagraphAction
HTML.Tag.H4 ParagraphAction
HTML.Tag.H5 ParagraphAction
HTML.Tag.H6 ParagraphAction
HTML.Tag.HEAD HeadAction
HTML.Tag.HR SpecialAction
HTML.Tag.HTML BlockAction
HTML.Tag.I CharacterAction
HTML.Tag.IMG SpecialAction
HTML.Tag.INPUT FormAction
HTML.Tag.ISINDEX IsndexAction
HTML.Tag.KBD CharacterAction
HTML.Tag.LI BlockAction
HTML.Tag.LINK LinkAction
HTML.Tag.MAP MapAction
HTML.Tag.MENU BlockAction
HTML.Tag.META MetaAction
HTML.Tag.NOFRAMES BlockAction
HTML.Tag.OBJECT SpecialAction
HTML.Tag.OL BlockAction
HTML.Tag.OPTION FormAction
HTML.Tag.P ParagraphAction
HTML.Tag.PARAM HiddenAction
HTML.Tag.PRE PreAction
HTML.Tag.SAMP CharacterAction
HTML.Tag.SCRIPT HiddenAction
HTML.Tag.SELECT FormAction
HTML.Tag.SMALL CharacterAction
HTML.Tag.STRIKE CharacterAction
HTML.Tag.S CharacterAction
HTML.Tag.STRONG CharacterAction
HTML.Tag.STYLE StyleAction
HTML.Tag.SUB CharacterAction
HTML.Tag.SUP CharacterAction
HTML.Tag.TABLE BlockAction
HTML.Tag.TD BlockAction
HTML.Tag.TEXTAREA FormAction
HTML.Tag.TH BlockAction
HTML.Tag.TITLE TitleAction
HTML.Tag.TR BlockAction
HTML.Tag.TT CharacterAction
HTML.Tag.U CharacterAction
HTML.Tag.UL BlockAction
HTML.Tag.VAR CharacterAction


Class HTMLDocument.HTMLReader.FormAction

Action to support forms by building all of the elements used to represent form controls. This will process the <inputINPUT> <textareaTEXTAREA> <selectSELECT> and <optionOPTION> tags. The element created by this action is expected to have the attribute StyleConstants.ModelAttribute set to the model that holds the state for the form control. This enables multiple views and allows document to be iterated over picking up the data of the form. The following are the model assignments for the various type of form elements.
Element Type Model Type
input type button DefaultButtonModel
input type checkbox JToggleButton.ToggleButtonModel
input type image DefaultButtonModel
input type password PlainDocument
input type radio JToggleButton.ToggleButtonModel
input type reset DefaultButtonModel
input type submit DefaultButtonModel
input type text or type is null. PlainDocument
select OptionComboBoxModel or an OptionListBoxModel with an item type of Option
textarea TextAreaDocument

Class HTMLDocument.HTMLReader.TagAction

This is anAn action to be performed in response to parsing a tag. This allows customization of how each tag is handled and avoids a large switch statement.

Class HTMLDocument.HTMLReader, void addContent(char[], int, int)

AddAdds some text with the current character attributes. @param embedded the attributes of an embedded object.
Class HTMLDocument.HTMLReader, void addContent(char[], int, int, boolean)

AddAdds some text with the current character attributes. @param embedded the attributes of an embedded object.
Class HTMLDocument.HTMLReader, void addSpecialElement(Tag, MutableAttributeSet)

AddAdds content that is basically specified entirely in the attribute set.
Class HTMLDocument.HTMLReader, void blockClose(Tag)

AddAdds an instruction to the parse buffer to close out a block element of the given type.
Class HTMLDocument.HTMLReader, void blockOpen(Tag, MutableAttributeSet)

AddAdds an instruction to the parse buffer to create a block element with the given attributes.
Class HTMLDocument.HTMLReader, void flush()

ThisThe is the last method called on the reader. It allows any pending changes to be flushed into the document. Since this is currently loading synchronously the entire set of changes are pushed in at this point.
Class HTMLDocument.HTMLReader, void popCharacterStyle()

PopPops a previously pushed character style off the stack to return to a previous style.
Class HTMLDocument.HTMLReader, void preContent(char[])

AddAdds the given content that was encountered in a PRE element. This synthesizes lines to hold the runs of text and makes calls to addContent to actually add the text.
Class HTMLDocument.HTMLReader, void pushCharacterStyle()

PushPushes the current character style on a stack in preparation for forming a new nested character style.
Class HTMLDocument.HTMLReader, void registerTag(Tag, TagAction)

RegisterRegisters a handler for the given tag. By default all of the well-known tags will have been registered. This can be used to change the handling of a particular tag or to add support for custom tags.
Class HTMLDocument.HTMLReader, void textAreaContent(char[])

AddAdds the given content to the textarea document. This method gets called when we are in a textarea context. Therefore all text that is seen belongs to the text area and is hence added to the TextAreaDocument associated with the text area.

Class HTMLDocument.Iterator

An iterator to iterate over a particular type of tag. The iterator is not thread safe. If reliable access to the document is not already ensured by the context under which the iterator is being used it'sits use should be performed under the protection of Document.render.

Class HTMLDocument.RunElement

An element that represents a chunk of text that has a set of htmlHTML character level attributes assigned to it.
Class HTMLDocument.RunElement, constructor HTMLDocument.RunElement(HTMLDocument, Element, AttributeSet, int, int)

Constructs an element that represents content within the document (has no children). @param parent Thethe parent element @param a Thethe element attributes @param offs0 Thethe start offset =(must be at least 0) @param offs1 Thethe end offset =(must be at least offs0)

Class HTMLDocument, constructor HTMLDocument()

Constructs an htmlHTML document.
Class HTMLDocument, constructor HTMLDocument(Content, StyleSheet)

Constructs an htmlHTML document with the given content storage implementation and the given style/attribute storage mechanism. @param c the container for the content @param styles the styles
Class HTMLDocument, constructor HTMLDocument(StyleSheet)

Constructs an htmlHTML document with the default content storage implementation and the given style/attribute storage mechanism. @param styles the styles
Class HTMLDocument, Element createLeafElement(Element, AttributeSet, int, int)

Creates a document leaf element that directly represents text (doesn't have any children). This is implemented to return an element of type HTMLDocument.RunElement. @param parent the parent element @param a the attributes for the element @param p0 the beginning of the range =(must be at least 0) @param p1 the end of the range =(must be at least p0) @return the new element
Class HTMLDocument, URL getBase()

GetGets the location to resolve relative url'sURLs against. By default this will be the documentsdocument's urlURL if the document was loaded from a urlURL. If a base tag is found and can be parsed it will be used as the base location.
Class HTMLDocument, Iterator getIterator(Tag)

FetchFetches an iterator for the following kind of htmlHTML tag. This can be used for things like iterating over the set of anchors contained iterating over the input elements etc.
Class HTMLDocument, ParserCallback getReader(int)

FetchFetches the reader for the parser to use to load the document with htmlHTML. This is implemented to return an instance of HTMLDocument.HTMLReader. Subclasses can reimplement this method to change how the document get structured if desired (e.g. to handle custom tags structurally represent character style elements etc.).
Class HTMLDocument, ParserCallback getReader(int, int, int, Tag)

FetchFetches the reader for the parser to use to load the document with htmlHTML. This is implemented to return an instance of HTMLDocument.HTMLReader. Subclasses can reimplement this method to change how the document get structured if desired (e.g. to handle custom tags structurally represent character style elements etc.). @param popDepth the number of ElementSpec.EndTagTypeEndTagTypes to generate before inserting. @param pushDepth the number of ElementSpec.StartTagTypeStartTagTypes with a direction of ElementSpec.JoinNextDirection that should be generated before inserting but after the end tags have been generated. @param insertTag the first tag to start inserting into document.
Class HTMLDocument, StyleSheet getStyleSheet()

FetchFetches the StyleSheet with the document-specific display rules (CSS) that were specified in the htmlHTML document itself.
Class HTMLDocument, int getTokenThreshold()

GetGets the number of tokens to buffer before trying to update the documents element structure. By default this will be Integer.MAX_VALUE.
Class HTMLDocument, void insert(int, ElementSpec[])

Inserts new elements in bulk. This is how elements get created in the document. The parsing determines what structure is needed and creates the specification as a set of tokens that describe the edit while leaving the document free of a write-lock. This method can then be called in bursts by the reader to acquire a write-lock for a shorter duration (i.e. while the document is actually being altered). @param offset the starting offset @param data the element data @exception BadLocationException for an invalid starting offset @see StyledDocument#insert @exception BadLocationException if the given position does not represent a valid location in the associated document.
Class HTMLDocument, void processHTMLFrameHyperlinkEvent(HTMLFrameHyperlinkEvent)

ThisProcesses method is responsible for processing HyperlinkEvent'sHyperlinkEvents that are generated by documents in an HTML frame. The HyperlinkEvent type as the parameter suggests is HTMLFrameHyperlinkEvent. In addition to the typical information contained in a HyperlinkEvent this event contains the element that corresponds to the frame in which the click happened (i.e. the source element) and the target name. The target name has 4 possible values: 1) If target is _self the action is to change the value of the HTML.Attribute.SRC attribute and fires a ChangedUpdate event. If the target is _parent then it deletes the parent element which is a <FRAMESET> element and inserts a new <FRAME> element and sets its HTML.Attribute.SRC attribute to have a value equal to the destination urlURL and fire ana RemovedUpdate and InsertUpdate. If the target is _top this method does nothing. In the implementation of the view for a frame namely the FrameView the processing of _top is handled. Given that _top implies replacing the entire document it made sense to handle this outside of the document that it will replace. If the target is a named frame then the element hierarchy is searched for an element with a name equal to the target its HTML.Attribute.SRC attribute is updated and a ChangedUpdate event is fired. @param HTMLFrameHyperLinkEvente the event
Class HTMLDocument, void setBase(URL)

SetSets the location to resolve relative url'sURLs against. By default this will be the documentsdocument's urlURL if the document was loaded from a urlURL. If a base tag is found and can be parsed it will be used as the base location.

This also sets the base of the StyleSheet to be u as well as the receiver.

Class HTMLDocument, void setParagraphAttributes(int, int, AttributeSet, boolean)

Sets attributes for a paragraph.

This method is thread safe although most Swing methods are not. Please see Threads and Swing for more information. @param offset the offset into the paragraph =(must be at least 0) @param length the number of characters affected =(must be at least 0) @param s the attributes @param replace whether to replace existing attributes or merge them

Class HTMLDocument, void setTokenThreshold(int)

SetSets the number of tokens to buffer before trying to update the documents element structure.

Class HTMLEditorKit

The Swing JEditorPane text component supports different kinds of content via a plug-in mechanism called an EditorKit. Because HTML is a very popular format of content some support is provided by default. The default support is provided by this class which supports HTML version 3.2 (with some extensions) and is migrating toward version 4.0. The <applet> tag is not supported but some support is provided for the <object> tag.

There are several goals of the HTML EditorKit provided that have an effect upon the way that htmlHTML is modeled. These have influenced its design in a substantial way.

Support editing
It might seem fairly obvious that a plug-in for JEditorPane should provide editing support but that fact has several design considerations. There are a substantial number of htmlHTML documents that don't properly conform to an htmlHTML specification. These must be normalized somewhat into a correct form if one is to edit them. Additionally users don't like to be presented with an excessive amount of structure editing so using traditional text editing gestures is preferred over using the htmlHTML structure exactly as defined in the htmlHTML document.

The modeling of htmlHTML is provided by the class HTMLDocument. It'sIts documention describes the details of how the htmlHTML is modeled. The editing support leverages heavily off of the text package.

Extendable/Scalable
To maximize the usefulness of this kit a great deal of effort has gone into making it extendable. These are some of the features.
  1. The parser is replacable. The default parser is the Hot Java parser which is DTD based. A different DTD can be used or an entirely different parser can be used. To change the parser reimplement the getParser method. The default parser is dynamically loaded when first asked for so the class files will never be loaded if an alternative parser is used. The default parser is in a seperate package called parser below this package.
  2. The parser drives the ParserCallback which is provided by HTMLDocument. To change the callback subclass HTMLDocument and reimplement the createDefaultDocument method to return document that produces a different reader. The reader controls how the document is structured. Although the Document provides HTML support by default there is nothing preventing support of non-htmlHTML tags that result in alternative element structures.
  3. The default view of the models are provided as a hierarchy of View implementations so one can easily customize how a particular element is displayed or add capabilities for new kinds of elements by providing new View implementations. The default set of views are provided by the HTMLFactory class. This can be easily changed by subclassing or replacing the HTMLFactory and reimplementing the getViewFactory method to return the alternative factory.
  4. The View implementations work primarily off of CSS attributes which are kept in the views. This makes it possible to have multiple views mapped over the same model that appear substantially different. This can be especially useful for printing. For most htmlHTML attributes the htmlHTML attributes are converted to cssCSS attributes for display. This helps make the View implementations more general purpose

Asynchronous Loading
Larger documents involve a lot of parsing and take some time to load. By default this kit produces documents that will be loaded asynchronously if loaded using JEditorPane.setPage. This is controlled by a property on the document. The method createDefaultDocument can be overriden to change this. The batching of work is done by the HTMLDocument.HTMLReader class. The actual work is done by the DefaultStyledDocument and AbstractDocument classes in the text package.

Customization from current LAF
HTML provides a well known set of features without exactly specifying the display characteristics. Swing has a theme mechanism for its look-and-feel implementations. It is desirable for the look-and-feel to feed display characteristics into the HTML views. An user with poor vision for example would want high contrast and larger than typical fonts.

The support for this is provided by the StyleSheet class. The presentation of the HTML can be heavily influenced by the setting of the StyleSheet property on the EditorKit.

Not lossy
An EditorKit has the ability to be read and save documents. It is generally the most pleasing to users if there is no loss of data between the two operation. The policy of the HTMLEditorKit will be to store things not recognized or not necessarily visible so they can be subsequently written out. The model of the htmlHTML document should therefore contain all information discovered while reading the document. This is constrained in some ways by the need to support editing (i.e. incorrect documents sometimes must be normalized). The guiding principle is that information shouldn't be lost but some might be synthesized to produce a more correct model or it might be rearranged.
@author Timothy Prinzing @version 1.81 0999 01/2721/0001

Class HTMLEditorKit.HTMLFactory

A factory to build views for htmlHTML. The following table describes what this factory will build by default.
TagView created
HTML.Tag.CONTENTInlineView
HTML.Tag.IMPLIEDjavax.swing.text.html.ParagraphView
HTML.Tag.Pjavax.swing.text.html.ParagraphView
HTML.Tag.H1javax.swing.text.html.ParagraphView
HTML.Tag.H2javax.swing.text.html.ParagraphView
HTML.Tag.H3javax.swing.text.html.ParagraphView
HTML.Tag.H4javax.swing.text.html.ParagraphView
HTML.Tag.H5javax.swing.text.html.ParagraphView
HTML.Tag.H6javax.swing.text.html.ParagraphView
HTML.Tag.DTjavax.swing.text.html.ParagraphView
HTML.Tag.MENUListView
HTML.Tag.DIRListView
HTML.Tag.ULListView
HTML.Tag.OLListView
HTML.Tag.LIBlockView
HTML.Tag.DLBlockView
HTML.Tag.DDBlockView
HTML.Tag.BODYBlockView
HTML.Tag.HTMLBlockView
HTML.Tag.CENTERBlockView
HTML.Tag.DIVBlockView
HTML.Tag.BLOCKQUOTEBlockView
HTML.Tag.PREBlockView
HTML.Tag.BLOCKQUOTEBlockView
HTML.Tag.PREBlockView
HTML.Tag.IMGImageView
HTML.Tag.HRHRuleView
HTML.Tag.BRBRView
HTML.Tag.TABLEjavax.swing.text.html.TableView
HTML.Tag.INPUTFormView
HTML.Tag.SELECTFormView
HTML.Tag.TEXTAREAFormView
HTML.Tag.OBJECTObjectView
HTML.Tag.FRAMESETFrameSetView
HTML.Tag.FRAMEFrameView

Class HTMLEditorKit.InsertHTMLTextAction

InsertHTMLTextAction can be used to insert an arbitrary string of HTML into an existing HTML document. At least two HTML.Tags need to be supplied. The first Tag parentTag identifies the parent in the document to add the elements to. The second tag addTag identifies the first tag that should be added to the document as seen in the HTML string. One important thing to remember is that the parser is going to generate all the appropriate tags even if they aren't in the HTML string passed in.

For example lets say you wanted to create an action to insert a table into the body. The parentTag would be HTML.Tag.BODY addTag would be HTML.Tag.TABLE and the string could be something like <table&gt;&lt;tr><td></td&gt;&lt;/tr></table>.

There is also an option to supply an alternate parentTag and addTag. These will be checked for if there is no parentTag at offset.

Class HTMLEditorKit.InsertHTMLTextAction, void actionPerformed(ActionEvent)

Inserts the htmlHTML into the document. @param eae the event
Class HTMLEditorKit.InsertHTMLTextAction, void insertAtBoundry(JEditorPane, HTMLDocument, int, Element, String, Tag, Tag)

This is invoked when inserting at a boundryboundary. It determines the number of pops and then the number of pushes that need to be performed and then invokes insertHTML. @deprecated As of Java 2 platform v1.3 use insertAtBoundary

Class HTMLEditorKit.ParserCallback

The result of parsing drives these callback methods. The open and close actions should be balanced. The flush method will be the last method called to give the receiver a chance to flush any pending data into the document.

Refer to DocumentParser the default parser used for further information on the contents of the AttributeSets the positions and other info. @see javax.swing.text.html.parser.DocumentParser


Class HTMLEditorKit, Parser getParser()

Fetch the parser to use for reading htmlHTML streams. This can be reimplemented to provide a different parser. The default implementation is loaded dynamically to avoid the overhead of loading the default parser if it's not used. The default parser is the HotJava parser using an htmlHTML 3.2 dtdDTD.
Class HTMLEditorKit, StyleSheet getStyleSheet()

Get the set of styles currently being used to render the htmlHTML elements. By default the resource specified by DEFAULT_CSS gets loaded and is shared by all HTMLEditorKit instances.
Class HTMLEditorKit, void insertHTML(HTMLDocument, int, String, int, int, Tag)

Inserts HTML into an existing document. @param doc Documentthe document to insert into. @param offset the offset to insert HTML at @param popDepth the number of ElementSpec.EndTagTypeEndTagTypes to generate before inserting. @param pushDepth the number of ElementSpec.StartTagTypeStartTagTypes with a direction of ElementSpec.JoinNextDirection that should be generated before inserting but after the end tags have been generated. @param insertTag the first tag to start inserting into document. @exception RuntimeException (will eventually be a BadLocationException) if pos is invalid.
Class HTMLEditorKit, void read(Reader, Document, int)

Inserts content from the given stream. If doc is an instance of HTMLDocument this will read htmlHTML 3.2 text. Inserting htmlHTML into a non-empty document must be inside the body Element if you do not insert into the body an exception will be thrown. When inserting into a non-empty document all tags outside of the body (head title) will be dropped. @param in Thethe stream to read from @param doc Thethe destination for the insertion. @param pos Thethe location in the document to place the content. @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document. @exception RuntimeException (will eventually be a BadLocationException) if pos is invalid.
Class HTMLEditorKit, void setStyleSheet(StyleSheet)

Set the set of styles to be used to render the various htmlHTML elements. These styles are specified in terms of cssCSS specifications. Each document produced by the kit will have a copy of the sheet which it can add the document specific styles to. By default the StyleSheet specified is shared by all HTMLEditorKit instances. This should be reimplemented to provide a finer granularity if desired.
Class HTMLEditorKit, void write(Writer, Document, int, int)

Write content from a document to the given stream in a format appropriate for this kind of content handler. @param out Thethe stream to write to @param doc Thethe source for the write. @param pos Thethe location in the document to fetch the content. @param len Thethe amount to write out. @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.

Class HTMLFrameHyperlinkEvent

HTMLFrameHyperlinkEvent is used to notify interested parties that link was activated in a frame. @author Sunita Mani @version 1.2 084 02/2602/9800

Class HTMLWriter

This is a writer for HTMLDocuments. @author Sunita Mani @version 1.23 0426 02/2202/9900
Class HTMLWriter, constructor HTMLWriter(Writer, HTMLDocument)

Creates a new HTMLWriter. @param w a Writer @param doc an HTMLDocument
Class HTMLWriter, constructor HTMLWriter(Writer, HTMLDocument, int, int)

Creates a new HTMLWriter. @param w a Writer @param doc an HTMLDocument @param pos Thethe document location in thefrom documentwhich to fetch the content. @param len Thethe amount to write out.
Class HTMLWriter, void closeOutUnwantedEmbeddedTags(AttributeSet)

ThisSearches method 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
Class HTMLWriter, void comment(Element)

Writes out comments. @param elem an element.Element @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.
Class HTMLWriter, void emptyTag(Element)

Writes out all empty elements i.e(all tags that have no corresponding end tag). @param elem an Element. @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.
Class HTMLWriter, void endTag(Element)

Writes out an end tag for the element. @param elem an Element. @exception IOException on any I/O error
Class HTMLWriter, void incrIndent()

Increments the indent level. If indenting would cause getIndentSpace() *getIndentLevel() to be > than getLineLength() this will not cause an indent.
Class HTMLWriter, void indent()

Does indentation. The number of spaces written out is indent level times the space to map mapping. If the current line is empty this will not make it so that the current line is still considered empty. @exception IOException on any I/O error
Class HTMLWriter, boolean isBlockTag(AttributeSet)

Determines if the HTML.Tag associated with the element is a block tag. @param attr an AttributeSet. @return true if tag is block tag false otherwise.
Class HTMLWriter, boolean matchNameAttribute(AttributeSet, Tag)

ThisReturns method return true if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter.
Class HTMLWriter, void selectContent(AttributeSet)

Writes out the content of the SELECT form element. @param attr the AttributeSet associcatedassociated with the form element. @exception IOException on any I/O error
Class HTMLWriter, void startTag(Element)

Writes out a start tag for the element. Ignores all synthesized elements. @param elem an Element. @exception IOException on any I/O error
Class HTMLWriter, boolean synthesizedElement(Element)

ThisReturns method returns true if the element is a synthesized element. Currently we are only testing for the p-implied tag.
Class HTMLWriter, void text(Element)

Writes out text. If a range is specified when the constructor is invoked then only the appropriate range of text is written out. @param elem an Element. @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.
Class HTMLWriter, void textAreaContent(AttributeSet)

Writes out text that is contained in a TEXTAREA form element. @param attr an AttributeSet @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.
Class HTMLWriter, void write()

ThisIterates is method that iterates over the 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 invalid location within the document.
Class HTMLWriter, void writeAttributes(AttributeSet)

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. @param attr an AttributeSet. @exception IOException on any I/O error
Class HTMLWriter, void writeEmbeddedTags(AttributeSet)

ThisSearches method 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
Class HTMLWriter, void writeOption(Option)

Writes out the content of the Option form element. @param option an Option. @exception IOException on any I/O error

Class InlineView

Displays the inline element styles based upon css attributes. @author Timothy Prinzing @version 1.12 0919 02/2502/9800
Class InlineView, int getBreakWeight(int, float, float)

Determines how attractive a break opportunity in this view is. This can be used for determining which view is the most attractive to call breakView on in the process of formatting. A view that represents text that has whitespace in it might be more attractive than a view that has no whitespace for example. The higher the weight the more attractive the break. A value equal to or lower than View.BadBreakWeight should not be considered for a break. A value greater than or equal to View.ForcedBreakWeight should be broken.

This is implemented to forward toprovide the superclassdefault for thebehavior Y_AXIS.of Alongreturning theBadBreakWeight X_AXISunless the following values may belength is greater than returned.the length View.ExcellentBreakWeightof ifthe there is whitespace proceedingview in which case the desiredentire breakview location.represents View.BadBreakWeightthe iffragment. the desired break location results in a break location of the startingUnless a view has been written to support breaking behavior it is offset.not View.GoodBreakWeightattractive ifto the other conditionstry and break don'tthe occurview. An This willexample normally result in the behavior ofof a view that does support breaking onis aLabelView. whitespace location if one can be found otherwise breaking betweenAn example of a view that uses break weight is charactersParagraphView. @param axis may be either View.X_AXIS or View.Y_AXIS @param pos the potential location of the start of the broken view >= 0. This may be useful for calculating tab positions. @param len specifies the relative length from pos where a potential break is desired >= 0. @return the weight which should be a value between View.ForcedBreakWeight and View.BadBreakWeight. @see LabelView @see ParagraphView @see javax.swing.text.View#BadBreakWeight @see javax.swing.text.View#GoodBreakWeight @see javax.swing.text.View#ExcellentBreakWeight @see javax.swing.text.View#ForcedBreakWeight


Class ListView

A view implementation to display an html list @author Timothy Prinzing @version 1.23 0425 02/2202/9900

Class MinimalHTMLWriter

MinimalHTMLWriter is a fallback writer used by the HTMLEditorKit to write out HTML for a document that is a not produced by the EditorKit. The format for the document is:
 <html> <head> <style> < -- list of named styles p.normal { font-family: SansSerif; margin-height: 0; font-size: 14 } --> </style> </head> <body> <p style=normal> boldBold italic and underline attributes of the run are emitted as htmlHTML tags. The remaining attributes are emitted as part of the style attribute of a <span> tag. The syntax is similar to inline styles. </p> </body> </html> 
@author Sunita Mani @version 1.811 0402/2202/9900
Class MinimalHTMLWriter, constructor MinimalHTMLWriter(Writer, StyledDocument)

Creates a new MinimalHTMLWriter. @param aw Writer @param andoc StyledDocument
Class MinimalHTMLWriter, constructor MinimalHTMLWriter(Writer, StyledDocument, int, int)

Creates a new MinimalHTMLWriter. @param aw Writer @param andoc StyledDocument @param pos The location in the document to fetch the content. @param len The amount to write out.
Class MinimalHTMLWriter, void endFontTag()

This is no longer used instead <span> will be written out.

Writes out an end tag for the <font> tag. @exception IOException on any I/O error

Class MinimalHTMLWriter, boolean inFontTag()

Returns true if we are currently in a <font> tag.
Class MinimalHTMLWriter, void startFontTag(String)

This is no longer used instead <span> will be written out.

Writes out a start tag for the <font> tag. GivenBecause that font tags cannot be nested if we are already in a font tagthis itmethod closes out theany enclosing font tag before writing out a new start tag. @exception IOException on any I/O error

Class MinimalHTMLWriter, void text(Element)

ThisWrites method is responsible for writingout text out. @exception IOException on any I/O error
Class MinimalHTMLWriter, void write()

This methodGenerates HTML is responsible for generating html output from a StyledDocument. @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.
Class MinimalHTMLWriter, void writeAttributes(AttributeSet)

ThisWrites method writes out all the attributes that are for the following types: StyleConstants.ParagraphConstants StyleConstants.CharacterConstants StyleConstants.FontConstants StyleConstants.ColorConstants. The attribute name and value are separated by a colon And. eachEach pair is separatdseparated by a semicolon. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeBody()

This method iteratesIterates over the elements in the document and processes elements based on whether they are branch elements or leaf elements. ItThis method specially handles leaf elements that are text. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeComponent(Element)

Responsible for handling Component Elements; deliberately unimplemented. How this method is implemented is a matter of policy. Hence left unimplemented.
Class MinimalHTMLWriter, void writeContent(Element, boolean)

ThisWrites method handles writing out text. It invokes methods that are responsible for writing out itsthe attribute set in a manner that is htmlan HTML-compliant manner. @exception IOException on any I/O error @exception BadLocationException if pos represents an invalid location within the document.
Class MinimalHTMLWriter, void writeEndParagraph()

ThisEmits method handles emiting an end tag for a <p> tag. PriorBefore to writing out the tag itthis method ensures that all other tags that have been opened are appropriately closed off. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeEndTag(String)

ThisWrites method writes out aan end tag approriratelyappropriately indented. It alsoAlso decrements the indent level. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeHTMLTags(AttributeSet)

ThisGenerates method is responsible for generating bold italics <b> italic <i> and <u> tags for the text based on its attribute settings. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeHeader()

ThisWrites method writes out the <head> and <style> tags. It Thenand then invokes writeStyles() to write out all the named styles as the content of the <style> tag. The content is surrounded by valid htmlHTML comment markers to ensure that the document is viewable in applications/browsers that do not support the tag. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeImage(Element)

Responsible for handling Icon Elements. This method; is deliberatlydeliberately unimplemented. How to implement it is morethis method is an issue of policy --. forFor example if one wasyou're to generategenerating an <img> tag the question does arise about how one wouldshould you represent the src attribute i.e(the location of the image.) In certain cases it could be a urlURL in others it could be read from a stream. @param anelem element foof type StyleConstants.IconElementName
Class MinimalHTMLWriter, void writeLeaf(Element)

Responsible for writing out other non -text leaf elements. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeNonHTMLAttributes(AttributeSet)

ThisWrites method is responsible for writing out the remaining character -level attributes (i e attributes other than bold italicsitalic and underlieunderline) in an html HTML-compliant way. Given that attributes likesuch as font family and font size etc.. have no direct mapping to htmlHTML tags a <span> tag is generated and its style attribute is set to contain the list of remaining attributes just like inline styles. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeStartParagraph(Element)

ThisEmits method emits the start tag for a paragraph. If the paragraph has a named style associated with it then itthis method also generates a class attribute for the <p> tag and set'ssets its value to be the name of the style. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeStartTag(String)

ThisWrites method writes out a start tag approriratelyappropriately indented. It alsoAlso increments the indent level. @exception IOException on any I/O error
Class MinimalHTMLWriter, void writeStyles()

ThisWrites method writes out all the named styles as the content of the <style> tag. @exception IOException on any I/O error

Class ObjectView

Component decorator that implements the view interface for <object> elements.

This view will try to load the class specified by the classid attribute. If possible the Classloader used to load the associated Document is used. This would typically be the same as the ClassLoader used to load the EditorKit. If the documents ClassLoader is null Class.forName is used.

If the class can successfully be loaded an attempt will be made to create an instance of it by calling Class.newInstance. An attempt will be made to narrow the instance to type java.awt.Component to display the object.

This view can also manage a set of parameters with limitations. The parameters to the <object> element are expected to be present on the associated elements attribute set as simple strings. Each bean property will be queried as a key on the AttributeSet with the expectation that a non-null value (of type String) will be present if there was a parameter specification for the property. Reflection is used to set the parameter. Currently this is limited to a very simple single parameter of type String.

A simple example html invocation is:

    
@author Timothy Prinzing @version 1.5 097 02/2102/9800

Class Option

Value for the ListModel used to represent <option> elements. This is the object installed as items of the DefaultComboBoxModel used to represent the <select> element. @author Timothy Prinzing @version 1.5 117 02/1902/9800

Class ParagraphView

Displays the a paragraph and uses css attributes for its configuration. @author Timothy Prinzing @version 1.17 0421 02/2202/9900
Class ParagraphView, void changedUpdate(DocumentEvent, Shape, ViewFactory)

Gives notification from the document that attributes were changed in a location that this view is responsible for. This causes the set of view attributes to be recomputed. @param echanges the change information from the associated document @param a the current allocation of the view @param f the factory to use to rebuild if the view has children @see View#changedUpdate
Class ParagraphView, float getMaximumSpan(int)

Determines the maximum span for this view along an axis. Returns 0 if the view is not visible otherwise it calls the superclass method ot get the maximum span. @param axis may be either View.X_AXIS or View.Y_AXIS @returns the maximum span the view can be rendered into. @see javax.swing.text.ParagraphView#getMaximumSpan
Class ParagraphView, float getMinimumSpan(int)

Determines the minimum span for this view along an axis. Returns 0 if the view is not visible otherwise it calls the superclass method to get the minimum span. @param axis may be either View.X_AXIS or View.Y_AXIS @returns the minimum span the view can be rendered into. @see javax.swing.text.ParagraphView#getMinimumSpan
Class ParagraphView, float getPreferredSpan(int)

Determines the preferred span for this view. Returns 0 if the view is not visible otherwise it calls the superclass method to get the preferred span. axis. @param axis may be either View.X_AXIS or View.Y_AXIS @returns the span the view would like to be rendered into. Typically the view is told to render into the span that is returned although there is no guarantee. The parent may choose to resize or break the view. @see javax.swing.text.ParagraphView#getPreferredSpan

Class StyleSheet

Support for defining the visual characteristics of htmlHTML views being rendered. The StyleSheet is used to translate the htmlHTML model into visual characteristics. This enables views to be customized by a look-and-feel multiple views over the same model can be rendered differently etc. This can be thought of as a CSS rule repository. The key for CSS attributes is an object of type CSS.Attribute. The type of the value is up to the StyleSheet implementation but the toString method is required to return a string representation of CSS value.

The primary entry point for HTML View implementations to get their attributes is the getViewAttributes method. This should be implemented to establish the desired policy used to associate attributes with the view. Each HTMLEditorKit (i.e. and therefore each associated JEditorPane) can have its own StyleSheet but by default one sheet will be shared by all of the HTMLEditorKit instances. HTMLDocument instance can also have a StyleSheet which holds the document-specific CSS specifications.

In order for Views to store less state and therefore be more lightweight the StyleSheet can act as a factory for painters that handle some of the rendering tasks. This allows implementations to determine what they want to cache and have the sharing potentially at the level that a selector is common to multiple views. Since the StyleSheet may be used by views over multiple documents and typically the htmlHTML attributes don't effect the selector being used the potential for sharing is significant.

The rules are stored as named styles and other information is stored to translate the context of an element to a rule quickly. The following code fragment will display the named styles and therefore the CSS rules contained.

     import java.util.*;   import javax.swing.text.*;   import javax.swing.text.html.*;     public class ShowStyles {     public static void main(String[] args) {   HTMLEditorKit kit = new HTMLEditorKit();   HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();   StyleSheet styles = doc.getStyleSheet();     Enumeration rules = styles.getStyleNames();   while (rules.hasMoreElements()) {   String name = (String) rules.nextElement();   Style rule = styles.getStyle(name);   System.out.println(rule.toString());   }   System.exit(0);   }   }   

The semantics for when a CSS style should overide visual attributes defined by an element are not well defined. For example the html <body bgcolor=red> makes the body have a red background. But if the html file also contains the CSS rule body { background: blue } it becomes less clear as to what color the background of the body should be. The current implemention gives visual attributes defined in the element the highest precedence that is they are always checked before any styles. Therefore in the previous example the background would have a red color as the body element defines the background color to be red.

As already mentioned this supports CSS. We don't support the full CSS spec. Refer to the javadoc of the CSS class to see what properties we support. The two major CSS parsing related concepts we do not currently support are pseudo selectors such as A:link { color: red } and the important modifier.

Note: This implementation is currently incomplete. It can be replaced with alternative implementations that are complete. Future versions of this class will provide better CSS support. @author Timothy Prinzing @author Sunita Mani @author Sara Swanson @author Jill Nakata @version 1.53 0463 02/2202/9900


Class StyleSheet.BoxPainter

Class to carry out some of the duties of cssCSS formatting. Implementations of this class enable views to present the cssCSS formatting while not knowing anything about how the cssCSS values are being cached.

As a delegate of Views this object is responsible for the insets of a View and making sure the background is maintained according to the cssCSS attributes.

Class StyleSheet.BoxPainter, float getInset(int, View)

FetchsFetches the inset needed on a given side to account for the margin border and padding. @param side The size of the box to fetch the inset for. This can be View.TOP View.LEFT View.BOTTOM or View.RIGHT. @param v the view making the request. This is used to get the AttributeSet and may be used to resolve percentage arguments. @exception IllegalArgumentException for an invalid direction
Class StyleSheet.BoxPainter, void paint(Graphics, float, float, float, float, View)

Paints the cssCSS box according to the attributes given. This should paint the border padding and background. @param g the rendering surface. @param x the x coordinate of the allocated area to render into. @param y the y coordinate of the allocated area to render into. @param w the width of the allocated area to render into. @param h the height of the allocated area to render into. @param v the view making the request. This is used to get the AttributeSet and may be used to resolve percentage arguments.

Class StyleSheet.ListPainter

classClass to carry out some of the duties of cssCSS list formatting. Implementations of this class enable views to present the cssCSS formatting while not knowing anything about how the cssCSS values are being cached.
Class StyleSheet.ListPainter, void paint(Graphics, float, float, float, float, View, int)

Paints the cssCSS list decoration according to the attributes given. @param g the rendering surface. @param x the x coordinate of the list item allocation @param y the y coordinate of the list item allocation @param w the width of the list item allocation @param h the height of the list item allocation @param s the allocated area to paint into. @param item which list item is being painted. This is a number =greater than or equal to 0.

Class StyleSheet, AttributeSet addAttribute(AttributeSet, Object, Object)

Adds an attribute to the given set and returns the new representative set. This is reimplemented to convert StyleConstant attributes to CSS prior to forwarding to the superclass behavior. The the StyleConstants attribute has no corresponding CSS entry the StyleConstants attribute is stored (but will likely be unused). @param old the old attribute set @param key the non-null attribute key @param value the attribute value @return the updated attribute set @see MutableAttributeSet#addAttribute
Class StyleSheet, void addRule(String)

AddAdds a set of rules to the sheet. The rules are expected to be in valid CSS format. Typically this would be called as a result of parsing a <style> tag.
Class StyleSheet, MutableAttributeSet createLargeAttributeSet(AttributeSet)

CreateCreates a large set of attributes that should trade off space for time. This set will not be shared. This is a hook for subclasses that want to alter the behavior of the larger attribute storage format (which is SimpleAttributeSet by default). This can be reimplemented to return a MutableAttributeSet that provides some sort of attribute conversion. @param a The set of attributes to be represented in the the larger form.
Class StyleSheet, SmallAttributeSet createSmallAttributeSet(AttributeSet)

CreateCreates a compact set of attributes that might be shared. This is a hook for subclasses that want to alter the behavior of SmallAttributeSet. This can be reimplemented to return an AttributeSet that provides some sort of attribute conversion. @param a The set of attributes to be represented in the the compact form.
Class StyleSheet, BoxPainter getBoxPainter(AttributeSet)

FetchFetches the box formatter to use for the given set of cssCSS attributes.
Class StyleSheet, AttributeSet getDeclaration(String)

TranslateTranslates a CSS declaration to an AttributeSet that represents the CSS declaration. Typically this would be called as a result of encountering an HTML style attribute.
Class StyleSheet, Font getFont(AttributeSet)

FetchFetches the font to use for the given set of attributes.
Class StyleSheet, ListPainter getListPainter(AttributeSet)

FetchFetches the list formatter to use for the given set of cssCSS attributes.
Class StyleSheet, float getPointSize(String)

Given a string such as "+2" "-2" or "2". returns a point size value.
Class StyleSheet, float getPointSize(int)

ReturnReturns the point size given a size index.
Class StyleSheet, Style getRule(String)

FetchFetches the rule that best matches the selector given in string form. Where selector is a space separated String of the element names. For example selector might be 'html body tr td''

The attributes of the returned Style will change as rules are added and removed. That is if you to ask for a rule with a selector "table p" and a new rule was added with a selector of "p" the returned Style would include the new attributes from the rule "p".

Class StyleSheet, Style getRule(Tag, Element)

FetchFetches the style to use to render the given type of htmlHTML tag. The element given is representing the tag and can be used to determine the nesting for situations where the attributes will differ if nesting inside of elements. @param t the type to translate to visual attributes. @param e the element representing the tag. The element can be used to determine the nesting for situations where the attributes will differ if nested inside of other elements. @returns the set of cssCSS attributes to use to render the tag.
Class StyleSheet, AttributeSet getViewAttributes(View)

FetchFetches a set of attributes to use in the view for displaying. This is basically a set of attributes that can be used for View.getAttributes.
Class StyleSheet, void loadRules(Reader, URL)

LoadLoads a set of rules that have been specified in terms of CSS1 grammar. If there are collisions with existing rules the newly specified rule will win. @param in the stream to read the cssCSS grammar from. @param ref the reference urlURL. This value represents the location of the stream and may be null. All relative urlsURLs specified in the stream will be based upon this parameter.
Class StyleSheet, Color stringToColor(String)

ConvertConverts a color string such as "RED" or "#NNNNNN" to a Color. Note: This will only convert the HTML3.2 colorscolor strings or a string of length 7; otherwise it will return null.
Class StyleSheet, AttributeSet translateHTMLToCSS(AttributeSet)

ConvertConverts a set of htmlHTML attributes to an equivalent set of cssCSS attributes. @param AttributeSet containing the HTML attributes. @param AttributeSet containing the corresponding CSS attributes. The AttributeSet will be empty if there are no mapping CSS attributes.