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


Java Asset类代码示例

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


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

示例1: after

import org.apache.tapestry5.Asset; //导入依赖的package包/类
@AfterRender
void after(MarkupWriter writer){
 Resource res;
 Asset asset;
 if(!isListEmpty())
 {
	 for (String script : scriptList){
		 try{
		 res=moduleManager.findResourceForModule(script);
		 asset=assetSource.getUnlocalizedAsset(res.toString());
		 String url = asset.toClientURL();
		 writer.element("script", "type", "text/javascript", "src", url);
		 writer.end();}
		 catch(Exception ex)
		 {
			  logger.error("Script not found:"+ ex.getMessage());
		 }
	 }
 }
 
}
 
开发者ID:ffacon,项目名称:tapestry5-angular2,代码行数:22,代码来源:A2Dependencies.java

示例2: addMethodAssetOperationAdvice

import org.apache.tapestry5.Asset; //导入依赖的package包/类
private void addMethodAssetOperationAdvice(PlasticMethod method, final FieldHandle access,
        final Worker<Asset> operation)
{
    method.addAdvice(new MethodAdvice()
    {

        @Override
        public void advise(MethodInvocation invocation)
        {
            Asset[] assets = (Asset[]) access.get(invocation.getInstance());

            F.flow(assets).each(operation);

            invocation.proceed();
        }
    });
}
 
开发者ID:pubfactory,项目名称:tapestry-compat,代码行数:18,代码来源:AbstractIncludeWorker.java

示例3: getJavaScriptLibraries

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public List<Asset> getJavaScriptLibraries()
{
	final List<Asset> javaScriptStack = new ArrayList<Asset>();

	javaScriptStack.add(assetSource.getUnlocalizedAsset(es6_shim.toString()));
	javaScriptStack.add(assetSource.getUnlocalizedAsset(zoneJs.toString()));
    javaScriptStack.add(assetSource.getUnlocalizedAsset(reflectMetadata.toString()));
	javaScriptStack.add(assetSource.getUnlocalizedAsset(systemjs.toString())); 
	javaScriptStack.add(assetSource.getUnlocalizedAsset(rx.toString()));
	javaScriptStack.add(assetSource.getUnlocalizedAsset(angular2.toString())); 
    
    return javaScriptStack;
}
 
开发者ID:ffacon,项目名称:tapestry5-angular2,代码行数:14,代码来源:Angular2JavascriptStack.java

示例4: DimpleStack

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public DimpleStack(
		@Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode, 
		final AssetSource assetSource) {
	super();
	this.productionMode = productionMode;
	
	final Mapper<String, Asset> pathToAsset = new Mapper<String, Asset>()
       {

           public Asset map(String path)
           {
               return assetSource.getExpandedAsset(path);
           }
       };


       stylesheetStack = CollectionFactory.newList();
       
       if (productionMode) {
       	
       	javaScriptStack = F
               .flow("${" + D3SymbolConstants.JQUERY_D3_ASSET_PATH +"}/dimple.min.js")
           .map(pathToAsset).toList();

       } else {
       	
       	javaScriptStack = F
       			.flow("${" + D3SymbolConstants.JQUERY_D3_ASSET_PATH +"}/dimple.js")
           .map(pathToAsset).toList();

       }
	
}
 
开发者ID:got5,项目名称:tapestry5-d3,代码行数:34,代码来源:DimpleStack.java

示例5: D3Stack

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public D3Stack(
		@Symbol(SymbolConstants.PRODUCTION_MODE) final boolean productionMode, 
		final AssetSource assetSource) {
	super();
	this.productionMode = productionMode;
	
	final Mapper<String, Asset> pathToAsset = new Mapper<String, Asset>()
       {

           public Asset map(String path)
           {
               return assetSource.getExpandedAsset(path);
           }
       };


       stylesheetStack = CollectionFactory.newList();
       
       if (productionMode) {
       	
       	javaScriptStack = F
               .flow("${" + D3SymbolConstants.JQUERY_D3_ASSET_PATH +"}/d3.min.js")
           .map(pathToAsset).toList();

       } else {
       	
       	javaScriptStack = F
       			.flow("${" + D3SymbolConstants.JQUERY_D3_ASSET_PATH +"}/d3.js")
           .map(pathToAsset).toList();

       }
	
}
 
开发者ID:got5,项目名称:tapestry5-d3,代码行数:34,代码来源:D3Stack.java

