@Override
protected IFigure createFigure()
{
ValidationMarkerModel markerModel = (ValidationMarkerModel)this.getModel();
ValidationMarkerPart markerPart = (ValidationMarkerPart)markerModel.getSapphirePart();
DiagramNodePart nodePart = markerPart.nearest(DiagramNodePart.class);
ValidationMarkerSize size = markerPart.getSize();
Image image = null;
Element model = nodePart.getModelElement();
Status status = model.validation();
if (status.severity() != Status.Severity.OK)
{
if (status.severity() == Status.Severity.WARNING)
{
if (size == ValidationMarkerSize.SMALL)
{
image = nodePart.getSwtResourceCache().image(IMG_WARNING_SMALL);
}
else
{
image = nodePart.getSwtResourceCache().image(IMG_WARNING);
}
}
else if (status.severity() == Status.Severity.ERROR)
{
if (size == ValidationMarkerSize.SMALL)
{
image = nodePart.getSwtResourceCache().image(IMG_ERROR_SMALL);
}
else
{
image = nodePart.getSwtResourceCache().image(IMG_ERROR);
}
}
}
if (image != null)
{