Example usage for org.apache.wicket.resource PropertiesFactory PropertiesFactory

List of usage examples for org.apache.wicket.resource PropertiesFactory PropertiesFactory

Introduction

In this page you can find the example usage for org.apache.wicket.resource PropertiesFactory PropertiesFactory.

Prototype

public PropertiesFactory(final IPropertiesFactoryContext context) 

Source Link

Document

Construct.

Usage

From source file:org.geoserver.wicket.test.WicketTestApplication.java

License:Open Source License

@Override
protected void init() {
    //JD: override some resource settings to allow for custom i18n lookups
    getResourceSettings().setResourceStreamLocator(new GeoServerResourceStreamLocator());
    getResourceSettings().addStringResourceLoader(new GeoServerStringResourceLoader());
    getResourceSettings().addStringResourceLoader(new ComponentStringResourceLoader());
    getResourceSettings().addStringResourceLoader(new ClassStringResourceLoader(this.getClass()));

    getResourceSettings().setPropertiesFactory(new PropertiesFactory(this) {
        @Override//  w  w  w . j a va  2s  .co  m
        public Properties load(Class clazz, String path) {
            if (clazz == WicketTestApplication.class && path.startsWith(wtapath)) {
                String newPath = path.replace(wtapath, gsapath);
                return super.load(GeoServerApplication.class, newPath);
            }
            return super.load(clazz, path);
        }
    });
}