else
{
imageControl = null;
}
final SapphireFormText text = new SapphireFormText( composite, SWT.NONE );
text.setLayoutData( gdvalign( gdhfill(), SWT.CENTER ) );
keyboardActionPresentation.attach( text );
String label = part.label( CapitalizationType.FIRST_WORD_ONLY );
label = ( label == null ? labelNotSpecified.text() : label );
final StringBuilder buf = new StringBuilder();
buf.append( "<form><p vspace=\"false\"><a href=\"action\" nowrap=\"true\">" );
buf.append( label );
buf.append( "</a></p></form>" );
text.setText( buf.toString(), true, false );
text.addHyperlinkListener
(
new HyperlinkAdapter()
{
@Override
public void linkActivated( final HyperlinkEvent event )
{
final SapphireActionHandler handler = part.handler();
if( handler != null )
{
handler.execute( ActuatorLinkPresentation.this );
}
}
}
);
text.setEnabled( part.enabled() );
attachPartListener
(
new Listener()
{
@Override
public void handle( final Event event )
{
if( event instanceof EnablementChangedEvent )
{
final boolean enabled = part.enabled();
if( imageControl != null )
{
imageControl.setEnabled( enabled );
}
text.setEnabled( enabled );
}
else if( event instanceof LabelChangedEvent )
{
final StringBuilder buf = new StringBuilder();
buf.append( "<form><p vspace=\"false\"><a href=\"action\" nowrap=\"true\">" );
buf.append( part.label( CapitalizationType.FIRST_WORD_ONLY ) );
buf.append( "</a></p></form>" );
text.setText( buf.toString(), true, false );
composite.getParent().layout( true, true );
}
else if( event instanceof ImageChangedEvent )
{