/** * Install the given resource to be used for the prototypes script. <br> * This method has to be called before any component was rendered, e.g. in * {@link Application#init()}. * * @param application * the application to install the resource on * @param resource * the prototypes script resource */ public static void install(final Application application, final Resource resource) { application.getSharedResources().add(PrototypeResourceReference.class, NAME, null, null, resource); } }
@Override public void init(final Application application) { // register the upload status resource application.getSharedResources().add(RESOURCE_NAME, new UploadStatusResource()); }
@Override public void init(final Application application) { // register the upload status resource application.getSharedResources().add(RESOURCE_NAME, new UploadStatusResource()); }
@Override public void init(final Application application) { // register the upload status resource application.getSharedResources().add(RESOURCE_NAME, new UploadStatusResource()); }
/** * @see org.apache.wicket.IInitializer#init(org.apache.wicket.Application) */ public void init(Application application) { // register the upload status resource Application.get().getSharedResources().add(RESOURCE_NAME, new UploadStatusResource()); }
application.getSharedResources().add(this.getClass(), dbname + '_' + ct, null, null, resource);
/** * Construct spellchecker plugin. */ public SpellCheckPlugin() { super("spellchecker"); spellCheckButton = new PluginButton("spellchecker", this); // add spellchecker resource Application.get().getSharedResources().add(TinyMceBehavior.class, resourceKey, null, null, new JazzySpellChecker()); }
/** * Construct spellchecker plugin. */ public SpellCheckPlugin() { super("spellchecker"); spellCheckButton = new PluginButton("spellchecker", this); // add spellchecker resource Application.get() .getSharedResources() .add(TinyMceBehavior.class, resourceKey, null, null, null, new JazzySpellChecker()); }
/** * @return the shared resource key for this resource reference. */ public final String getSharedResourceKey() { Application application = Application.get(); bind(application); return application.getSharedResources().resourceKey(getScope(), name, locale, style); }
/** * Gets the resource for a given set of criteria. Only one resource will be loaded for the same * criteria. * * @param scope * This argument will be used to get the class loader for loading the package * resource, and to determine what package it is in. Typically this is the class in * which you call this method * @param path * The path to the resource * @param locale * The locale of the resource * @param style * The style of the resource (see {@link org.apache.wicket.Session}) * @return The resource */ public static PackageResource get(final Class<?> scope, final String path, final Locale locale, final String style) { final SharedResources sharedResources = Application.get().getSharedResources(); PackageResource resource = (PackageResource)sharedResources.get(scope, path, locale, style, true); if (resource == null) { resource = newPackageResource(scope, path, locale, style); Application.get().getSharedResources().add(scope, path, locale, style, resource); } return resource; }
/** * Construct spellchecker plugin. */ public SpellCheckPlugin() { super("spellchecker"); spellCheckButton = new PluginButton("spellchecker", this); // add spellchecker resource Application.get() .getSharedResources() .add(TinyMceBehavior.class, resourceKey, null, null, null, new JazzySpellChecker()); }
SharedResources sharedResources = Application.get().getSharedResources(); sharedResources.add(scope, name, locale, style, packageResource);
SharedResources sharedResources = Application.get().getSharedResources(); sharedResources.add(scope, name, locale, style, packageResource);
/** * Gets the resource for a given set of criteria. Only one resource will be loaded for the same * criteria. * * @param scope * This argument will be used to get the class loader for loading the package * resource, and to determine what package it is in. Typically this is the class in * which you call this method * @param path * The path to the resource * @param locale * The locale of the resource * @param style * The style of the resource (see {@link org.apache.wicket.Session}) * @return The resource */ public static PackageResource get(final Class scope, final String path, final Locale locale, final String style) { final SharedResources sharedResources = Application.get().getSharedResources(); PackageResource resource = (PackageResource)sharedResources.get(scope, path, locale, style, true); if (resource == null) { resource = new PackageResource(scope, path, locale, style); } return resource; }
final String style) final SharedResources sharedResources = Application.get().getSharedResources();
final String style) final SharedResources sharedResources = Application.get().getSharedResources();
final SharedResources sharedResources = Application.get().getSharedResources(); final Resource resource = sharedResources.get(uniqueName); if (resource == null)
final SharedResources sharedResources = Application.get().getSharedResources(); final Resource resource = sharedResources.get(uniqueName); if (resource == null)
SharedResources sharedResources = application.getSharedResources();
/** * @return the shared resource key for this resource reference. */ public final String getSharedResourceKey() { Application application = Application.get(); if (useSessionLocale) { if (!Objects.equal(locale, Session.get().getLocale())) { setLocale(Session.get().getLocale()); } } if (useSessionStyle) { if (!Objects.equal(style, Session.get().getStyle())) { setStyle(Session.get().getStyle()); } } bind(application); return application.getSharedResources().resourceKey(getScope(), name, locale, style); }