{
handleJumpCommand( item, columnsWithHyperlinks.get( 0 ) );
}
else if( ! columnsWithHyperlinks.isEmpty() )
{
final Dialog dialog = new Dialog( this.table.getShell() )
{
private int choice = columnsWithHyperlinks.get( 0 );
@Override
protected Control createDialogArea( final Composite parent )
{
getShell().setText( jumpDialogTitle.text() );
final Composite composite = (Composite) super.createDialogArea( parent );
final Label prompt = new Label( composite, SWT.WRAP );
prompt.setLayoutData( gdwhint( gdhfill(), 300 ) );
prompt.setText( jumpDialogPrompt.text() );
final SelectionListener listener = new SelectionAdapter()
{
public void widgetSelected( final SelectionEvent event )
{
setChoice( (Integer) event.widget.getData() );
}
};
boolean first = true;
for( Integer col : columnsWithHyperlinks )
{
final Button button = new Button( composite, SWT.RADIO | SWT.WRAP );
button.setLayoutData( gdhindent( gd(), 10 ) );
button.setText( item.getText( col ) );
button.setData( col );
if( first )
{
button.setSelection( true );
first = false;
}
button.addSelectionListener( listener );
}
return composite;
}
@Override
protected void okPressed()
{
super.okPressed();
handleJumpCommand( item, this.choice );
}
private void setChoice( final int choice )
{
this.choice = choice;
}
};
dialog.open();
}
}
}