StructuredSelection selection = ( StructuredSelection ) saslRealmsTableViewer.getSelection();
if ( !selection.isEmpty() )
{
String oldSaslRealm = ( String ) selection.getFirstElement();
SaslRealmDialog dialog = new SaslRealmDialog( oldSaslRealm );
if ( Dialog.OK == dialog.open() && dialog.isDirty() )
{
saslRealms.remove( oldSaslRealm );
String newSaslRealm = dialog.getSaslRealm();
if ( newSaslRealm != null && !"".equals( newSaslRealm ) && !saslRealms.contains( newSaslRealm ) )
{
saslRealms.add( newSaslRealm );
}