use of org.kie.workbench.common.stunner.forms.context.PathAwareFormContext in project kie-wb-common by kiegroup.
the class FormDisplayer method doRender.
private void doRender(Element<? extends Definition<?>> element, Object definition, Path diagramPath, FieldChangeHandler changeHandler) {
if (renderer.isInitialized()) {
LOGGER.fine("Clearing previous form");
renderer.unBind();
}
LOGGER.fine("Rendering a new form for element");
Collection<FormElementFilter> filters = FormFiltersProviderFactory.getFilterForDefinition(element.getUUID(), element, definition);
final BindableProxy<?> proxy = (BindableProxy<?>) BindableProxyFactory.getBindableProxy(definition);
final StaticModelFormRenderingContext generatedCtx = modelGenerator.getContextForModel(proxy.deepUnwrap(), filters.stream().toArray(FormElementFilter[]::new));
final FormRenderingContext<?> pathAwareCtx = new PathAwareFormContext<>(generatedCtx, diagramPath);
renderer.render(pathAwareCtx);
renderer.addFieldChangeHandler(changeHandler);
}
Aggregations