本文整理汇总了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());
}
}
}
}
示例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();
}
});
}
示例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;
}
示例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();
}
}
示例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();
}
}
示例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);
}
});
}
示例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);
}
示例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);
}
};
}
示例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);
}
};
}
示例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;
}
};
}
示例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));
}
示例12: getJavaScriptLibraries
import org.apache.tapestry5.Asset; //导入依赖的package包/类
public List<Asset> getJavaScriptLibraries() {
return jsStack;
}
示例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;
}
示例14: getJavaScriptLibraries
import org.apache.tapestry5.Asset; //导入依赖的package包/类
public List<Asset> getJavaScriptLibraries()
{
return javaScriptStack;
}
示例15: getJavaScriptLibraries
import org.apache.tapestry5.Asset; //导入依赖的package包/类
public
List<Asset> getJavaScriptLibraries() {
return original != null ? original.getJavaScriptLibraries() : Collections.<Asset>emptyList();
}