use of org.uberfire.ext.layout.editor.client.api.LayoutDragComponent in project kie-wb-common by kiegroup.
the class FormGeneratorDriver method lookupComponent.
protected LayoutDragComponent lookupComponent(LayoutComponent layoutComponent) {
Class<? extends LayoutDragComponent> clazz = componentsCache.get(layoutComponent.getDragTypeName());
if (clazz == null) {
SyncBeanDef dragTypeDef = beanManager.lookupBeans(layoutComponent.getDragTypeName()).iterator().next();
componentsCache.put(layoutComponent.getDragTypeName(), dragTypeDef.getBeanClass());
clazz = dragTypeDef.getBeanClass();
}
LayoutDragComponent dragComponent = instance.select(clazz).get();
if (dragComponent instanceof FieldLayoutComponent) {
FieldLayoutComponent fieldComponent = (FieldLayoutComponent) dragComponent;
FieldDefinition field = renderingContext.getRootForm().getFieldById(layoutComponent.getProperties().get(FieldLayoutComponent.FIELD_ID));
fieldComponent.init(renderingContext, field);
layoutComponents.add(fieldComponent);
}
return dragComponent;
}
use of org.uberfire.ext.layout.editor.client.api.LayoutDragComponent in project kie-wb-common by kiegroup.
the class FormGeneratorDriver method createComponent.
@Override
public IsWidget createComponent(HTMLElement column, LayoutComponent layoutComponent) {
final LayoutDragComponent dragComponent = lookupComponent(layoutComponent);
if (dragComponent != null) {
Widget columnWidget = ElementWrapperWidget.getWidget(column);
RenderingContext componentContext = new RenderingContext(layoutComponent, columnWidget);
return dragComponent.getShowWidget(componentContext);
}
return null;
}
Aggregations