Search in sources :

Example 1 with Conditional

use of org.eclipse.sirius.components.view.Conditional in project sirius-components by eclipse-sirius.

the class DiagramDescriptionValidator method validate.

@Override
public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) {
    boolean isValid = true;
    if (eObject instanceof DiagramDescription) {
        DiagramDescription diagramDescription = (DiagramDescription) eObject;
        isValid = this.hasProperDomainType(diagramDescription, diagnostics) && isValid;
    }
    if (eObject instanceof DiagramElementDescription) {
        DiagramElementDescription diagramElementDescription = (DiagramElementDescription) eObject;
        isValid = this.hasProperDomainType(diagramElementDescription, diagnostics) && isValid;
    }
    if (eObject instanceof NodeStyle) {
        NodeStyle nodeStyle = (NodeStyle) eObject;
        isValid = this.hasProperColor(nodeStyle, diagnostics) && isValid;
    }
    if (eObject instanceof Conditional) {
        Conditional conditional = (Conditional) eObject;
        isValid = this.conditionIsPresent(conditional, diagnostics) && isValid;
    }
    if (eObject instanceof CreateInstance) {
        CreateInstance createInstance = (CreateInstance) eObject;
        isValid = this.hasProperDomainType(createInstance, diagnostics) && isValid;
    }
    return isValid;
}
Also used : NodeStyle(org.eclipse.sirius.components.view.NodeStyle) Conditional(org.eclipse.sirius.components.view.Conditional) CreateInstance(org.eclipse.sirius.components.view.CreateInstance) DiagramDescription(org.eclipse.sirius.components.view.DiagramDescription) DiagramElementDescription(org.eclipse.sirius.components.view.DiagramElementDescription)

Aggregations

Conditional (org.eclipse.sirius.components.view.Conditional)1 CreateInstance (org.eclipse.sirius.components.view.CreateInstance)1 DiagramDescription (org.eclipse.sirius.components.view.DiagramDescription)1 DiagramElementDescription (org.eclipse.sirius.components.view.DiagramElementDescription)1 NodeStyle (org.eclipse.sirius.components.view.NodeStyle)1