Examples of ResourceHandler


Examples of javax.faces.application.ResourceHandler

    public String getRendererType() {
        return getRendererType(getFacesContext());
    }

    public String getRendererType(FacesContext context) {
        ResourceHandler resourceHandler = context.getApplication().getResourceHandler();
        return resourceHandler.getRendererTypeForResourceName(getName());
    }
View Full Code Here

Examples of javax.faces.application.ResourceHandler

    public Object getValue(ELContext context, Object base, Object property) {
        checkBaseAndProperty(base, property);

        if (base instanceof ResourceHandler) {
            ResourceHandler handler = (ResourceHandler) base;
            String prop = (String) property;
            Resource resource;
            if (!prop.contains(":")) {
                resource = handler.createResource(prop);
            } else {
                String[] parts = prop.split(":");
                if (parts.length != 2) {
                    throw new ELException(MessageFormat.format(
                            "Invalid resource format. Property {0} contains more than one colon (:)", prop));
                }
                resource = handler.createResource(parts[1], parts[0]);
            }

            context.setPropertyResolved(true);

            if (resource != null) {
View Full Code Here

Examples of javax.faces.application.ResourceHandler

public abstract class AbstractMediaOutput extends UIOutput implements AccesskeyProps, CoreProps, FocusProps, I18nProps, LinkProps {
    public static final String COMPONENT_TYPE = "org.richfaces.MediaOutput";
    public static final String COMPONENT_FAMILY = "org.richfaces.MediaOutput";

    public Resource getResource() {
        ResourceHandler resourceHandler = getFacesContext().getApplication().getResourceHandler();
        return resourceHandler.createResource(MediaOutputResource.class.getName());
    }
View Full Code Here

Examples of javax.faces.application.ResourceHandler

            return NO_SCRIPT;
        }
    }

    private static LibraryFunction getScriptResource(FacesContext facesContext, Class<?> javaClass) {
        ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
        String resourceName = javaClass.getSimpleName() + ".js";
        Resource facesResource = resourceHandler.createResource(resourceName, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
        if (null != facesResource) {
            final String functionName = firstToLowerCase(javaClass.getSimpleName());
            return new LibraryFunctionImplementation(functionName, resourceName, ORG_RICHFACES_CSV);
        } else {
            return NO_SCRIPT;
View Full Code Here

Examples of javax.faces.application.ResourceHandler

        final Map<String, Object> attributes = component.getAttributes();
        final String resourceName = (String) attributes.get(JSFAttr.NAME_ATTR);
        if (resourceName != null && (resourceName.length() > 0))
        {

            final ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
            final Resource resource;
           
            final String libraryName = (String) component.getAttributes().get(JSFAttr.LIBRARY_ATTR);
            if ((libraryName != null) && (libraryName.length() > 0))
            {
                resource = resourceHandler.createResource(resourceName, libraryName);
            }
            else
            {
                resource = resourceHandler.createResource(resourceName);   
            }
           
            if (resource == null)
            {
                // If resourceName/libraryName are set but no resource created -> probably a typo,
View Full Code Here

Examples of javax.faces.application.ResourceHandler

        final Map<String, Object> attributes = component.getAttributes();
        final String resourceName = (String) attributes.get(JSFAttr.NAME_ATTR);
        if (resourceName != null && (resourceName.length() > 0))
        {

            final ResourceHandler resourceHandler = facesContext
                    .getApplication().getResourceHandler();
            final Resource resource;

            final String libraryName = (String) component.getAttributes().get(
                    JSFAttr.LIBRARY_ATTR);
            if ((libraryName != null) && (libraryName.length() > 0))
            {
                resource = resourceHandler.createResource(resourceName,
                        libraryName);
            }
            else
            {
                resource = resourceHandler.createResource(resourceName);
            }

            if (resource == null)
            {
                // If resourceName/libraryName are set but no resource created -> probably a typo,
View Full Code Here

Examples of javax.faces.application.ResourceHandler

        {
            boolean result = super.containsTagHandler(ns, localName);
           
            if (!result && _compositeLibraryName != null && containsNamespace(ns))
            {
                ResourceHandler resourceHandler =
                    FacesContext.getCurrentInstance().getApplication().getResourceHandler();

                for (String defaultSuffix : _defaultSuffixesArray)
                {
                    String resourceName = localName + defaultSuffix;
                    if (handles(resourceName))
                    {
                        Resource compositeComponentResource = resourceHandler.createResource(
                                resourceName, _compositeLibraryName);
                       
                        if (compositeComponentResource != null)
                        {
                            URL url = compositeComponentResource.getURL();
View Full Code Here

Examples of javax.faces.application.ResourceHandler

        {
            TagHandler tagHandler = super.createTagHandler(ns, localName, tag);
           
            if (tagHandler == null && _compositeLibraryName != null && containsNamespace(ns))
            {
                ResourceHandler resourceHandler =
                    FacesContext.getCurrentInstance().getApplication().getResourceHandler();

                for (String defaultSuffix : _defaultSuffixesArray)
                {
                    String resourceName = localName + defaultSuffix;
                    if (handles(resourceName))
                    {
                        // MYFACES-3308 If a composite component exists, it requires to
                        // be always resolved. In other words, it should always exists a default.
                        // The call here for resourceHandler.createResource, just try to get
                        // the Resource and if it does not exists, it just returns null.
                        // The intention of this code is just create an instance and pass to
                        // CompositeComponentResourceTagHandler. Then, its values
                        // (resourceName, libraryName) will be used to derive the real instance
                        // to use in a view, based on the locale used.
                        Resource compositeComponentResource = new CompositeResouceWrapper(
                            resourceHandler.createResource(resourceName, _compositeLibraryName));
                       
                        if (compositeComponentResource != null)
                        {
                            ComponentConfig componentConfig = new ComponentConfigWrapper(tag,
                                    "javax.faces.NamingContainer", null);
View Full Code Here

Examples of javax.faces.application.ResourceHandler

    public boolean containsNamespace(String ns)
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                return resourceHandler.libraryExists(libraryName);
            }
        }       
        return false;
    }
View Full Code Here

Examples of javax.faces.application.ResourceHandler

    public boolean containsTagHandler(String ns, String localName)
    {
        if (ns != null && ns.startsWith(NAMESPACE_PREFIX))
        {
            ResourceHandler resourceHandler =
                FacesContext.getCurrentInstance().getApplication().getResourceHandler();
           
            if (ns.length() > NAMESPACE_PREFIX.length())
            {
                String libraryName = ns.substring(NAMESPACE_PREFIX.length());
               
                for (String defaultSuffix : _defaultSuffixesArray)
                {
                    String resourceName = localName + defaultSuffix;
                    if (handles(resourceName))
                    {
                        Resource compositeComponentResource = resourceHandler.createResource(resourceName, libraryName);
                        if (compositeComponentResource != null)
                        {
                            URL url = compositeComponentResource.getURL();
                            return (url != null);
                        }
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.