equal
deleted
inserted
replaced
89 protected Component createComponent() { |
89 protected Component createComponent() { |
90 AttributeSet attr = getElement().getAttributes(); |
90 AttributeSet attr = getElement().getAttributes(); |
91 String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID); |
91 String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID); |
92 try { |
92 try { |
93 ReflectUtil.checkPackageAccess(classname); |
93 ReflectUtil.checkPackageAccess(classname); |
94 Class c = Class.forName(classname, true,Thread.currentThread(). |
94 Class<?> c = Class.forName(classname, true,Thread.currentThread(). |
95 getContextClassLoader()); |
95 getContextClassLoader()); |
96 Object o = c.newInstance(); |
96 Object o = c.newInstance(); |
97 if (o instanceof Component) { |
97 if (o instanceof Component) { |
98 Component comp = (Component) o; |
98 Component comp = (Component) o; |
99 setParameters(comp, attr); |
99 setParameters(comp, attr); |
100 return comp; |
100 return comp; |
123 * Initialize this component according the KEY/VALUEs passed in |
123 * Initialize this component according the KEY/VALUEs passed in |
124 * via the <param> elements in the corresponding |
124 * via the <param> elements in the corresponding |
125 * <object> element. |
125 * <object> element. |
126 */ |
126 */ |
127 private void setParameters(Component comp, AttributeSet attr) { |
127 private void setParameters(Component comp, AttributeSet attr) { |
128 Class k = comp.getClass(); |
128 Class<?> k = comp.getClass(); |
129 BeanInfo bi; |
129 BeanInfo bi; |
130 try { |
130 try { |
131 bi = Introspector.getBeanInfo(k); |
131 bi = Introspector.getBeanInfo(k); |
132 } catch (IntrospectionException ex) { |
132 } catch (IntrospectionException ex) { |
133 System.err.println("introspector failed, ex: "+ex); |
133 System.err.println("introspector failed, ex: "+ex); |
143 Method writer = props[i].getWriteMethod(); |
143 Method writer = props[i].getWriteMethod(); |
144 if (writer == null) { |
144 if (writer == null) { |
145 // read-only property. ignore |
145 // read-only property. ignore |
146 return; // for now |
146 return; // for now |
147 } |
147 } |
148 Class[] params = writer.getParameterTypes(); |
148 Class<?>[] params = writer.getParameterTypes(); |
149 if (params.length != 1) { |
149 if (params.length != 1) { |
150 // zero or more than one argument, ignore |
150 // zero or more than one argument, ignore |
151 return; // for now |
151 return; // for now |
152 } |
152 } |
153 Object [] args = { value }; |
153 Object [] args = { value }; |