String extensionId = memento.getString( "EXTENSION" ); //$NON-NLS-1$
EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
EntryEditorExtension entryEditorExtension = entryEditorManager.getEntryEditorExtension( extensionId );
if ( "IEntry".equals( type ) ) //$NON-NLS-1$
{
IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
.getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
LdapDN dn = new LdapDN( memento.getString( "DN" ) ); //$NON-NLS-1$
IEntry entry = connection.getEntryFromCache( dn );
super.setInput( new EntryEditorInput( entry, entryEditorExtension ) );
}
else if ( "ISearchResult".equals( type ) ) //$NON-NLS-1$
{
IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
.getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) ); //$NON-NLS-1$
ISearchResult[] searchResults = search.getSearchResults();
LdapDN dn = new LdapDN( memento.getString( "DN" ) ); //$NON-NLS-1$
for ( int i = 0; i < searchResults.length; i++ )
{
if ( dn.equals( searchResults[i].getDn() ) )
{
super.setInput( new EntryEditorInput( searchResults[i], entryEditorExtension ) );
break;
}
}
}
else if ( "IBookmark".equals( type ) ) //$NON-NLS-1$
{
IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
.getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
IBookmark bookmark = connection.getBookmarkManager().getBookmark( memento.getString( "BOOKMARK" ) ); //$NON-NLS-1$
super.setInput( new EntryEditorInput( bookmark, entryEditorExtension ) );
}
}
catch ( InvalidNameException e )
{