Rdn rdn = dnBuilderWidget.getRdn();
LdapDN parentDn = dnBuilderWidget.getParentDn();
final LdapDN dn = DnUtils.composeDn( rdn, parentDn );
// check if parent exists
ReadEntryRunnable readEntryRunnable1 = new ReadEntryRunnable( wizard.getSelectedConnection(), parentDn );
RunnableContextRunner.execute( readEntryRunnable1, getContainer(), false );
IEntry parentEntry = readEntryRunnable1.getReadEntry();
if ( parentEntry == null )
{
getShell().getDisplay().syncExec( new Runnable()
{
public void run()
{
MessageDialog
.openError( getShell(),
Messages.getString( "NewEntryDnWizardPage.Error" ), //$NON-NLS-1$
NLS
.bind(
Messages.getString( "NewEntryDnWizardPage.ParentDoesNotExist" ), dnBuilderWidget.getParentDn().toString() ) ); //$NON-NLS-1$
}
} );
return null;
}
// check that new entry does not exists yet
ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
IEntry entry = readEntryRunnable2.getReadEntry();
if ( entry != null )
{
getShell().getDisplay().syncExec( new Runnable()
{
public void run()
{
MessageDialog
.openError(
getShell(),
Messages.getString( "NewEntryDnWizardPage.Error" ), NLS.bind( Messages.getString( "NewEntryDnWizardPage.EntryAlreadyExists" ), dn.toString() ) ); //$NON-NLS-1$ //$NON-NLS-2$
}
} );
return null;
}
}
else
{
try
{
final LdapDN dn = new LdapDN( contextEntryDnCombo.getText() );
// check that new entry does not exists yet
ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
IEntry entry = readEntryRunnable2.getReadEntry();
if ( entry != null )
{
getShell().getDisplay().syncExec( new Runnable()
{
public void run()