}
@Override
public void render()
{
final HtmlPanelPart part = part();
final HtmlPanelDef def = part.definition();
final boolean scaleVertically = part.getScaleVertically();
GridData gd = gdhindent( gdwhint( gdhspan( ( scaleVertically ? gdfill() : gdhfill() ), 2 ), 100 ), 9 );
if( ! scaleVertically )
{
gd = gdhhint( gd, def.getHeight().content() );
}
final int style = ( def.getShowBorder().content() == true ? SWT.BORDER : SWT.NONE );
try
{
final Browser browser = new Browser( composite(), style );
browser.setLayoutData( gd );
register( browser );
if( def.getContentSourceType().content() == HtmlContentSourceType.EMBEDDED )
{
browser.setText( part.content() );
attachPartListener
(
new FilteredListener<ContentEvent>()
{
@Override
protected void handleTypedEvent( final ContentEvent event )
{
browser.setText( part.content() );
}
}
);
}
else
{
browser.setUrl( part.url() );
attachPartListener
(
new FilteredListener<ContentEvent>()
{
@Override
protected void handleTypedEvent( final ContentEvent event )
{
browser.setUrl( part.url() );
}
}
);
}
}