plugins/combinededitor/src/main/java/org/apache/directory/studio/combinededitor/editor/CombinedEntryEditorNavigationLocation.java [67:187]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super( editor );
    }


    /**
     * {@inheritDoc}
     */
    public String getText()
    {
        String text = EntryEditorUtils.getHistoryNavigationText( getEntryEditorInput() );
        return text != null ? text : super.getText();
    }


    /**
     * {@inheritDoc}
     */
    public void saveState( IMemento memento )
    {
        EntryEditorInput eei = getEntryEditorInput();
        if ( eei != null )
        {
            memento.putString( EXTENSION_TAG, eei.getExtension().getId() );
            if ( eei.getEntryInput() != null )
            {
                IEntry entry = eei.getEntryInput();
                memento.putString( TYPE_TAG, TYPE_ENTRY_VALUE );
                memento.putString( DN_TAG, entry.getDn().getName() );
                memento.putString( CONNECTION_TAG, entry.getBrowserConnection().getConnection().getId() );
            }
            else if ( eei.getSearchResultInput() != null )
            {
                ISearchResult searchResult = eei.getSearchResultInput();
                memento.putString( TYPE_TAG, TYPE_SEARCHRESULT_VALUE );
                memento.putString( DN_TAG, searchResult.getDn().getName() );
                memento.putString( SEARCH_TAG, searchResult.getSearch().getName() );
                memento.putString( CONNECTION_TAG, searchResult.getSearch().getBrowserConnection().getConnection()
                    .getId() );
            }
            else if ( eei.getBookmarkInput() != null )
            {
                IBookmark bookmark = eei.getBookmarkInput();
                memento.putString( TYPE_TAG, TYPE_BOOKMARK_VALUE );
                memento.putString( BOOKMARK_TAG, bookmark.getName() );
                memento.putString( CONNECTION_TAG, bookmark.getBrowserConnection().getConnection().getId() );
            }
        }
    }


    /**
     * {@inheritDoc}
     */
    public void restoreState( IMemento memento )
    {
        try
        {
            String type = memento.getString( TYPE_TAG );
            String extensionId = memento.getString( EXTENSION_TAG );
            EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
            EntryEditorExtension entryEditorExtension = entryEditorManager.getEntryEditorExtension( extensionId );
            if ( TYPE_ENTRY_VALUE.equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( CONNECTION_TAG ) );
                Dn dn = new Dn( memento.getString( DN_TAG ) );
                IEntry entry = connection.getEntryFromCache( dn );
                super.setInput( new EntryEditorInput( entry, entryEditorExtension ) );
            }
            else if ( TYPE_SEARCHRESULT_VALUE.equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( CONNECTION_TAG ) );
                ISearch search = connection.getSearchManager().getSearch( memento.getString( SEARCH_TAG ) );
                ISearchResult[] searchResults = search.getSearchResults();
                Dn dn = new Dn( memento.getString( DN_TAG ) );
                for ( int i = 0; i < searchResults.length; i++ )
                {
                    if ( dn.equals( searchResults[i].getDn() ) )
                    {
                        super.setInput( new EntryEditorInput( searchResults[i], entryEditorExtension ) );
                        break;
                    }
                }
            }
            else if ( TYPE_BOOKMARK_VALUE.equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( CONNECTION_TAG ) );
                IBookmark bookmark = connection.getBookmarkManager().getBookmark( memento.getString( BOOKMARK_TAG ) );
                super.setInput( new EntryEditorInput( bookmark, entryEditorExtension ) );
            }
        }
        catch ( LdapInvalidDnException e )
        {
            e.printStackTrace();
        }
    }


    /**
     * {@inheritDoc}
     */
    public void restoreLocation()
    {
    }


    /**
     * {@inheritDoc}
     */
    public boolean mergeInto( INavigationLocation currentLocation )
    {
        if ( currentLocation == null )
        {
            return false;
        }

        if ( getClass() != currentLocation.getClass() )
        {
            return false;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/editor/TemplateEntryEditorNavigationLocation.java [67:187]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super( editor );
    }


    /**
     * {@inheritDoc}
     */
    public String getText()
    {
        String text = EntryEditorUtils.getHistoryNavigationText( getEntryEditorInput() );
        return text != null ? text : super.getText();
    }


    /**
     * {@inheritDoc}
     */
    public void saveState( IMemento memento )
    {
        EntryEditorInput eei = getEntryEditorInput();
        if ( eei != null )
        {
            memento.putString( EXTENSION_TAG, eei.getExtension().getId() );
            if ( eei.getEntryInput() != null )
            {
                IEntry entry = eei.getEntryInput();
                memento.putString( TYPE_TAG, TYPE_ENTRY_VALUE );
                memento.putString( DN_TAG, entry.getDn().getName() );
                memento.putString( CONNECTION_TAG, entry.getBrowserConnection().getConnection().getId() );
            }
            else if ( eei.getSearchResultInput() != null )
            {
                ISearchResult searchResult = eei.getSearchResultInput();
                memento.putString( TYPE_TAG, TYPE_SEARCHRESULT_VALUE );
                memento.putString( DN_TAG, searchResult.getDn().getName() );
                memento.putString( SEARCH_TAG, searchResult.getSearch().getName() );
                memento.putString( CONNECTION_TAG, searchResult.getSearch().getBrowserConnection().getConnection()
                    .getId() );
            }
            else if ( eei.getBookmarkInput() != null )
            {
                IBookmark bookmark = eei.getBookmarkInput();
                memento.putString( TYPE_TAG, TYPE_BOOKMARK_VALUE );
                memento.putString( BOOKMARK_TAG, bookmark.getName() );
                memento.putString( CONNECTION_TAG, bookmark.getBrowserConnection().getConnection().getId() );
            }
        }
    }


    /**
     * {@inheritDoc}
     */
    public void restoreState( IMemento memento )
    {
        try
        {
            String type = memento.getString( TYPE_TAG );
            String extensionId = memento.getString( EXTENSION_TAG );
            EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
            EntryEditorExtension entryEditorExtension = entryEditorManager.getEntryEditorExtension( extensionId );
            if ( TYPE_ENTRY_VALUE.equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( CONNECTION_TAG ) );
                Dn dn = new Dn( memento.getString( DN_TAG ) );
                IEntry entry = connection.getEntryFromCache( dn );
                super.setInput( new EntryEditorInput( entry, entryEditorExtension ) );
            }
            else if ( TYPE_SEARCHRESULT_VALUE.equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( CONNECTION_TAG ) );
                ISearch search = connection.getSearchManager().getSearch( memento.getString( SEARCH_TAG ) );
                ISearchResult[] searchResults = search.getSearchResults();
                Dn dn = new Dn( memento.getString( DN_TAG ) );
                for ( int i = 0; i < searchResults.length; i++ )
                {
                    if ( dn.equals( searchResults[i].getDn() ) )
                    {
                        super.setInput( new EntryEditorInput( searchResults[i], entryEditorExtension ) );
                        break;
                    }
                }
            }
            else if ( TYPE_BOOKMARK_VALUE.equals( type ) )
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( CONNECTION_TAG ) );
                IBookmark bookmark = connection.getBookmarkManager().getBookmark( memento.getString( BOOKMARK_TAG ) );
                super.setInput( new EntryEditorInput( bookmark, entryEditorExtension ) );
            }
        }
        catch ( LdapInvalidDnException e )
        {
            e.printStackTrace();
        }
    }


    /**
     * {@inheritDoc}
     */
    public void restoreLocation()
    {
    }


    /**
     * {@inheritDoc}
     */
    public boolean mergeInto( INavigationLocation currentLocation )
    {
        if ( currentLocation == null )
        {
            return false;
        }

        if ( getClass() != currentLocation.getClass() )
        {
            return false;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



