Adding an <includStyles> tag for enabling proper inclusion of the stylesheets required by Spring Faces components in the <head>
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user