Search in sources :

Example 1 with FormEditorFieldGroupsProvider

use of org.kie.workbench.common.forms.editor.client.editor.groupProviders.FormEditorFieldGroupsProvider in project kie-wb-common by kiegroup.

the class FormEditorPresenter method loadAvailableFields.

protected void loadAvailableFields() {
    String groupName = translationService.getTranslation(FormEditorConstants.FormEditorPresenterModelFields);
    List<LayoutDragComponent> fieldComponents = editorHelper.getAvailableFields().values().stream().map(fieldDefinition -> {
        EditorFieldLayoutComponent layoutFieldComponent = editorFieldLayoutComponents.get();
        if (layoutFieldComponent != null) {
            layoutFieldComponent.init(editorHelper.getRenderingContext(), fieldDefinition);
            return layoutFieldComponent;
        }
        return null;
    }).filter(Objects::nonNull).collect(Collectors.toList());
    layoutDragComponentPalette.addDraggableGroup(new FormEditorFieldGroupsProvider(groupName, fieldComponents));
}
Also used : HTMLLayoutDragComponent(org.uberfire.ext.plugin.client.perspective.editor.layout.editor.HTMLLayoutDragComponent) LayoutDragComponent(org.uberfire.ext.layout.editor.client.api.LayoutDragComponent) FormEditorFieldGroupsProvider(org.kie.workbench.common.forms.editor.client.editor.groupProviders.FormEditorFieldGroupsProvider) EditorFieldLayoutComponent(org.kie.workbench.common.forms.editor.client.editor.rendering.EditorFieldLayoutComponent)

Example 2 with FormEditorFieldGroupsProvider

use of org.kie.workbench.common.forms.editor.client.editor.groupProviders.FormEditorFieldGroupsProvider in project kie-wb-common by kiegroup.

the class FormEditorPresenter method loadFormControls.

protected void loadFormControls() {
    String groupName = translationService.getTranslation(FormEditorConstants.FormEditorPresenterComponentsPalette);
    List<LayoutDragComponent> components = new ArrayList<>();
    components.add(htmlLayoutDragComponent);
    editorHelper.getBaseFieldsDraggables().forEach(components::add);
    layoutDragComponentPalette.addDraggableGroup(new FormEditorFieldGroupsProvider(groupName, components));
}
Also used : HTMLLayoutDragComponent(org.uberfire.ext.plugin.client.perspective.editor.layout.editor.HTMLLayoutDragComponent) LayoutDragComponent(org.uberfire.ext.layout.editor.client.api.LayoutDragComponent) ArrayList(java.util.ArrayList) FormEditorFieldGroupsProvider(org.kie.workbench.common.forms.editor.client.editor.groupProviders.FormEditorFieldGroupsProvider)

Aggregations

FormEditorFieldGroupsProvider (org.kie.workbench.common.forms.editor.client.editor.groupProviders.FormEditorFieldGroupsProvider)2 LayoutDragComponent (org.uberfire.ext.layout.editor.client.api.LayoutDragComponent)2 HTMLLayoutDragComponent (org.uberfire.ext.plugin.client.perspective.editor.layout.editor.HTMLLayoutDragComponent)2 ArrayList (java.util.ArrayList)1 EditorFieldLayoutComponent (org.kie.workbench.common.forms.editor.client.editor.rendering.EditorFieldLayoutComponent)1