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


Java SymbolConstants类代码示例

本文整理汇总了Java中org.apache.tapestry5.SymbolConstants的典型用法代码示例。如果您正苦于以下问题:Java SymbolConstants类的具体用法?Java SymbolConstants怎么用?Java SymbolConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SymbolConstants类属于org.apache.tapestry5包,在下文中一共展示了SymbolConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupJSModules

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void setupJSModules(final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration,
    @Path("classpath:de/eddyson/tapestry/react/select/react-select.js") final Resource reactSelect,
    @Path("classpath:de/eddyson/tapestry/react/select/react-select.min.js") final Resource reactSelectMin,
    @Path("classpath:de/eddyson/tapestry/react/select/react-input-autosize.js") final Resource reactInputautoSize,
    @Path("classpath:de/eddyson/tapestry/react/select/react-input-autosize.min.js") final Resource reactInputautoSizeMin,
    @Path("classpath:de/eddyson/tapestry/react/select/classnames.js") final Resource classnames,
    @Symbol(ReactSelectSymbols.CONTRIBUTE_CLASSNAMES_MODULE) final boolean contributeClassnamesModule,
    @Symbol(ReactSelectSymbols.CONTRIBUTE_REACT_INPUT_AUTOSIZE_MODULE) final boolean contributeInputAutosizeModule,
    @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) throws IOException {
  if (contributeClassnamesModule) {
    configuration.add("classnames", new JavaScriptModuleConfiguration(classnames));
  }
  if (contributeInputAutosizeModule) {
    configuration.add("react-input-autosize",
        new JavaScriptModuleConfiguration(productionMode ? reactInputautoSizeMin : reactInputautoSize));
  }
  configuration.add("react-select", new JavaScriptModuleConfiguration(productionMode ? reactSelectMin : reactSelect));
}
 
开发者ID:eddyson-de,项目名称:tapestry-react-select,代码行数:20,代码来源:ReactSelectModule.java

示例2: Angular2JavascriptStack

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
public Angular2JavascriptStack(@Symbol(SymbolConstants.PRODUCTION_MODE)
                               final boolean productionMode,
                               @Path("webjars:es6-shim:es6-shim.js") final Resource es6_shim, 
                               @Path("webjars:zone.js:$version/dist/zone.js") final Resource zoneJs,
                               @Path("webjars:reflect-metadata:$version/Reflect.js") final Resource reflectMetadata,
                               @Path("webjars:systemjs:dist/system.src.js") final Resource systemjs, 
                               @Path("webjars:rxjs:bundles/Rx.js") final Resource rx,
                               @Path("webjars:angular__core:$version/bundles/core.umd.js") final Resource angular2,	
                               final AssetSource assetSource)
{
    this.productionMode = productionMode;
    
    this.es6_shim = es6_shim; 
    this.zoneJs = zoneJs;
    this.reflectMetadata = reflectMetadata;
    this.systemjs = systemjs;
    this.rx = rx;
    this.angular2 = angular2;
    
    this.assetSource = assetSource;
  
}
 
开发者ID:ffacon,项目名称:tapestry5-angular2,代码行数:23,代码来源:Angular2JavascriptStack.java

示例3: setupEnvironment

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
@Contribute(SymbolProvider.class)
@ApplicationDefaults
public static void setupEnvironment(MappedConfiguration<String, Object> configuration) {
    configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER, "jquery");
    configuration.add(SymbolConstants.BOOTSTRAP_ROOT, "context:jbootstrap");
    configuration.add(SymbolConstants.HMAC_PASSPHRASE, new SecureRandomNumberGenerator().getSecureRandom().toString());

    configuration.add(SymbolConstants.MINIFICATION_ENABLED, true);
    configuration.add(SymbolConstants.ENABLE_HTML5_SUPPORT, true);
    configuration.add(SymbolConstants.ENABLE_PAGELOADING_MASK, true);
    configuration.add(SymbolConstants.SUPPORTED_LOCALES, "de,en");
    configuration.add(SymbolConstants.CLUSTERED_SESSIONS, false);
    configuration.add(SymbolConstants.COMBINE_SCRIPTS, true);
    configuration.add(SymbolConstants.COMPACT_JSON, true);
    configuration.add(SymbolConstants.COMPRESS_WHITESPACE, true);
    configuration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, true);
    configuration.add(SymbolConstants.PRELOADER_MODE, PreloaderMode.ALWAYS);

    configuration.add("tapestry.closure-compiler-level", "SIMPLE_OPTIMIZATIONS"); 

    // INFO:
    // only in production 1 to 5 minutes
    // configuration.add(SymbolConstants.FILE_CHECK_INTERVAL, 60);
}
 
