|
Download
FAQ History |
|
API
Search Feedback |
Registering a Custom Component
In addition to registering custom renderers (as explained in the preceding section), you also must register the custom components that are usually associated with the custom renderers.
Here is the
componentelement from the application configuration resource file that registers theAreaComponent:<component> <component-type>DemoArea</component-type> <component-class> components.AreaComponent </component-class> <property> <property-name>alt</property-name> <property-class>java.lang.String</property-class> </property> <property> <property-name>coords</property-name> <property-class>java.lang.String</property-class> </property> <property> <property-name>shape</property-name> <property-class>java.lang.String</property-class> </property> <component-extension> <component-family>Area</component-family> <renderer-type>DemoArea</renderer-type> </component-extension> </component>The
component-typeelement indicates the name under which the component should be registered. Other objects referring to this component use this name. Thecomponent-classelement indicates the fully qualified class name of the component. Thepropertyelements specify the component properties and their types.The
component-extensionelement identifies a set of renderers that can render this component. This allows a component to be rendered by multiple renderers and allows a renderer to render multiple components.
|
Download
FAQ History |
|
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.