Java Reference
In-Depth Information
TABLE 6-2. Image Map Classes
The Duke's Bookstore source directory, called
bookstore-dir
, is
tut-install
/examples/
case-studies/dukes-bookstore/src/java/dukesbookstore/
. The
event and listener classes are located in
bookstore-dir
/listeners/
. The component
classes are located in
bookstore-dir
/components/
. The renderer classes are located in
bookstore-dir
/renderers/
.
ImageArea
is located in
bookstore-dir
/model/
.
Steps for Creating a Custom Component
You can apply the following steps while developing your own custom component.
1.
Create a custom component class that does the following:
a.
Overrides the
getFamily
method to return the component family, which is
used to look up renderers that can render the component.
b.
Includes the rendering code or delegates it to a renderer (explained in step 2).
c.
Enables component attributes to accept expressions.
d.
Queues an event on the component if the component generates events.
e.
Saves and restores the component state.
2.
Delegate rendering to a renderer if your component does not handle the rendering.
To do this:
a.
Create
a
custom
renderer
class
by
extending
javax.faces.render.Renderer
.
b.
Register the renderer to a render kit.