* @param rc the relevant <code>RenderContext</code>
* @param table the table
*/
private void renderInitDirective(RenderContext rc, Table table) {
String elementId = ContainerInstance.getElementId(table);
ServerMessage serverMessage = rc.getServerMessage();
Document document = serverMessage.getDocument();
boolean rolloverEnabled = ((Boolean) table.getRenderProperty(Table.PROPERTY_ROLLOVER_ENABLED,
Boolean.FALSE)).booleanValue();
boolean selectionEnabled = ((Boolean) table.getRenderProperty(Table.PROPERTY_SELECTION_ENABLED,
Boolean.FALSE)).booleanValue();
String rolloverStyle = "";
if (rolloverEnabled) {
CssStyle rolloverCssStyle = new CssStyle();
ColorRender.renderToStyle(rolloverCssStyle,
(Color) table.getRenderProperty(Table.PROPERTY_ROLLOVER_FOREGROUND),
(Color) table.getRenderProperty(Table.PROPERTY_ROLLOVER_BACKGROUND));
FontRender.renderToStyle(rolloverCssStyle,
(Font) table.getRenderProperty(Table.PROPERTY_ROLLOVER_FONT));
FillImageRender.renderToStyle(rolloverCssStyle, rc, this, table, IMAGE_ID_ROLLOVER_BACKGROUND,
(FillImage) table.getRenderProperty(Table.PROPERTY_ROLLOVER_BACKGROUND_IMAGE),
FillImageRender.FLAG_DISABLE_FIXED_MODE);
if (rolloverCssStyle.hasAttributes()) {
rolloverStyle = rolloverCssStyle.renderInline();
}
}
String selectionStyle = "";
if (selectionEnabled) {
CssStyle selectionCssStyle = new CssStyle();
ColorRender.renderToStyle(selectionCssStyle,
(Color) table.getRenderProperty(Table.PROPERTY_SELECTION_FOREGROUND),
(Color) table.getRenderProperty(Table.PROPERTY_SELECTION_BACKGROUND));
FontRender.renderToStyle(selectionCssStyle,
(Font) table.getRenderProperty(Table.PROPERTY_SELECTION_FONT));
FillImageRender.renderToStyle(selectionCssStyle, rc, this, table, IMAGE_ID_SELECTION_BACKGROUND,
(FillImage) table.getRenderProperty(Table.PROPERTY_SELECTION_BACKGROUND_IMAGE),
FillImageRender.FLAG_DISABLE_FIXED_MODE);
if (selectionCssStyle.hasAttributes()) {
selectionStyle = selectionCssStyle.renderInline();
}
}
Element itemizedUpdateElement = serverMessage.getItemizedDirective(ServerMessage.GROUP_ID_POSTUPDATE,
"EchoTable.MessageProcessor", "init", TABLE_INIT_KEYS,
new String[]{rolloverStyle, selectionStyle});
Element itemElement = document.createElement("item");
itemElement.setAttribute("eid", elementId);
if (table.isHeaderVisible()) {