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


Java NoSuitableRendererAvailableException类代码示例

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


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

示例1: build

import com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException; //导入依赖的package包/类
/**
 * Build and bind {@link ViewComponent}s to the properties of the property set.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public void build() {
	propertyViews.clear();
	// render and bind ViewComponents
	properties.forEach(p -> {
		// exclude hidden properties
		if (!isPropertyHidden(p)) {
			final Optional<ViewComponent> viewComponent = render(p);
			if (!viewComponent.isPresent() && !isIgnoreMissingViewComponent()) {
				throw new NoSuitableRendererAvailableException(
						"No ViewComponent render available to render the property [" + p.toString()
								+ "] as a ViewComponent");
			}
			viewComponent.ifPresent(v -> {
				// configure
				configureViewComponent(p, v);
				// bind
				propertyViews.put(p, v);
			});
		}
	});
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:26,代码来源:DefaultPropertyViewGroup.java

示例2: renderAndBind

import com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException; //导入依赖的package包/类
/**
 * Render the {@link Input} and set it up in given property configuration.
 * @param <T> Property type
 * @param configuration Property configuration
 */
private <T> void renderAndBind(PropertyConfiguration<T> configuration) {
	final Optional<Input<T>> input = render(configuration.getProperty());
	if (!input.isPresent() && !isIgnoreMissingInputs()) {
		throw new NoSuitableRendererAvailableException(
				"No Input renderer available to render the property [" + configuration.getProperty() + "]");
	}
	input.ifPresent(i -> {
		// configure
		configureInput(configuration, i);
		// bind
		configuration.setInput(i);
	});
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:19,代码来源:DefaultPropertyInputGroup.java

示例3: render

import com.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException; //导入依赖的package包/类
/**
 * Render this property as given <code>renderType</code>.
 * <p>
 * To successfully render the property, a suitable {@link PropertyRenderer} for given render type must be available
 * from the {@link PropertyRendererRegistry} obtained from current {@link Context} or from the default one for
 * current ClassLoader.
 * </p>
 * @param <R> Rendered object type
 * @param renderType Render type
 * @return Rendered property as given render type
 * @throws NoSuitableRendererAvailableException if no PropertyRenderer is available for this property and given
 *         rendering type
 */
default <R> R render(Class<R> renderType) {
	return renderIfAvailable(renderType).orElseThrow(() -> new NoSuitableRendererAvailableException(
			"No PropertyRenderer available for rendering type " + renderType + " and property " + this));
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:18,代码来源:Property.java


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