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()); } } } } clazz = clazz.getSuperclass(); } return resources; }