本文整理匯總了Java中org.apache.wicket.resource.loader.ClassStringResourceLoader類的典型用法代碼示例。如果您正苦於以下問題:Java ClassStringResourceLoader類的具體用法?Java ClassStringResourceLoader怎麽用?Java ClassStringResourceLoader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ClassStringResourceLoader類屬於org.apache.wicket.resource.loader包,在下文中一共展示了ClassStringResourceLoader類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.apache.wicket.resource.loader.ClassStringResourceLoader; //導入依賴的package包/類
@Override
public void init() {
super.init();
getMarkupSettings().setStripWicketTags(true);
getMarkupSettings().setStripComments(true);
getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name());
setHeaderResponseDecorator(r -> new JavaScriptFilteredIntoFooterHeaderResponse(r, SingularTemplate.JAVASCRIPT_CONTAINER));
getComponentInstantiationListeners().add(new SpringComponentInjector(this));
new AnnotatedMountScanner().scanPackage("org.opensingular.studio").mount(this);
List<IStringResourceLoader> stringResourceLoaders = getResourceSettings().getStringResourceLoaders();
stringResourceLoaders.add(0, new ClassStringResourceLoader(appConfig.getClass()));
getComponentOnConfigureListeners().add(component -> {
boolean outputId = !component.getRenderBodyOnly();
component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId);
});
}
示例2: init
import org.apache.wicket.resource.loader.ClassStringResourceLoader; //導入依賴的package包/類
@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
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);
}
});
}
示例3: init
import org.apache.wicket.resource.loader.ClassStringResourceLoader; //導入依賴的package包/類
@Override
public void init() {
super.init();
// si on n'est pas en développement, on précharge les feuilles de styles pour éviter la ruée et permettre le remplissage du cache
if (!propertyService.isConfigurationTypeDevelopment()) {
preloadStyleSheets(
ConsoleLessCssResourceReference.get(),
NotificationLessCssResourceReference.get(),
ApplicationAccessLessCssResourceReference.get(),
StylesLessCssResourceReference.get()
);
}
getResourceSettings().getStringResourceLoaders().addAll(
0, // Override the keys in existing resource loaders with the following
ImmutableList.of(
new ClassStringResourceLoader(BasicApplicationApplicationResources.class),
new ClassStringResourceLoader(BasicApplicationBusinessResources.class),
new ClassStringResourceLoader(BasicApplicationCommonResources.class),
new ClassStringResourceLoader(BasicApplicationConsoleResources.class),
new ClassStringResourceLoader(BasicApplicationEnumResources.class),
new ClassStringResourceLoader(BasicApplicationNavigationResources.class),
new ClassStringResourceLoader(BasicApplicationNotificationResources.class)
)
);
}
示例4: init
import org.apache.wicket.resource.loader.ClassStringResourceLoader; //導入依賴的package包/類
@Override
public void init() {
super.init();
// injection Spring
getComponentInstantiationListeners().add(new SpringComponentInjector(this, applicationContext));
// nettoyage des tags Wicket
getMarkupSettings().setStripWicketTags(true);
// mise en place d'un timeout plus élevé histoire d'éviter les timeouts lors des téléchargements
getRequestCycleSettings().setTimeout(DEFAULT_TIMEOUT);
// configuration des ressources
// depuis Wicket 1.5, il faut ajouter les patterns sur les ressources qu'on souhaite rendre accessible
// on ajoute globalement l'accès aux ressources less et aux joyeusetés liés aux polices.
SecurePackageResourceGuard packageResourceGuard = (SecurePackageResourceGuard) getResourceSettings().getPackageResourceGuard();
packageResourceGuard.addPattern("+*.less");
packageResourceGuard.addPattern("+*.scss");
packageResourceGuard.addPattern("+*.woff");
packageResourceGuard.addPattern("+*.eot");
packageResourceGuard.addPattern("+*.svg");
packageResourceGuard.addPattern("+*.ttf");
packageResourceGuard.addPattern("+*.css.map");
// la compression se fait au build quand c'est nécessaire ; on n'utilise pas la compression Wicket
getResourceSettings().setJavaScriptCompressor(new NoOpTextCompressor());
// utilisation des ressources minifiées que si on est en mode DEPLOYMENT
getResourceSettings().setUseMinifiedResources(RuntimeConfigurationType.DEPLOYMENT.equals(getConfigurationType()));
// gestion du cache sur les ressources
getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy(new LastModifiedResourceVersion()));
// surcharge des ressources jQuery et jQuery UI
addResourceReplacement(WiQueryCoreThemeResourceReference.get(), JQueryUiCssResourceReference.get());
// on place les éléments présents dans le wicket:head en premier
getResourceSettings().setHeaderItemComparator(new PriorityFirstComparator(true));
// configuration du disk data store de Wicket
getStoreSettings().setInmemoryCacheSize(propertyService.get(WICKET_DISK_DATA_STORE_IN_MEMORY_CACHE_SIZE));
getStoreSettings().setMaxSizePerSession(Bytes.megabytes(propertyService.get(WICKET_DISK_DATA_STORE_MAX_SIZE_PER_SESSION)));
String wicketDiskDataStorePath = propertyService.get(WICKET_DISK_DATA_STORE_PATH);
if (StringUtils.hasText(wicketDiskDataStorePath)) {
try {
File wicketDiskDataStoreFolder = new File(wicketDiskDataStorePath);
FileUtils.forceMkdir(wicketDiskDataStoreFolder);
getStoreSettings().setFileStoreFolder(wicketDiskDataStoreFolder);
} catch (RuntimeException | IOException e) {
LOGGER.error(String.format("Unable to define a specific path (%1$s) for wicket data store. Using the default one.",
wicketDiskDataStorePath), e);
}
}
mountCommonResources();
mountCommonPages();
mountApplicationResources();
mountApplicationPages();
registerLessImportScopes();
// TODO SCSS
// registerScssImportScopes();
getResourceSettings().getStringResourceLoaders().addAll(
0, // Override the keys in existing resource loaders with the following
ImmutableList.of(
new ClassStringResourceLoader(CoreWicketConsoleResources.class)
)
);
}