本文整理汇总了Java中org.apache.tapestry5.ComponentResources类的典型用法代码示例。如果您正苦于以下问题:Java ComponentResources类的具体用法?Java ComponentResources怎么用?Java ComponentResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComponentResources类属于org.apache.tapestry5包,在下文中一共展示了ComponentResources类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newBinding
import org.apache.tapestry5.ComponentResources; //导入依赖的package包/类
public Binding newBinding(String description, ComponentResources container, ComponentResources component,
String expression, Location location) {
Object target = container.getComponent();
Class<?> targetClass = target.getClass();
Matcher matcher = EXPRESSION_PATTERN.matcher(expression);
if (!matcher.matches()) {
String msg = String.format("Expression %s does not match %s", expression, EXPRESSION_PATTERN.pattern());
throw new TapestryException(msg, location, null);
}
PropertyConduit mapConduit = source.create(targetClass, matcher.group(1));
PropertyConduit keyConduit = source.create(targetClass, matcher.group(2));
String toString = interner.format("MapPropBinding[%s %s(%s)]", description, container.getCompleteId(),
expression);
return new MapBinding(location, target, mapConduit, keyConduit, toString);
}
示例2: initializeAssetsFromPaths
import org.apache.tapestry5.ComponentResources; //导入依赖的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);
}
});
}
示例3: defaultTitle
import org.apache.tapestry5.ComponentResources; //导入依赖的package包/类
Binding defaultTitle()
{
ComponentResources pageResources = componentResources.getPage().getComponentResources();
return bindingSource.newBinding("title from subordinate component page class", pageResources, BindingConstants.MESSAGE, "title");
}