Examples of UICustomResource


Examples of org.dekka.component.resource.UICustomResource

    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        if (!RenderKitUtils.assertValid(context, component)) {
            return;
        }
       
        final UICustomResource crl = (UICustomResource) component;

        if (crl.getParent() instanceof UIResourceLoader) {
            final String src = crl.getSrc();
            if (src != null) {
                if (src.substring(src.length() - 3).equals(".js") || src.substring(src.length() - 3).equals(".gz")) {
                    writeScript(context, component);
                }
                if (src.substring(src.length() - 4).equals(".css")) {
View Full Code Here

Examples of org.dekka.component.resource.UICustomResource

     * @param component UIComponent to be rendered
     * @throws java.io.IOException if an input/output error occurs while rendering
     */
    protected void writeLink(final FacesContext context, final UIComponent component) throws IOException {
        final ResponseWriter writer = context.getResponseWriter();
        final UICustomResource crl = (UICustomResource) component;

        if (crl.isRendered()) {
            writer.startElement("link", component);
            writer.writeAttribute("type", "text/css", null);
            writer.writeAttribute("rel", "stylesheet", null);

            if (crl.getMedia() != null) {
                writer.writeAttribute("media", crl.getMedia(), null);
            }

            writer.writeAttribute("href", crl.getSrc(), null);
            writer.endElement("link");
        }
    }
View Full Code Here

Examples of org.dekka.component.resource.UICustomResource

     * @param component UIComponent to be rendered
     * @throws java.io.IOException if an input/output error occurs while rendering
     */
    protected void writeScript(final FacesContext context, final UIComponent component) throws IOException {
        final ResponseWriter writer = context.getResponseWriter();
        final UICustomResource crl = (UICustomResource) component;

        if (crl.isRendered()) {
                writer.startElement("script", component);
                writer.writeAttribute("type", "text/javascript", null);
                writer.writeAttribute("src", crl.getSrc(), null);
                writer.endElement("script");
            }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.