use of org.eclipse.sirius.components.forms.elements.PageElementProps in project sirius-components by eclipse-sirius.
the class PageComponent method render.
@Override
public Element render() {
VariableManager variableManager = this.props.getVariableManager();
PageDescription pageDescription = this.props.getPageDescription();
List<?> semanticElements = pageDescription.getSemanticElementsProvider().apply(variableManager);
List<Element> children = new ArrayList<>(semanticElements.size());
for (Object semanticElement : semanticElements) {
VariableManager pageVariableManager = variableManager.createChild();
pageVariableManager.put(VariableManager.SELF, semanticElement);
String id = pageDescription.getIdProvider().apply(pageVariableManager);
String label = pageDescription.getLabelProvider().apply(pageVariableManager);
// @formatter:off
List<Element> groupComponents = pageDescription.getGroupDescriptions().stream().map(groupDescription -> {
GroupComponentProps groupComponentProps = new GroupComponentProps(pageVariableManager, groupDescription);
return new Element(GroupComponent.class, groupComponentProps);
}).collect(Collectors.toList());
PageElementProps pageElementProps = PageElementProps.newPageElementProps(id).label(label).children(groupComponents).build();
Element pageElement = new Element(PageElementProps.TYPE, pageElementProps);
// @formatter:on
children.add(pageElement);
}
FragmentProps fragmentProps = new FragmentProps(children);
return new Fragment(fragmentProps);
}
Aggregations