开发者ID:Zabrimus,项目名称:vdr-jonglisto,代码行数:25,代码来源:AppModule.java

示例4: setupJSModules

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void setupJSModules(final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration,
    final AssetSource assetSource, @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode,
    @Symbol(ReactSymbols.REACT_ASSET_PATH) final String reactAssetPath,
    @Symbol(ReactSymbols.REACT_ASSET_PATH_PRODUCTION) final String reactAssetPathProduction,
    @Symbol(ReactSymbols.REACT_DOM_ASSET_PATH) final String reactDomAssetPath,
    @Symbol(ReactSymbols.REACT_DOM_ASSET_PATH_PRODUCTION) final String reactDomAssetPathProduction,
    @Symbol(ReactSymbols.PROP_TYPES_ASSET_PATH) final String propTypesAssetPath,
    @Symbol(ReactSymbols.PROP_TYPES_ASSET_PATH_PRODUCTION) final String propTypesAssetPathProduction) {

  configuration.add("react", new JavaScriptModuleConfiguration(
      assetSource.resourceForPath(productionMode ? reactAssetPathProduction : reactAssetPath)));
  configuration.add("react-dom", new JavaScriptModuleConfiguration(
      assetSource.resourceForPath(productionMode ? reactDomAssetPathProduction : reactDomAssetPath)));
  configuration.add("prop-types", new JavaScriptModuleConfiguration(
      assetSource.resourceForPath(productionMode ? propTypesAssetPathProduction : propTypesAssetPath)));
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:18,代码来源:ReactModule.java

示例5: contributeApplicationDefaults

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration) {
    // The factory default is true but during the early stages of an
    // application
    // overriding to false is a good idea. In addition, this is often
    // overridden
    // on the command line as -Dtapestry.production-mode=false
    configuration.add(SymbolConstants.PRODUCTION_MODE, false);

    // The application version number is incorprated into URLs for some
    // assets. Web browsers will cache assets because of the far future
    // expires
    // header. If existing assets are changed, the version number should
    // also
    // change, to force the browser to download new versions.
    configuration.add(SymbolConstants.APPLICATION_VERSION, "0.0.2-SNAPSHOT-DEV");
}
 
开发者ID:beargiles,项目名称:project-student,代码行数:17,代码来源:DevelopmentModule.java

示例6: contributeApplicationDefaults

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration) {
    // The factory default is true but during the early stages of an
    // application
    // overriding to false is a good idea. In addition, this is often
    // overridden
    // on the command line as -Dtapestry.production-mode=false
    configuration.add(SymbolConstants.PRODUCTION_MODE, false);

    // The application version number is incorprated into URLs for some
    // assets. Web browsers will cache assets because of the far future
    // expires
    // header. If existing assets are changed, the version number should
    // also
    // change, to force the browser to download new versions.
    configuration.add(SymbolConstants.APPLICATION_VERSION, "0.0.2-SNAPSHOT-QA");
}
 
开发者ID:beargiles,项目名称:project-student,代码行数:17,代码来源:QaModule.java

示例7: SubdomainPageLinkTransformer

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
/**
 * Single constructor of this class.
 * 
 * @param tagController a {@link TagController}.
 * @param hostname the hostname used by the server running Eloquentia.
 */
public SubdomainPageLinkTransformer(
		final Request request,
		final TagController tagController,
		final PageActivationContextService pageActivationContextService,
		@Inject @Symbol(SymbolConstants.HOSTNAME) final String hostname) {
	
	assert request != null;
	assert tagController != null;
	assert hostname != null;
	
	this.request = request;
	this.tagController = tagController;
	this.pageActivationContextService = pageActivationContextService;
	this.hostname = hostname.trim();
	this.enabled = this.hostname.length() > 0;
	
}
 
开发者ID:thiagohp,项目名称:eloquentia,代码行数:24,代码来源:SubdomainPageLinkTransformer.java

示例8: SubdomainTagLinkTransformer

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
/**
 * Single constructor of this class.
 * 
 * @param tagController a {@link TagController}.
 * @param hostname the hostname used by the server running Eloquentia.
 */
public SubdomainTagLinkTransformer(
		final Request request,
		final TagController tagController, 
		@Inject @Symbol(SymbolConstants.HOSTNAME) final String hostname) {
	
	assert request != null;
	assert tagController != null;
	assert hostname != null;
	
	this.request = request;
	this.tagController = tagController;
	this.hostname = hostname.trim();
	this.enabled = this.hostname.length() > 0;
	
}
 
开发者ID:thiagohp,项目名称:eloquentia,代码行数:22,代码来源:SubdomainTagLinkTransformer.java

