22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package javax.swing.text.html; 26 27 import java.util.Enumeration; 28 import java.awt.*; 29 import javax.swing.*; 30 import javax.swing.text.*; 31 import java.beans.*; 32 import java.lang.reflect.*; 33 34 import sun.reflect.misc.MethodUtil; 35 import sun.reflect.misc.ReflectUtil; 36 37 /** 38 * Component decorator that implements the view interface 39 * for <object> elements. 40 * <p> 41 * This view will try to load the class specified by the 42 * <code>classid</code> attribute. If possible, the Classloader 43 * used to load the associated Document is used. 44 * This would typically be the same as the ClassLoader 45 * used to load the EditorKit. If the document's 46 * ClassLoader is null, <code>Class.forName</code> is used. 47 * <p> 48 * If the class can successfully be loaded, an attempt will 49 * be made to create an instance of it by calling 50 * <code>Class.newInstance</code>. An attempt will be made 51 * to narrow the instance to type <code>java.awt.Component</code> 52 * to display the object. 53 * <p> 54 * This view can also manage a set of parameters with limitations. 55 * The parameters to the <object> element are expected to 56 * be present on the associated elements attribute set as simple 57 * strings. Each bean property will be queried as a key on 58 * the AttributeSet, with the expectation that a non-null value 59 * (of type String) will be present if there was a parameter 60 * specification for the property. Reflection is used to 61 * set the parameter. Currently, this is limited to a very 62 * simple single parameter of type String. 63 * <p> 64 * A simple example HTML invocation is: 65 * <pre> 66 * <object classid="javax.swing.JLabel"> 67 * <param name="text" value="sample text"> 68 * </object> 69 * </pre> 70 * 71 * @author Timothy Prinzing | 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 package javax.swing.text.html; 26 27 import java.util.Enumeration; 28 import java.awt.*; 29 import javax.swing.*; 30 import javax.swing.text.*; 31 import java.beans.*; 32 import java.lang.reflect.*; 33 34 import sun.reflect.misc.MethodUtil; 35 import sun.reflect.misc.ReflectUtil; 36 37 /** 38 * Component decorator that implements the view interface 39 * for <object> elements. 40 * <p> 41 * This view will try to load the class specified by the 42 * {@code classid} attribute. If possible, the Classloader 43 * used to load the associated Document is used. 44 * This would typically be the same as the ClassLoader 45 * used to load the EditorKit. If the document's 46 * ClassLoader is null, {@code Class.forName} is used. 47 * <p> 48 * If the class can successfully be loaded, an attempt will 49 * be made to create an instance of it by calling 50 * {@code Class.newInstance}. An attempt will be made 51 * to narrow the instance to type {@code java.awt.Component} 52 * to display the object. 53 * <p> 54 * This view can also manage a set of parameters with limitations. 55 * The parameters to the <object> element are expected to 56 * be present on the associated elements attribute set as simple 57 * strings. Each bean property will be queried as a key on 58 * the AttributeSet, with the expectation that a non-null value 59 * (of type String) will be present if there was a parameter 60 * specification for the property. Reflection is used to 61 * set the parameter. Currently, this is limited to a very 62 * simple single parameter of type String. 63 * <p> 64 * A simple example HTML invocation is: 65 * <pre> 66 * <object classid="javax.swing.JLabel"> 67 * <param name="text" value="sample text"> 68 * </object> 69 * </pre> 70 * 71 * @author Timothy Prinzing |