javax.swing.plaf.basic
Class BasicHTML

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.plaf.basic.BasicHTML

public class BasicHTML
extends Object sample code for java.lang.Object definition code for java.lang.Object

Support for providing html views for the swing components. This translates a simple html string to a javax.swing.text.View implementation that can render the html and provide the necessary layout semantics.


Field Summary
static String sample code for java.lang.String definition code for java.lang.String documentBaseKey sample code for javax.swing.plaf.basic.BasicHTML.documentBaseKey definition code for javax.swing.plaf.basic.BasicHTML.documentBaseKey
          Key stored as a client property to indicate the base that relative references are resolved against.
static String sample code for java.lang.String definition code for java.lang.String propertyKey sample code for javax.swing.plaf.basic.BasicHTML.propertyKey definition code for javax.swing.plaf.basic.BasicHTML.propertyKey
          Key to use for the html renderer when stored as a client property of a JComponent.
 
Constructor Summary
BasicHTML sample code for javax.swing.plaf.basic.BasicHTML.BasicHTML() definition code for javax.swing.plaf.basic.BasicHTML.BasicHTML() ()
           
 
Method Summary
static View sample code for javax.swing.text.View definition code for javax.swing.text.View createHTMLView sample code for javax.swing.plaf.basic.BasicHTML.createHTMLView(javax.swing.JComponent, java.lang.String) definition code for javax.swing.plaf.basic.BasicHTML.createHTMLView(javax.swing.JComponent, java.lang.String) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c, String sample code for java.lang.String definition code for java.lang.String  html)
          Create an html renderer for the given component and string of html.
static boolean isHTMLString sample code for javax.swing.plaf.basic.BasicHTML.isHTMLString(java.lang.String) definition code for javax.swing.plaf.basic.BasicHTML.isHTMLString(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  s)
          Check the given string to see if it should trigger the html rendering logic in a non-text component that supports html rendering.
static void updateRenderer sample code for javax.swing.plaf.basic.BasicHTML.updateRenderer(javax.swing.JComponent, java.lang.String) definition code for javax.swing.plaf.basic.BasicHTML.updateRenderer(javax.swing.JComponent, java.lang.String) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c, String sample code for java.lang.String definition code for java.lang.String  text)
          Stash the HTML render for the given text into the client properties of the given JComponent.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

propertyKey sample code for javax.swing.plaf.basic.BasicHTML.propertyKey

public static final String sample code for java.lang.String definition code for java.lang.String  propertyKey
Key to use for the html renderer when stored as a client property of a JComponent.

See Also:
Constant Field Values

documentBaseKey sample code for javax.swing.plaf.basic.BasicHTML.documentBaseKey

public static final String sample code for java.lang.String definition code for java.lang.String  documentBaseKey
Key stored as a client property to indicate the base that relative references are resolved against. For example, lets say you keep your images in the directory resources relative to the code path, you would use the following the set the base:
   jComponent.putClientProperty(documentBaseKey,
                                xxx.class.getResource("resources/"));
 

See Also:
Constant Field Values
Constructor Detail

BasicHTML sample code for javax.swing.plaf.basic.BasicHTML() definition code for javax.swing.plaf.basic.BasicHTML()

public BasicHTML()
Method Detail

createHTMLView sample code for javax.swing.plaf.basic.BasicHTML.createHTMLView(javax.swing.JComponent, java.lang.String) definition code for javax.swing.plaf.basic.BasicHTML.createHTMLView(javax.swing.JComponent, java.lang.String)

public static View sample code for javax.swing.text.View definition code for javax.swing.text.View  createHTMLView(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c,
                                  String sample code for java.lang.String definition code for java.lang.String  html)
Create an html renderer for the given component and string of html.


isHTMLString sample code for javax.swing.plaf.basic.BasicHTML.isHTMLString(java.lang.String) definition code for javax.swing.plaf.basic.BasicHTML.isHTMLString(java.lang.String)

public static boolean isHTMLString(String sample code for java.lang.String definition code for java.lang.String  s)
Check the given string to see if it should trigger the html rendering logic in a non-text component that supports html rendering.


updateRenderer sample code for javax.swing.plaf.basic.BasicHTML.updateRenderer(javax.swing.JComponent, java.lang.String) definition code for javax.swing.plaf.basic.BasicHTML.updateRenderer(javax.swing.JComponent, java.lang.String)

public static void updateRenderer(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  c,
                                  String sample code for java.lang.String definition code for java.lang.String  text)
Stash the HTML render for the given text into the client properties of the given JComponent. If the given text is NOT HTML the property will be cleared of any renderer.

This method is useful for ComponentUI implementations that are static (i.e. shared) and get their state entirely from the JComponent.