Refine search
@Override protected String load() { return Application.get() .getResourceSettings() .getLocalizer() .getString(resourceKey, component, null, null, null, defaultValue); }
/** * In case you want to provide your own list of string resource loaders * * @return List of string resource loaders */ protected List<IStringResourceLoader> getStringResourceLoaders() { return Application.get().getResourceSettings().getStringResourceLoaders(); }
/** * Checks whether access is granted for this resource. * * By default IPackageResourceGuard is used to check the permissions but the resource itself can * also make the check. * * @param path * resource path * @return <code>true<code> if resource access is granted */ protected boolean accept(String path) { IPackageResourceGuard guard = Application.get() .getResourceSettings() .getPackageResourceGuard(); return guard.accept(path); }
/** Clears all the wicket caches so that resources and localization files will be re-read */ public void clearWicketCaches() { getResourceSettings().getPropertiesFactory().clearCache(); getResourceSettings().getLocalizer().clearCache(); }
/** * @return the result of {@link org.apache.wicket.settings.ResourceSettings#getThrowExceptionOnMissingResource()} */ protected boolean getThrowExceptionOnMissingResource() { return Application.get().getResourceSettings().getThrowExceptionOnMissingResource(); } }
/** * Gets the localizer that is being used by this string resource model. * * @return The localizer */ public Localizer getLocalizer() { return Application.get().getResourceSettings().getLocalizer(); }
/** * Get the properties file factory which loads the properties based on locale and style from * *.properties and *.xml files * * @return properties factory */ protected IPropertiesFactory getPropertiesFactory() { return Application.get().getResourceSettings().getPropertiesFactory(); }
throws MissingResourceException final ResourceSettings resourceSettings = Application.get().getResourceSettings(); String value = getStringIgnoreSettings(key, component, model, locale, style, null); else if (defaultValue != null && resourceSettings.getUseDefaultOnMissingResource()) return substitutePropertyExpressions(component, value, model); if (resourceSettings.getThrowExceptionOnMissingResource())
/** * * @see org.apache.wicket.core.util.resource.locator.IResourceStreamLocator#locate(java.lang.Class, * java.lang.String) */ @Override public IResourceStream locate(final Class<?> clazz, final String path) { // First try with the resource finder registered with the application // (allows for markup reloading) if (finders == null) { finders = Application.get().getResourceSettings().getResourceFinders(); } IResourceStream result; for (IResourceFinder finder : finders) { log.debug("Attempting to locate resource '{}' using finder'{}'", path, finder); result = finder.find(clazz, path); if (result != null) { return result; } } return null; }
/** * Clears the i18n cache so that localized keys can be reloaded. * * <p> * Have hidden this service because it seems that Wicket automatically invalidates * the resource cache anyway if running in development/prototype mode. * </p> */ @Action( restrictTo = RestrictTo.PROTOTYPING, hidden = Where.EVERYWHERE, semantics = SemanticsOf.IDEMPOTENT ) public void resetI18nCache() { Application.get() .getResourceSettings() .getLocalizer().clearCache(); } }
addResourceBundle(RESOURCE_BUNDLE_NAME); addPluginResources(); getResourceSettings().getStringResourceLoaders().add(new ExternalResourceLoader()); getResourceSettings().setThrowExceptionOnMissingResource(false); // Don't throw MissingResourceException for if (isStripWicketTags() == true) { log.info("Strip Wicket tags also in development mode at default (see context.xml)."); Application.get().getMarkupSettings().setStripWicketTags(true);
/** * Sets the deployment settings for deployment mode for the given application. * * @param application * the application to set the settings */ public static void setDeploymentModeConfiguration(final Application application) { application.getMarkupSettings().setStripComments(true); // The resources are never polled. This are properties, html, // css, js files. application.getResourceSettings().setResourcePollFrequency(null); application.getResourceSettings() .setJavaScriptCompressor(new DefaultJavaScriptCompressor()); // set the behavior if an missing resource is found... application.getResourceSettings().setThrowExceptionOnMissingResource(false); // debug settings... application.getDebugSettings().setComponentUseCheck(false); application.getDebugSettings().setAjaxDebugModeEnabled(false); application.getDebugSettings().setDevelopmentUtilitiesEnabled(false); application.getDebugSettings().setOutputMarkupContainerClassName(false); application.getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(false); application.getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(false); }
public static String getString(OrienteerWebApplication app, String key, Locale locale) { return app.getResourceSettings().getLocalizer().getString(key, null, null, locale, null, ""); }
PageSettings pageSettings = getPageSettings(); pageSettings.addComponentResolver(new WicketContainerResolver()); getResourceSettings().getResourceFinders().add(new ClassPathResourceFinder("")); getResourceSettings().addResourceFactory("buttonFactory", new DefaultButtonImageResourceFactory());
/** * Convenience method to provide easy access to the localizer object within any component. * * @return The localizer object */ public final Localizer getLocalizer() { return getApplication().getResourceSettings().getLocalizer(); }
/** * @see org.apache.wicket.jmx.ApplicationMBean#clearLocalizerCache() */ @Override public void clearLocalizerCache() throws IOException { application.getResourceSettings().getLocalizer().clearCache(); } }
/** * {@inheritDoc} */ @Override public String getPackageResourceGuard() { return Stringz.className(application.getResourceSettings().getPackageResourceGuard()); }
/** * {@inheritDoc} */ @Override public void setThrowExceptionOnMissingResource(final boolean throwExceptionOnMissingResource) { application.getResourceSettings().setThrowExceptionOnMissingResource( throwExceptionOnMissingResource); }
/** * {@inheritDoc} */ @Override public boolean getThrowExceptionOnMissingResource() { return application.getResourceSettings().getThrowExceptionOnMissingResource(); }
/** * {@inheritDoc} */ @Override public String[] getStringResourceLoaders() { List<IStringResourceLoader> loaders = application.getResourceSettings() .getStringResourceLoaders(); if (loaders != null) { List<String> list = Generics.newArrayList(); for (Object loader : loaders) { list.add(loader.toString()); } return list.toArray(new String[0]); } return null; }