示例6: initializeAssetsFromPaths

import org.apache.tapestry5.Asset; //导入依赖的package包/类
private void initializeAssetsFromPaths(final Resource baseResource,
        final String[] expandedPaths, final PlasticField assetsField)
{
    assetsField.injectComputed(new ComputedValue<Asset[]>()
    {

        @Override
        public Asset[] get(InstanceContext context)
        {
            ComponentResources resources = context.get(ComponentResources.class);

            return convertPathsToAssetArray(baseResource, resources.getLocale(), expandedPaths);
        }
    });
}
 
开发者ID:pubfactory,项目名称:tapestry-compat,代码行数:16,代码来源:AbstractIncludeWorker.java

示例7: convertPathsToAssetArray

import org.apache.tapestry5.Asset; //导入依赖的package包/类
private Asset[] convertPathsToAssetArray(final Resource baseResource, final Locale locale, String[] assetPaths)
{
    return F.flow(assetPaths).map(new Mapper<String, Asset>()
    {

        @Override
        public Asset map(String assetPath)
        {
            return assetSource.getAsset(baseResource, assetPath, locale);
        }
    }).toArray(Asset.class);
}
 
开发者ID:pubfactory,项目名称:tapestry-compat,代码行数:13,代码来源:AbstractIncludeWorker.java

示例8: getWorker

import org.apache.tapestry5.Asset; //导入依赖的package包/类
@Override
protected Worker<Asset> getWorker() {
    return new Worker<Asset>()
    {
        public void work(Asset asset)
        {
            javascriptSupport.importJavaScriptLibrary(asset);
        }
    };
}
 
开发者ID:pubfactory,项目名称:tapestry-compat,代码行数:11,代码来源:IncludeJavaScriptLibraryWorker.java

示例9: getWorker

import org.apache.tapestry5.Asset; //导入依赖的package包/类
@Override
protected Worker<Asset> getWorker() {
    return new Worker<Asset>()
    {
        @Override
        public void work(Asset asset)
        {
            javascriptSupport.importStylesheet(asset);
        }
    };
}
 
开发者ID:pubfactory,项目名称:tapestry-compat,代码行数:12,代码来源:IncludeStylesheetWorker.java

示例10: getImage

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public Asset getImage() {
	return new Asset() {
		
		public String toClientURL() {
			return "https://www.paypal.com/en_US/i/logo/PayPal_mark_37x23.gif";
		}
		
		public Resource getResource() {
			return null;
		}
	};
}
 
开发者ID:trsvax,项目名称:tapestry-paypal-rest,代码行数:13,代码来源:PayPalButton.java

示例11: createAsset

import org.apache.tapestry5.Asset; //导入依赖的package包/类
@Override
public Asset createAsset(final Resource resource) {
  return createAsset(resource, "webjars",
      ((WebjarsResource) resource).getPath().substring(WebJarAssetLocator.WEBJARS_PATH_PREFIX.length() + 1));
}
 
开发者ID:eddyson-de,项目名称:tapestry-webjars,代码行数:6,代码来源:WebjarsAssetFactory.java

示例12: getJavaScriptLibraries

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public List<Asset> getJavaScriptLibraries() {
    return jsStack;
}
 
开发者ID:dlwhitehurst,项目名称:musicrecital,代码行数:4,代码来源:BootstrapJavaScriptStack.java

示例13: ValidationDelegate

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public ValidationDelegate(Environment environment, Asset iconAsset,
                          MarkupWriter markupWriter) {
    this.environment = environment;
    this.markupWriter = markupWriter;
    this.iconAsset = iconAsset;
}
 
开发者ID:dlwhitehurst,项目名称:musicrecital,代码行数:7,代码来源:ValidationDelegate.java

示例14: getJavaScriptLibraries

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public List<Asset> getJavaScriptLibraries()
{
    return javaScriptStack;
}
 
开发者ID:got5,项目名称:tapestry5-d3,代码行数:5,代码来源:DimpleStack.java

示例15: getJavaScriptLibraries

import org.apache.tapestry5.Asset; //导入依赖的package包/类
public
List<Asset> getJavaScriptLibraries() {
    return original != null ? original.getJavaScriptLibraries() : Collections.<Asset>emptyList();
}
 
开发者ID:Allogy,项目名称:isqrl-server,代码行数:5,代码来源:DefaultJavaScriptAndCssCensor.java


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