@Override
public void contribute( final PropertyEditorAssistContext context )
{
SapphirePart part = context.getPart();
final Element element = part.getLocalModelElement();
Property property = null;
if (part instanceof PropertyEditorPart)
{
property = ((PropertyEditorPart)part).property();
}
else if (part instanceof WithPart)
{
property = ((WithPart)part).property();
}
boolean contribute = false;
if( property == null )
{
contribute = ! element.validation().ok();
}
else if( ! property.validation().ok() )
{
contribute = true;
}
else
{
contribute = ! property.empty();
}
if( contribute )
{
final Set<String> facts;
if( property != null )
{
facts = property.service( FactsAggregationService.class ).facts();
}
else
{
FactsAggregationService service = element.service( FactsAggregationService.class );
facts = service != null ? service.facts() : new TreeSet<String>();
}
for( String fact : facts )
{