⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stylesheetrenderer.java

📁 一个java写的加密算法
💻 JAVA
字号:
/* * $Id: StylesheetRenderer.java,v 1.3 2004/11/14 07:33:15 tcfujii Exp $ *//* * Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved. * Use is subject to license terms. */package components.renderkit;import javax.faces.component.UIComponent;import javax.faces.component.UIOutput;import javax.faces.context.FacesContext;import javax.faces.context.ResponseWriter;import java.io.IOException;/** * <p>Render a stylesheet link for the value of our component's * <code>path</code> attribute, prefixed by the context path of this * web application.</p> */public class StylesheetRenderer extends BaseRenderer {    public boolean supportsComponentType(UIComponent component) {        return (component instanceof UIOutput);    }    public void decode(FacesContext context, UIComponent component) {    }    public void encodeBegin(FacesContext context, UIComponent component)        throws IOException {        ;    }    public void encodeChildren(FacesContext context, UIComponent component)        throws IOException {        ;    }    /**     * <p>Render a relative HTML <code>&lt;link&gt;</code> element for a     * <code>text/css</code> stylesheet at the specified context-relative     * path.</p>     *     * @param context   FacesContext for the request we are processing     * @param component UIComponent to be rendered     *     * @throws IOException          if an input/output error occurs while rendering     * @throws NullPointerException if <code>context</code>     *                              or <code>component</code> is null     */    public void encodeEnd(FacesContext context, UIComponent component)        throws IOException {        if ((context == null) || (component == null)) {            throw new NullPointerException();        }        ResponseWriter writer = context.getResponseWriter();        String contextPath = context.getExternalContext()            .getRequestContextPath();        writer.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");        writer.write(contextPath);        writer.write((String) component.getAttributes().get("path"));        writer.write("\">");    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -