{
public void modifyText( ModifyEvent e )
{
try
{
dn = new DN( dnCombo.getText() );
}
catch ( NameException e1 )
{
dn = null;
}
internalSetEnabled();
notifyListeners();
}
} );
// Up button
upButton = new Button( textAndUpComposite, SWT.PUSH );
upButton.setToolTipText( "Parent" );
upButton.setImage( BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_PARENT ) );
upButton.setEnabled( false );
upButton.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
if ( dn != null && dn.getParentDn() != null )
{
dn = dn.getParentDn();
dnChanged();
internalSetEnabled();
notifyListeners();
}
}
} );
// Browse button
entryBrowseButton = BaseWidgetUtils.createButton( parent, "Br&owse...", 1 );
entryBrowseButton.addSelectionListener( new SelectionAdapter()
{
public void widgetSelected( SelectionEvent e )
{
if ( connection != null )
{
// get root entry
IEntry rootEntry = connection.getRootDSE();
if( suffix != null && suffix.getRdns().length > 0 )
{
rootEntry = connection.getEntryFromCache( suffix );
if ( rootEntry == null )
{
ReadEntryJob job = new ReadEntryJob( connection, suffix );
RunnableContextJobAdapter.execute( job );
rootEntry = job.getReadEntry();
}
}
// calculate initial DN
DN initialDN = dn;
if( suffix != null && suffix.getRdns().length > 0 )
{
if( initialDN != null && initialDN.getRdns().length > 0 )
{
initialDN = new DN( initialDN, suffix );
}
}
// get initial entry
IEntry entry = rootEntry;
if ( initialDN != null && initialDN.getRdns().length > 0 )
{
entry = connection.getEntryFromCache( initialDN );
if ( entry == null )
{
ReadEntryJob job = new ReadEntryJob( connection, initialDN );