Package org.richfaces.resource

Examples of org.richfaces.resource.ResourceLibraryFactory


     *
     * @param resources resource keys to be expanded
     * @return collection with all resource libraries expanded to particular resource keys (keeps ordering)
     */
    public Collection<ResourceKey> expandResourceLibraries(Collection<ResourceKey> resources) {
        ResourceLibraryFactory factory = ServiceTracker.getService(ResourceLibraryFactory.class);
        Collection<ResourceKey> expandedResources = Sets.newLinkedHashSet();

        for (ResourceKey resourceKey : resources) {
            if (resourceKey.getResourceName().endsWith(ResourceLibraryRenderer.RESOURCE_LIBRARY_EXTENSION)) {

                String libraryName = resourceKey.getLibraryName();
                String resourceName = resourceKey.getResourceName().substring(0,
                        resourceKey.getResourceName().length() - ResourceLibraryRenderer.RESOURCE_LIBRARY_EXTENSION.length());
                ResourceLibrary resourceLibrary = factory.getResourceLibrary(resourceName, libraryName);

                if (resourceLibrary == null) {
                    throw new IllegalArgumentException("Resource library is null: " + libraryName + ":" + resourceName);
                }

View Full Code Here


        name = name.substring(0, name.length() - RESOURCE_LIBRARY_EXTENSION.length());

        String library = (String) attributes.get("library");

        ResourceLibraryFactory factory = ServiceTracker.getService(ResourceLibraryFactory.class);
        ResourceLibrary resourceLibrary = factory.getResourceLibrary(name, library);

        if (resourceLibrary == null) {
            LOGGER.error("Resource library is null: " + COLON_JOINER.join(library, name));
            return;
        }
View Full Code Here

TOP

Related Classes of org.richfaces.resource.ResourceLibraryFactory

Copyright © 2018 www.massapicom. 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.