示例9: contributeApplicationDefaults

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
/**
* @param pConfiguration
*            to use
*/
public static void contributeApplicationDefaults(final MappedConfiguration<String, Object> pConfiguration) {
          // Contributions to ApplicationDefaults will override any contributions
          // to
          // FactoryDefaults (with the same key). Here we're restricting the
          // supported
          // locales to just "en" (English). As you add localised message catalogs
          // and other assets,
          // you can extend this list of locales (it's a comma separated series of
          // locale names;
          // the first locale name is the default when there's no reasonable
          // match).
          pConfiguration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
          pConfiguration.add(SymbolConstants.MINIFICATION_ENABLED, false);
          pConfiguration.add(SymbolConstants.HMAC_PASSPHRASE,"a1TAzRnjBZRKubgwSRlpX");
          pConfiguration.add(ResteasySymbols.MAPPING_PREFIX, "/api");


          pConfiguration.add(SymbolConstants.SECURE_ENABLED, "false");
          pConfiguration.add(SymbolConstants.HOSTPORT, "8080");
          pConfiguration.add(SymbolConstants.HOSTPORT_SECURE, "8443");

          // Tynamo's tapestry-security module configuration
          pConfiguration.add(SecuritySymbols.LOGIN_URL, URL_LOGIN);
          pConfiguration.add(SecuritySymbols.SUCCESS_URL, URL_SUCCESS);
          pConfiguration.add(SecuritySymbols.UNAUTHORIZED_URL, URL_UNAUTHORIZED);

          pConfiguration.add(SymbolConstants.PRODUCTION_MODE,false);
          pConfiguration.add(SymbolConstants.START_PAGE_NAME,"Start");
          
          pConfiguration.add(SymbolConstants.COMBINE_SCRIPTS, false);
          pConfiguration.add(SymbolConstants.COMPRESS_WHITESPACE, false);    
          pConfiguration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, false);
          
          pConfiguration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER, "jquery");

}
 
开发者ID:ffacon,项目名称:tapestry5-angular2-demo,代码行数:41,代码来源:AppModule.java

示例10: createSymbolProvider

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
protected SymbolProvider createSymbolProvider(Map<String, String> diSymbols) {

        Map<String, String> params = new HashMap<>(diSymbols);

        // override DI symbols if set explicitly in the factory
        if (productionMode != null) {
            params.put(SymbolConstants.PRODUCTION_MODE, Boolean.toString(productionMode));
        }

        if (executionModes != null) {
            params.put(SymbolConstants.EXECUTION_MODE, executionModes);
        }

        if (charset != null) {
            params.put(SymbolConstants.CHARSET, charset);
        }

        if (appPackage != null) {
            params.put(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM, appPackage);
        } else {
            // sanity check
            if (!params.containsKey(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM)) {
                throw new IllegalStateException("Tapestry app package is not defined. Use 'tapestry.appPackage' config " +
                        "or inject 'tapestry.app-package' symbol with this value.");
            }
        }

        if (supportedLocales != null) {
            params.put(SymbolConstants.SUPPORTED_LOCALES, supportedLocales);
        }

        // provide default values for symbols if not defined in DI
        if (!params.containsKey(SymbolConstants.GZIP_COMPRESSION_ENABLED)) {
            // compression should be configured at the Jetty level
            params.put(SymbolConstants.GZIP_COMPRESSION_ENABLED, "false");
        }

        return new MapSymbolProvider(params);
    }
 
开发者ID:bootique,项目名称:bootique-tapestry,代码行数:40,代码来源:BQTapestryFilterFactory.java

示例11: createSymbolProvider

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
protected SymbolProvider createSymbolProvider(ServletContext context) {
    // merge upstream provider with defaults from ServletContext
    return new DelegatingSymbolProvider(
            baseSymbolProvider,
            new SingleKeySymbolProvider(SymbolConstants.CONTEXT_PATH, context.getContextPath())
    );
}
 
开发者ID:bootique,项目名称:bootique-tapestry,代码行数:8,代码来源:BQTapestryFilter.java

