Adding an <includStyles> tag for enabling proper inclusion of the stylesheets required by Spring Faces components in the <head>

This commit is contained in:
Jeremy Grelle
2008-03-20 15:01:35 +00:00
parent d6b8d44d28
commit 243ee05f1a
4 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package org.springframework.faces.ui;
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.render.Renderer;
import org.springframework.faces.ui.resource.ResourceHelper;
public class DojoStyleRenderer extends Renderer {
private String dijitThemePath = "/dijit/themes/";
private String dijitTheme = "tundra";
private ResourceHelper resourceHelper = new ResourceHelper();
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
resourceHelper.renderStyleLink(context, dijitThemePath + dijitTheme + "/" + dijitTheme + ".css");
}
}

View File

@@ -0,0 +1,11 @@
package org.springframework.faces.ui;
import javax.faces.component.UIComponentBase;
public class DynamicComponent extends UIComponentBase {
public String getFamily() {
return "spring.faces.DynamicComponent";
}
}