|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The MarkupDesignInfo interface is an extension of the DesignInfo interface that adds the ability to annotate the render stream of a markup element for design-time, and provide clickable sub-regions and context items within the visual markup element.
IMPLEMENTED BY THE COMPONENT AUTHOR - This interface is designed to be implemented by the component (bean) author.
DesignInfo| Method Summary | |
void |
customizeRender(MarkupDesignBean designBean,
MarkupRenderContext renderContext)
This method is called after a JSF component has been invoked to render itself in design-mode, and just before the rendered markup is displayed on the designer surface. |
| Methods inherited from interface com.sun.rave.designtime.DesignInfo |
beanCreatedSetup, beanDeletedCleanup, beanPastedSetup, canLinkBeans, getBeanClass, getContextItems, linkBeans |
| Methods inherited from interface com.sun.rave.designtime.DesignBeanListener |
beanChanged, beanContextActivated, beanContextDeactivated, eventChanged, propertyChanged |
| Method Detail |
public void customizeRender(MarkupDesignBean designBean,
MarkupRenderContext renderContext)
This method is called after a JSF component has been invoked to render itself in design-mode, and just before the rendered markup is displayed on the designer surface. The component author may use this hook to modify the design-time rendered content for the given component. They can also associate elements with MarkupMouseRegion objects.
For example, the following markup might be emitted when a JSF component is rendered:
<table border="1">
<tr>
<th>Name</th>
<th>Address</th>
<th>Phone</th>
</tr>
<tr>
<td>John Smith</td>
<td>100 Milky Way</td>
<td>555-1212</td>
</tr>
<tr>
<td>Luke Johnson</td>
<td>200 Super Drive</td>
<td>911-1234</td>
</tr>
<tr>
<td>Gary Raddo</td>
<td>747 Airport Way</td>
<td>277-9473</td>
</tr>
</table>
This markup is parsed into a DOM DocumentFragment, and passed to the 'customizeRender' method along with the instance of the DesignBean that rendered it. The resultant DOM DocumentFragment might look like this:
<table border="1">
<tr>
<th>Name [CUSTOMER.NAME]</th>
<th>Address [CUSTOMER.ADDRESS]</th>
<th>Phone [CUSTOMER.PHONE]</th>
</tr>
<tr>
<td>John Smith</td>
<td>100 Milky Way</td>
<td>555-1212</td>
</tr>
<tr>
<td>Luke Johnson</td>
<td>200 Super Drive</td>
<td>911-1234</td>
</tr>
<tr>
<td>Gary Raddo</td>
<td>747 Airport Way</td>
<td>277-9473</td>
</tr>
</table>
This annotated markup stream would be passed to the designer, where it would be displayed as an instance of an HTML table (in this example). The component author may have also 'hooked' the markup elements to instances of MarkupMouseRegion via the 'MarkupRenderContext.associateMouseRegion' method.
designBean - The MarkupDesignBean about to be displayed on the design surfacerenderContext - The context (including rendered content) representing this component's
markup output
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||