当前位置: 首页>>代码示例>>Java>>正文


Java ClassStringResourceLoader类代码示例

本文整理汇总了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);
    });
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:17,代码来源:ServerStudioApplication.java

示例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);
        }
    });
}
 
开发者ID:geosolutions-it,项目名称:soil_sealing,代码行数:21,代码来源:WicketTestApplication.java

示例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)
			)
	);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:28,代码来源:BasicApplicationApplication.java

示例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)
				)
		);
	}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:74,代码来源:CoreWicketApplication.java


注:本文中的org.apache.wicket.resource.loader.ClassStringResourceLoader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。