Package org.apache.directory.studio.ldapbrowser.core.model

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


        {
            return false;
        }
        else
        {
            IEntry referenceCopy = oscSharedReferenceCopies.get( originalEntry );
            IEntry workingCopy = oscSharedWorkingCopies.get( originalEntry );
            if ( referenceCopy != null && workingCopy != null )
            {
                LdifFile diff = Utils.computeDiff( referenceCopy, workingCopy );
                return diff != null;
            }
View Full Code Here


    IStatus saveSharedWorkingCopy( IEntry originalEntry, boolean handleError, IEntryEditor editor )
    {
        if ( editor == null || !editor.isAutoSave() )
        {
            IEntry referenceCopy = oscSharedReferenceCopies.get( originalEntry );
            IEntry workingCopy = oscSharedWorkingCopies.get( originalEntry );
            if ( referenceCopy != null && workingCopy != null )
            {
                // consistency check: don't save if there is an empty value, throw an exception as the user pressed 'save'
                for ( IAttribute attribute : workingCopy.getAttributes() )
                {
                    for ( IValue value : attribute.getValues() )
                    {
                        if ( value.isEmpty() )
                        {
View Full Code Here

    void resetSharedWorkingCopy( IEntry originalEntry, IEntryEditor editor )
    {
        if ( editor == null || !editor.isAutoSave() )
        {
            IEntry referenceCopy = oscSharedReferenceCopies.get( originalEntry );
            IEntry workingCopy = oscSharedWorkingCopies.get( originalEntry );
            if ( referenceCopy != null && workingCopy != null )
            {
                updateOscSharedReferenceCopy( originalEntry );
                updateOscSharedWorkingCopy( originalEntry );
            }
View Full Code Here

            if ( editor != null )
            {
                EntryEditorInput input = editor.getEntryEditorInput();
                if ( input != null && input.getResolvedEntry() != null )
                {
                    IEntry entry = input.getResolvedEntry();
                    if ( editor.isAutoSave() )
                    {
                        autoSaveEntries.add( entry );
                    }
                    else
                    {
                        oscEntries.add( entry );
                    }
                }
            }
        }
        for ( Iterator<IEntry> it = oscSharedReferenceCopies.keySet().iterator(); it.hasNext(); )
        {
            IEntry entry = it.next();
            if ( !oscEntries.contains( entry ) )
            {
                it.remove();
                oscSharedWorkingCopies.remove( entry );
            }
        }
        for ( Iterator<IEntry> it = oscSharedWorkingCopies.keySet().iterator(); it.hasNext(); )
        {
            IEntry entry = it.next();
            if ( !oscEntries.contains( entry ) )
            {
                it.remove();
            }
        }
        for ( Iterator<IEntry> it = autoSaveSharedReferenceCopies.keySet().iterator(); it.hasNext(); )
        {
            IEntry entry = it.next();
            if ( !autoSaveEntries.contains( entry ) )
            {
                it.remove();
            }
        }
        for ( Iterator<IEntry> it = autoSaveSharedWorkingCopies.keySet().iterator(); it.hasNext(); )
        {
            IEntry entry = it.next();
            if ( !autoSaveEntries.contains( entry ) )
            {
                it.remove();
            }
        }
View Full Code Here

            // entry -> entry wrapper
            // the entry is the input and is not visible,
            // so we use an wrapper around to make it visible as root element
            if ( element instanceof IEntry )
            {
                IEntry entry = ( IEntry ) element;
                return new EntryWrapper[]
                    { new EntryWrapper( entry ) };
            }

            // entry wrapper -> attribute
View Full Code Here

     */
    public String getText()
    {
        List<IEntry> entries = getEntries();
        ISearch[] searches = getSearches();
        IEntry entryInput = getEntryInput();
        ISearch searchInput = getSearchInput();

        if ( entries.size() > 0 && searches.length == 0 && entryInput == null && searchInput == null )
        {
            return entries.size() == 1 ? Messages.getString( "RefreshAction.ReloadEntry" ) : Messages.getString( "RefreshAction.ReloadEntries" ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

     */
    public void run()
    {
        List<IEntry> entries = getEntries();
        ISearch[] searches = getSearches();
        IEntry entryInput = getEntryInput();
        ISearch searchInput = getSearchInput();

        if ( entries.size() > 0 )
        {
            for ( IEntry entry : entries )
            {
                if ( entry instanceof IContinuation )
                {
                    IContinuation continuation = ( IContinuation ) entry;
                    if ( continuation.getState() != State.RESOLVED )
                    {
                        continuation.resolve();
                    }
                }
            }
            InitializeChildrenRunnable initializeChildrenRunnable = new InitializeChildrenRunnable( true, entries
                .toArray( new IEntry[0] ) );
            new StudioBrowserJob( initializeChildrenRunnable ).execute();
        }
        if ( searches.length > 0 )
        {
            for ( ISearch search : searches )
            {
                search.setSearchResults( null );
                if ( search instanceof IContinuation )
                {
                    IContinuation continuation = ( IContinuation ) search;
                    if ( continuation.getState() != State.RESOLVED )
                    {
                        continuation.resolve();
                    }
                }
            }
            new StudioBrowserJob( new SearchRunnable( searches ) ).execute();
        }

        if ( entryInput != null )
        {
            // the entry input is usually a cloned entry, lookup the real entry from connection
            IEntry entry = entryInput.getBrowserConnection().getEntryFromCache( entryInput.getDn() );
            new StudioBrowserJob( new InitializeAttributesRunnable( entry ) ).execute();
        }
        if ( searchInput != null )
        {
            searchInput.setSearchResults( null );
View Full Code Here

     */
    public boolean isEnabled()
    {
        List<IEntry> entries = getEntries();
        ISearch[] searches = getSearches();
        IEntry entryInput = getEntryInput();
        ISearch searchInput = getSearchInput();

        return entries.size() > 0 || searches.length > 0 || entryInput != null || searchInput != null;
    }
View Full Code Here

                for ( IValue oldValue : oldValues )
                {
                    if ( !newAttributeDescription.equals( oldValue.getAttribute().getDescription() ) )
                    {
                        IAttribute oldAttribute = oldValue.getAttribute();
                        IEntry entry = oldAttribute.getEntry();
                        IValue newValue = null;

                        // delete old value
                        oldAttribute.deleteValue( oldValue );
                        if ( oldAttribute.getValueSize() == 0 )
                        {
                            entry.deleteAttribute( oldAttribute );
                        }

                        // add new value
                        IAttribute attribute = entry.getAttribute( newAttributeDescription );
                        if ( attribute == null )
                        {
                            attribute = new Attribute( entry, newAttributeDescription );
                            entry.addAttribute( attribute );
                        }
                        newValue = new Value( attribute, oldValue.getRawValue() );
                        attribute.addValue( newValue );

                        // prepare event
                        if ( event == null )
                        {
                            event = new ValueRenamedEvent( entry.getBrowserConnection(), entry, oldValue, newValue );
                        }
                    }
                }
            }
            finally
View Full Code Here

                        LdapURL searchContinuationUrl = sr.getSearchContinuationUrl();

                        if ( searchContinuationUrl == null )
                        {
                            LdapDN dn = JNDIUtils.getDn( sr );
                            IEntry entry = null;

                            Connection resultConnection = sr.getConnection();
                            IBrowserConnection resultBrowserConnection = BrowserCorePlugin.getDefault()
                                .getConnectionManager().getBrowserConnection( resultConnection );
                            if ( resultBrowserConnection == null )
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.IEntry

Copyright © 2018 www.massapicom. 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.