List of usage examples for org.apache.wicket Session getStyle
public final String getStyle()
From source file:org.hippoecm.frontend.plugins.standards.icon.BrowserStyle.java
License:Apache License
private static boolean customResourceExists(final String packageResourcePath, final Session session) { final String customResourceKey = packageResourcePath + session.getLocale() + session.getStyle(); if (!customPackageResourceExists.containsKey(customResourceKey)) { Boolean resourceExists = PackageResource.exists(BrowserStyle.class, packageResourcePath, session.getLocale(), session.getStyle(), null); customPackageResourceExists.put(customResourceKey, resourceExists); return resourceExists; } else {//from www . j ava 2 s. co m return customPackageResourceExists.get(customResourceKey); } }
From source file:org.hippoecm.frontend.plugins.standards.icon.BrowserStyle.java
License:Apache License
private static ResourceReference createResourceReference(final String path, final Session session) { return new PackageResourceReference(BrowserStyle.class, path, session.getLocale(), session.getStyle(), null);/*from w w w . java2 s. c om*/ }
From source file:org.wicketstuff.js.ext.ExtObservableHelper.java
License:Apache License
static JSONObject renderResources(final IExtObservable extObservable, Class<?> baseClass) throws JSONException { JSONObject resources = new JSONObject(); IPropertiesFactory propertiesFactory = Application.get().getResourceSettings().getPropertiesFactory(); Session session = Session.get(); String style = session.getStyle(); Locale locale = session.getLocale(); Class<?> clazz = extObservable.getClass(); while (clazz != baseClass) { String path = clazz.getName().replace('.', '/'); ResourceNameIterator iter = new ResourceNameIterator(path, style, null, locale, null, false); while (iter.hasNext()) { String newPath = iter.next(); final Properties props = propertiesFactory.load(clazz, newPath); if (props != null) { ValueMap all = props.getAll(); for (Map.Entry<String, Object> entry : all.entrySet()) { if (!resources.has(entry.getKey())) { resources.put(entry.getKey(), entry.getValue()); }/* w ww . j a v a 2 s .c o m*/ } } } clazz = clazz.getSuperclass(); } return resources; }