public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
super.prepareRender(facesContext, component);
if (facesContext instanceof TobagoFacesContext) {
TobagoFacesContext pageFacesContext = (TobagoFacesContext) facesContext;
UIStyle styleComponent = (UIStyle) component;
String file = styleComponent.getFile();
if (file != null) {
pageFacesContext.getStyleFiles().add(file);
}
String style = styleComponent.getStyle();
if (style != null) {
pageFacesContext.getStyleBlocks().add(style);
}
}
}