Search in sources :

Example 1 with LinkElementProps

use of org.eclipse.sirius.components.forms.elements.LinkElementProps in project sirius-components by eclipse-sirius.

the class LinkComponent method render.

@Override
public Element render() {
    VariableManager variableManager = this.props.getVariableManager();
    LinkDescription linkDescription = this.props.getLinkDescription();
    String id = linkDescription.getIdProvider().apply(variableManager);
    String label = linkDescription.getLabelProvider().apply(variableManager);
    String url = linkDescription.getUrlProvider().apply(variableManager);
    List<Element> children = List.of(new Element(DiagnosticComponent.class, new DiagnosticComponentProps(linkDescription, variableManager)));
    // @formatter:off
    LinkElementProps linkElementProps = LinkElementProps.newLinkElementProps(id).label(label).url(url).children(children).build();
    return new Element(LinkElementProps.TYPE, linkElementProps);
// @formatter:on
}
Also used : VariableManager(org.eclipse.sirius.components.representations.VariableManager) DiagnosticComponent(org.eclipse.sirius.components.forms.validation.DiagnosticComponent) LinkDescription(org.eclipse.sirius.components.forms.description.LinkDescription) Element(org.eclipse.sirius.components.representations.Element) LinkElementProps(org.eclipse.sirius.components.forms.elements.LinkElementProps) DiagnosticComponentProps(org.eclipse.sirius.components.forms.validation.DiagnosticComponentProps)

Aggregations

LinkDescription (org.eclipse.sirius.components.forms.description.LinkDescription)1 LinkElementProps (org.eclipse.sirius.components.forms.elements.LinkElementProps)1 DiagnosticComponent (org.eclipse.sirius.components.forms.validation.DiagnosticComponent)1 DiagnosticComponentProps (org.eclipse.sirius.components.forms.validation.DiagnosticComponentProps)1 Element (org.eclipse.sirius.components.representations.Element)1 VariableManager (org.eclipse.sirius.components.representations.VariableManager)1