javax.swing.plaf.basic

Class BasicHTML

public class BasicHTML extends Object

Provides support for HTML rendering to {@link javax.swing.plaf.ComponentUI} implementations.
Field Summary
static StringdocumentBaseKey
The key that is used to store the document base in a JComponent's client properties.
static StringpropertyKey
The key that is used to store a HTML view in a JComponent's client properties.
Constructor Summary
BasicHTML()
Creates a new instance of BasicHTML.
Method Summary
static ViewcreateHTMLView(JComponent c, String html)
Creates a {@link View} instance that can be used by the component c to render the HTML string html.
static booleanisHTMLString(String s)
Returns true if s is HTML, false otherwise.
static voidupdateRenderer(JComponent c, String text)
Stores a HTML renderer in c's client property if text is HTML, otherwise it clears the corresponding client property.

Field Detail

documentBaseKey

public static final String documentBaseKey
The key that is used to store the document base in a JComponent's client properties. The document base is used to resolve relative references in HTML.

propertyKey

public static final String propertyKey
The key that is used to store a HTML view in a JComponent's client properties.

Constructor Detail

BasicHTML

public BasicHTML()
Creates a new instance of BasicHTML. This should not be necessary since all methods in this class are static.

Method Detail

createHTMLView

public static View createHTMLView(JComponent c, String html)
Creates a {@link View} instance that can be used by the component c to render the HTML string html.

Parameters: c the component that needs to render the HTML string html the HTML string to be rendered

Returns: a view that can render the HTML string

isHTMLString

public static boolean isHTMLString(String s)
Returns true if s is HTML, false otherwise.

Parameters: s the string to test

Returns: true if s is HTML, false otherwise

updateRenderer

public static void updateRenderer(JComponent c, String text)
Stores a HTML renderer in c's client property if text is HTML, otherwise it clears the corresponding client property. This is useful for {@link javax.swing.plaf.ComponentUI} implementations that are shared between it's components.

Parameters: c the component to update the renderer for text the string to be rendered