Save This Page
Home » openjdk-7 » javax » swing » text » html » [javadoc | source]
javax.swing.text.html
static class: CSS.CssValue [javadoc | source]
java.lang.Object
   javax.swing.text.html.CSS$CssValue

All Implemented Interfaces:
    Serializable

Direct Known Subclasses:
    BackgroundPosition, BorderStyle, FontSize, ColorValue, LengthValue, CssValueMapper, FontFamily, BackgroundImage, BorderWidthValue, StringValue, FontWeight

Base class to CSS values in the attribute sets. This is intended to act as a convertor to/from other attribute formats.

The CSS parser uses the parseCssValue method to convert a string to whatever format is appropriate a given key (i.e. these convertors are stored in a map using the CSS.Attribute as a key and the CssValue as the value).

The HTML to CSS conversion process first converts the HTML.Attribute to a CSS.Attribute, and then calls the parseHtmlValue method on the value of the HTML attribute to produce the corresponding CSS value.

The StyleConstants to CSS conversion process first converts the StyleConstants attribute to a CSS.Attribute, and then calls the fromStyleConstants method to convert the StyleConstants value to a CSS value.

The CSS to StyleConstants conversion process first converts the StyleConstants attribute to a CSS.Attribute, and then calls the toStyleConstants method to convert the CSS value to a StyleConstants value.
Field Summary
 String svalue    The value as a string... before conversion to a binary format. 
Method from javax.swing.text.html.CSS$CssValue Summary:
fromStyleConstants,   parseCssValue,   parseHtmlValue,   toString,   toStyleConstants
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.html.CSS$CssValue Detail:
 Object fromStyleConstants(StyleConstants key,
    Object value) 
    Converts a StyleConstants attribute value to a CSS attribute value. If there is no conversion, returns null. By default, there is no conversion.
 Object parseCssValue(String value) 
    Convert a CSS value string to the internal format (for fast processing) used in the attribute sets. The fallback storage for any value that we don't have a special binary format for is a String.
 Object parseHtmlValue(String value) 
    Convert an HTML attribute value to a CSS attribute value. If there is no conversion, return null. This is implemented to simply forward to the CSS parsing by default (since some of the attribute values are the same). If the attribute value isn't recognized as a CSS value it is generally returned as null.
 public String toString() 
    Return the CSS format of the value
 Object toStyleConstants(StyleConstants key,
    View v) 
    Converts a CSS attribute value to a StyleConstants value. If there is no conversion, returns null. By default, there is no conversion.