Example usage for org.apache.wicket.util.resource IResourceStream setStyle

List of usage examples for org.apache.wicket.util.resource IResourceStream setStyle

Introduction

In this page you can find the example usage for org.apache.wicket.util.resource IResourceStream setStyle.

Prototype

void setStyle(String style);

Source Link

Document

This method shouldn't be used from the outside.

Usage

From source file:com.evolveum.midpoint.web.util.MidPointResourceStreamLocator.java

License:Apache License

@Override
public IResourceStream locate(Class<?> clazz, String path, String style, String variation, Locale locale,
        String extension, boolean strict) {
    IResourceStream stream = null;

    // If path contains a locale, then it'll replace the locale provided to this method
    ResourceUtils.PathLocale data = ResourceUtils.getLocaleFromFilename(path);
    if ((data != null) && (data.locale != null)) {
        path = data.path;/*w w w  .j  a  v  a2s. com*/
        locale = data.locale;
    }

    // Try the various combinations of style, locale and extension to find the resource.
    IResourceNameIterator iter = newResourceNameIterator(path, locale, style, variation, extension, strict);
    while (iter.hasNext()) {
        String newPath = iter.next();

        stream = locate(clazz, newPath);

        if (stream != null) {
            stream.setLocale(iter.getLocale());
            stream.setStyle(iter.getStyle());
            stream.setVariation(iter.getVariation());
            break;
        }
    }

    return stream;
}