Search in sources :

Example 1 with ISemanticRepresentation

use of org.eclipse.sirius.components.representations.ISemanticRepresentation in project sirius-web by eclipse-sirius.

the class RepresentationService method isDangling.

@Override
public boolean isDangling(IEditingContext editingContext, IRepresentation representation) {
    if (representation instanceof ISemanticRepresentation) {
        ISemanticRepresentation semanticRepresentation = (ISemanticRepresentation) representation;
        String targetObjectId = semanticRepresentation.getTargetObjectId();
        Optional<Object> optionalObject = this.objectService.getObject(editingContext, targetObjectId);
        return optionalObject.isEmpty();
    }
    return false;
}
Also used : ISemanticRepresentation(org.eclipse.sirius.components.representations.ISemanticRepresentation)

Aggregations

ISemanticRepresentation (org.eclipse.sirius.components.representations.ISemanticRepresentation)1