當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。