Examples of IBrowserConnection


Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    {
        // only if another connection is selected
        if ( connection != viewer.getInput() )
        {

            IBrowserConnection currentConnection = viewer.getInput() instanceof IBrowserConnection ? ( IBrowserConnection ) viewer
                .getInput()
                : null;

            // save expanded elements and selection
            if ( currentConnection != null )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    /**
     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
     */
    public void connectionOpened( Connection connection )
    {
        IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
            .getBrowserConnection( connection );

        // expand viewer
        viewer.refresh( browserConnection );
        viewer.expandToLevel( 2 );

        // expand root DSE to show base entries
        IRootDSE rootDSE = browserConnection.getRootDSE();
        viewer.expandToLevel( rootDSE, 1 );

        // expand base entries, if requested
        if ( view.getConfiguration().getPreferences().isExpandBaseEntries() )
        {
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    /**
     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionClosed(org.apache.directory.studio.connection.core.Connection)
     */
    public void connectionClosed( Connection connection )
    {
        IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
            .getBrowserConnection( connection );

        viewer.collapseAll();
        connectionToExpandedElementsMap.remove( browserConnection );
        connectionToSelectedElementMap.remove( browserConnection );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

        {
            monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_task, new String[]
                { entry.getDn().getUpName() } ) );
            monitor.worked( 1 );

            IBrowserConnection browserConnection = entry.getBrowserConnection();
            if ( browserConnection != null )
            {
                if ( entry instanceof IRootDSE )
                {
                    // special handling for Root DSE
                    InitializeRootDSERunnable.loadRootDSE( browserConnection, monitor );
                    continue;
                }

                if ( pagedSearchControl == null && browserConnection.isPagedSearch() )
                {
                    pagedSearchControl = new StudioPagedResultsControl( browserConnection.getPagedSearchSize(), null,
                        false, browserConnection.isPagedSearchScrollMode() );
                }

                initializeChildren( entry, monitor, pagedSearchControl );
            }
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

            for ( IEditorReference ref : activePage.getEditorReferences() )
            {
                IEntryEditor editor = getEntryEditor( ref );
                if ( editor != null && editor.getEntryEditorInput().getResolvedEntry() != null )
                {
                    IBrowserConnection bc = editor.getEntryEditorInput().getResolvedEntry().getBrowserConnection();
                    if ( connection.equals( bc.getConnection() ) )
                    {
                        editorReferences.add( ref );
                    }
                }
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
        for ( Iterator<IEntry> iterator = entriesToDelete.iterator(); !monitor.isCanceled()
            && !monitor.errorsReported() && iterator.hasNext(); )
        {
            IEntry entryToDelete = iterator.next();
            IBrowserConnection browserConnection = entryToDelete.getBrowserConnection();

            // delete from directory
            int errorStatusSize1 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
            num = optimisticDeleteEntryRecursive( browserConnection, entryToDelete.getDn(), entryToDelete.isReferral(),
                useTreeDeleteControl, num, dummyMonitor, monitor );
            int errorStatusSize2 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$

            if ( !monitor.isCanceled() )
            {
                if ( errorStatusSize1 == errorStatusSize2 )
                {
                    // delete
                    deletedEntriesSet.add( entryToDelete );
                    //entryToDelete.setChildrenInitialized( false );

                    // delete from parent entry
                    entryToDelete.getParententry().setChildrenInitialized( false );
                    entryToDelete.getParententry().deleteChild( entryToDelete );

                    // delete from searches
                    List<ISearch> searches = browserConnection.getSearchManager().getSearches();
                    for ( ISearch search : searches )
                    {
                        if ( search.getSearchResults() != null )
                        {
                            ISearchResult[] searchResults = search.getSearchResults();
                            List<ISearchResult> searchResultList = new ArrayList<ISearchResult>();
                            searchResultList.addAll( Arrays.asList( searchResults ) );
                            for ( Iterator<ISearchResult> it = searchResultList.iterator(); it.hasNext(); )
                            {
                                ISearchResult result = it.next();
                                if ( entryToDelete.equals( result.getEntry() ) )
                                {
                                    it.remove();
                                    searchesToUpdateSet.add( search );
                                }
                            }
                            if ( searchesToUpdateSet.contains( search ) )
                            {
                                search.setSearchResults( searchResultList.toArray( new ISearchResult[searchResultList
                                    .size()] ) );
                            }
                        }
                    }

                    // delete from cache
                    browserConnection.uncacheEntryRecursive( entryToDelete );
                }
            }
            else
            {
                entryToDelete.setChildrenInitialized( false );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    protected void runNotification()
    {
        // don't fire an EntryDeletedEvent for each deleted entry
        // that would cause massive UI updates
        // instead we unset children information and fire a BulkModificationEvent
        IBrowserConnection browserConnection = entriesToDelete.iterator().next().getBrowserConnection();
        EventRegistry.fireEntryUpdated( new BulkModificationEvent( browserConnection ), this );

        for ( ISearch search : searchesToUpdateSet )
        {
            EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search,
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    public String getToolTipText()
    {
        IEntry entry = getResolvedEntry();
        if ( entry != null )
        {
            IBrowserConnection connection = entry.getBrowserConnection();
            if ( connection != null && connection.getConnection() != null )
            {
                return getName() + " - " + connection.getConnection().getName();//$NON-NLS-1$
            }
            else
            {
                return getName();
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

     *
     * @return the delegate, may be null if the delegate doesn't exist.
     */
    protected IEntry getDelegate()
    {
        IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
            .getBrowserConnectionById( connectionId );
        if ( browserConnection == null )
        {
            throw new IllegalStateException( "Connection " + connectionId + " does not exist." );
        }

        // always get the fresh entry from cache
        delegate = browserConnection.getEntryFromCache( dn );

        if ( delegate != null
            && !delegate.getBrowserConnection().getConnection().getJNDIConnectionWrapper().isConnected() )
        {
            entryDoesNotExist = false;
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

        {
            return getDelegate().getBrowserConnection();
        }
        else
        {
            IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
                .getBrowserConnectionById( connectionId );
            if ( browserConnection == null )
            {
                throw new IllegalStateException( "Connection " + connectionId + " does not exist." );
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.