Search in sources :

Example 1 with LayoutEditorElement

use of org.uberfire.ext.layout.editor.client.api.LayoutEditorElement in project kie-wb-common by kiegroup.

the class FormEditorPresenter method onLayoutEditorElementSelectEvent.

public void onLayoutEditorElementSelectEvent(@Observes LayoutEditorElementSelectEvent event) {
    LayoutEditorElement element = event.getElement();
    if (element instanceof ComponentColumn) {
        ComponentColumn componentColumn = (ComponentColumn) element;
        LayoutComponent layoutComponent = componentColumn.getLayoutComponent();
        LayoutDragComponent layoutDragComponent = componentColumn.getLayoutDragComponent();
        boolean containsElement = getFormDefinition().getLayoutTemplate().contains(layoutComponent);
        if (layoutDragComponent instanceof EditorFieldLayoutComponent && containsElement) {
            ((EditorFieldLayoutComponent) layoutDragComponent).addComponentParts(layoutComponent);
        }
        componentColumn.setupParts();
    }
}
Also used : HTMLLayoutDragComponent(org.uberfire.ext.plugin.client.perspective.editor.layout.editor.HTMLLayoutDragComponent) LayoutDragComponent(org.uberfire.ext.layout.editor.client.api.LayoutDragComponent) LayoutEditorElement(org.uberfire.ext.layout.editor.client.api.LayoutEditorElement) ComponentColumn(org.uberfire.ext.layout.editor.client.components.columns.ComponentColumn) EditorFieldLayoutComponent(org.kie.workbench.common.forms.editor.client.editor.rendering.EditorFieldLayoutComponent) LayoutComponent(org.uberfire.ext.layout.editor.api.editor.LayoutComponent) EditorFieldLayoutComponent(org.kie.workbench.common.forms.editor.client.editor.rendering.EditorFieldLayoutComponent) FieldLayoutComponent(org.kie.workbench.common.forms.dynamic.client.rendering.FieldLayoutComponent)

Aggregations

FieldLayoutComponent (org.kie.workbench.common.forms.dynamic.client.rendering.FieldLayoutComponent)1 EditorFieldLayoutComponent (org.kie.workbench.common.forms.editor.client.editor.rendering.EditorFieldLayoutComponent)1 LayoutComponent (org.uberfire.ext.layout.editor.api.editor.LayoutComponent)1 LayoutDragComponent (org.uberfire.ext.layout.editor.client.api.LayoutDragComponent)1 LayoutEditorElement (org.uberfire.ext.layout.editor.client.api.LayoutEditorElement)1 ComponentColumn (org.uberfire.ext.layout.editor.client.components.columns.ComponentColumn)1 HTMLLayoutDragComponent (org.uberfire.ext.plugin.client.perspective.editor.layout.editor.HTMLLayoutDragComponent)1