if( this.control.isDisposed() )
{
return;
}
final SwtResourceCache imageCache = this.part.getSwtResourceCache();
if( this.assistContext != null )
{
if( this.problem != null )
{
final String fieldDecorationId;
switch( this.problem.severity() )
{
case ERROR:
{
fieldDecorationId = FieldDecorationRegistry.DEC_ERROR;
break;
}
case WARNING:
{
fieldDecorationId = FieldDecorationRegistry.DEC_WARNING;
break;
}
default:
{
throw new IllegalStateException();
}
}
final FieldDecoration fieldDecoration
= FieldDecorationRegistry.getDefault().getFieldDecoration( fieldDecorationId );
this.control.setImage( fieldDecoration.getImage() );
}
else
{
if( this.mouseOverEditorControl )
{
this.control.setImage( imageCache.image( IMG_ASSIST ) );
}
else
{
this.control.setImage( imageCache.image( IMG_ASSIST_FAINT ) );
}
}
this.control.setVisible( true );
this.control.setCursor( Display.getCurrent().getSystemCursor( SWT.CURSOR_HAND ) );
}
else
{
this.control.setVisible( false );
this.control.setImage( imageCache.image( IMG_ASSIST_CLEAR ) );
this.control.setCursor( null );
}
}