示例12: setupJSModules

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void setupJSModules(final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration,
    @Path("webjars:es6-shim:es6-shim.js") final Resource es6_shim, 
    @Path("webjars:zone.js:$version/dist/zone.js") final Resource zoneJs,
    @Path("webjars:reflect-metadata:$version/Reflect.js") final Resource reflectMetadata,
    @Path("webjars:systemjs:dist/system.src.js") final Resource systemjs, 
    @Path("webjars:rxjs:bundles/Rx.js") final Resource rx,
    @Path("webjars:angular__core:$version/bundles/core.umd.js") final Resource angular2,
    @Path("webjars:angular__router:$version/bundles/router.umd.js") final Resource router,
    @Path("webjars:angular__http:$version/bundles/http.umd.js") final Resource http,
    @Path("webjars:angular__platform-browser-dynamic:$version/bundles/platform-browser-dynamic.umd.js") final Resource platformBrowserDynamicTesting,
    @Path("webjars:typescript:lib/tsc.js") final Resource tsc,
    @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) {

  configuration.add("es6-shim", new JavaScriptModuleConfiguration(es6_shim));
  configuration.add(A2Script.ZONE_JS.text, new JavaScriptModuleConfiguration(zoneJs));
  configuration.add(A2Script.REFLECT_METADATA.text, new JavaScriptModuleConfiguration(reflectMetadata));
  configuration.add(A2Script.SYSTEM.text, new JavaScriptModuleConfiguration(systemjs));
  configuration.add(A2Script.RX.text, new JavaScriptModuleConfiguration(rx));
  configuration.add(A2Script.A2_ANGULAR.text, new JavaScriptModuleConfiguration(angular2));
  configuration.add(A2Script.A2_ROUTER.text, new JavaScriptModuleConfiguration(router));
  configuration.add(A2Script.A2_HTTP.text, new JavaScriptModuleConfiguration(http));
  configuration.add(A2Script.A2_PLATFORM_BROWSER_DYNAMIC.text, new JavaScriptModuleConfiguration(platformBrowserDynamicTesting));
  configuration.add("tsc", new JavaScriptModuleConfiguration(tsc));
  
  
}
 
开发者ID:ffacon,项目名称:tapestry5-angular2,代码行数:28,代码来源:Angular2Module.java

示例13: addDefaultConfiguration

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
@Contribute(SymbolProvider.class)
@FactoryDefaults
public static void addDefaultConfiguration(final MappedConfiguration<String, Object> configuration) {
  configuration.add(MinificationCacheWarmingSymbols.ENABLE_MINIFICATION_CACHE_WARMING, "${"
      + SymbolConstants.MINIFICATION_ENABLED + "}");
  configuration.add(MinificationCacheWarmingSymbols.LOG_SLOW_MINIFICATION, Boolean.TRUE);
}
 
开发者ID:eddyson-de,项目名称:tapestry-minification-cache-warming,代码行数:8,代码来源:MinificationCacheWarmingModule.java

示例14: addApplicationConfigModule

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
@Contribute(ModuleManager.class)
public static void addApplicationConfigModule(
    final MappedConfiguration<String, JavaScriptModuleConfiguration> configuration, final SymbolSource symbolSource,
    @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) {

  final JSONObject config = new JSONObject();

  for (String symbolName : new String[] { SymbolConstants.CONTEXT_PATH, SymbolConstants.EXECUTION_MODE,
      SymbolConstants.PRODUCTION_MODE, SymbolConstants.START_PAGE_NAME, SymbolConstants.TAPESTRY_VERSION,
      SymbolConstants.SUPPORTED_LOCALES }) {
    String value = symbolSource.valueForSymbol(symbolName);
    config.put(symbolName, value);
  }
  config.put("react-api-path", ReactAPIFilter.path);

  StringBuilder sb = new StringBuilder();
  sb.append("define(");
  sb.append(config.toString(productionMode));
  sb.append(");");
  final byte[] bytes = sb.toString().getBytes(StandardCharsets.UTF_8);

  configuration.add("eddyson/react/application-config", new JavaScriptModuleConfiguration(new VirtualResource() {

    @Override
    public InputStream openStream() throws IOException {
      return new ByteArrayInputStream(bytes);
    }

    @Override
    public String getFile() {
      return "application-config.js";
    }

    @Override
    public URL toURL() {
      return null;
    }
  }));

}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:41,代码来源:ReactModule.java

示例15: BabelResourceTransformer

import org.apache.tapestry5.SymbolConstants; //导入依赖的package包/类
public BabelResourceTransformer(final BabelCompiler babelCompiler,
    @Symbol(ReactSymbols.USE_COLORED_BABEL_OUTPUT) final boolean useColoredOutput,
    @Symbol(ReactSymbols.ENABLE_STAGE_3_TRANSFORMATIONS) final boolean enableStage3Transformations,
    @Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode) {
  this.babelCompiler = babelCompiler;
  this.useColoredOutput = useColoredOutput;
  this.enableStage3Transformations = enableStage3Transformations;
  this.productionMode = productionMode;
}
 
开发者ID:eddyson-de,项目名称:tapestry-react,代码行数:10,代码来源:BabelResourceTransformer.java


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