本文整理汇总了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)
)
);
}