javax.swing.plaf.basic
Class BasicHTML

java.lang.Object
  extended by javax.swing.plaf.basic.BasicHTML

public class BasicHTML
extends Object

Provides support for HTML rendering to ComponentUI implementations.


Field Summary
static String documentBaseKey
          The key that is used to store the document base in a JComponent's client properties.
static String propertyKey
          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 View createHTMLView(JComponent c, String html)
          Creates a View instance that can be used by the component c to render the HTML string html.
static boolean isHTMLString(String s)
          Returns true if s is HTML, false otherwise.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyKey

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values
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 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 ComponentUI implementations that are shared between it's components.

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