Search in sources :

Example 1 with DiagnosticElementProps

use of org.eclipse.sirius.components.validation.elements.DiagnosticElementProps in project sirius-components by eclipse-sirius.

the class DiagnosticComponent method render.

@Override
public Element render() {
    Object diagnostic = this.props.getDiagnostic();
    ValidationDescription validationDescription = this.props.getValidationDescription();
    String kind = validationDescription.getKindProvider().apply(diagnostic);
    String message = validationDescription.getMessageProvider().apply(diagnostic);
    // @formatter:off
    DiagnosticElementProps diagnosticElementProps = DiagnosticElementProps.newDiagnosticElementProps(UUID.randomUUID()).kind(kind).message(message).build();
    return new Element(DiagnosticElementProps.TYPE, diagnosticElementProps);
}
Also used : ValidationDescription(org.eclipse.sirius.components.validation.description.ValidationDescription) DiagnosticElementProps(org.eclipse.sirius.components.validation.elements.DiagnosticElementProps) Element(org.eclipse.sirius.components.representations.Element)

Aggregations

Element (org.eclipse.sirius.components.representations.Element)1 ValidationDescription (org.eclipse.sirius.components.validation.description.ValidationDescription)1 DiagnosticElementProps (org.eclipse.sirius.components.validation.elements.DiagnosticElementProps)1