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

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


            objectToSelect = bookmark;
        }
        if ( obj instanceof IEntry )
        {
            IEntry entry = ( IEntry ) obj;

            universalListener.setInput( entry.getBrowserConnection() );

            List<IEntry> entryList = new ArrayList<IEntry>();
            IEntry tempEntry = entry;
            while ( tempEntry.getParententry() != null )
            {
                IEntry parentEntry = tempEntry.getParententry();
                entryList.add( 0, tempEntry );
                tempEntry = parentEntry;
            }

            for ( IEntry childEntry : entryList )
            {
                IEntry parentEntry = childEntry.getParententry();
                if ( !parentEntry.isChildrenInitialized() )
                {
                    parentEntry.setChildrenInitialized( true );
                    parentEntry.setHasMoreChildren( true );
                }
                if ( !Arrays.asList( parentEntry.getChildren() ).contains( childEntry ) )
                {
                    parentEntry.addChild( childEntry );
                }

                // force refresh of each parent, beginning from the root
                // if the entry to select was lazy initialized then the
                // JFace model has no knowledge about it so we must
View Full Code Here


                    StructuredSelection selection = ( StructuredSelection ) context.getSelection();
                    Object obj = selection.getFirstElement();
                    if ( obj instanceof IValue )
                    {
                        IValue value = ( IValue ) obj;
                        IEntry entry = value.getAttribute().getEntry();
                        // The entry may be a clone, lookup original entry from entry cache.
                        // The result may be null, in that case the selection won't change.
                        entry =  entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        select( entry );
                    }
                    else if ( obj instanceof IAttribute )
                    {
                        IAttribute attribute = ( IAttribute ) obj;
                        IEntry entry = attribute.getEntry();
                        // The entry may be a clone, lookup original entry from entry cache.
                        // The result may be null, in that case the selection won't change.
                        entry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        select( entry );
                    }
                    else if ( obj instanceof ISearchResult )
                    {
                        ISearchResult sr = ( ISearchResult ) obj;
View Full Code Here

                IEditorPart editor = ( IEditorPart ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    IEntry entry = eei.getResolvedEntry();
                    if ( entry != null )
                    {
                        objectToSelect = entry.getBrowserConnection().getConnection();
                    }
                }
                else if ( input != null && input instanceof SearchResultEditorInput )
                {
                    SearchResultEditorInput srei = ( SearchResultEditorInput ) input;
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void decorate( Object element, IDecoration decoration )
    {
        IEntry entry = null;
        if ( element instanceof ISearchResult )
        {
            entry = ( ( ISearchResult ) element ).getEntry();
            decoration.addOverlay( BrowserUIPlugin.getDefault().getImageDescriptor(
                BrowserUIConstants.IMG_OVR_SEARCHRESULT ), IDecoration.BOTTOM_RIGHT );
        }
        else if ( element instanceof IEntry )
        {
            entry = ( IEntry ) element;
            if ( entry.getChildrenFilter() != null )
            {
                decoration.addOverlay( BrowserUIPlugin.getDefault().getImageDescriptor(
                    BrowserUIConstants.IMG_OVR_FILTERED ), IDecoration.BOTTOM_RIGHT );
            }
        }
View Full Code Here

                    message.append( BrowserCoreConstants.LINE_SEPARATOR );
                    message.append( BrowserCoreConstants.LINE_SEPARATOR );
                }

                // validate if value is allowed
                IEntry entry = value.getAttribute().getEntry();
                Collection<AttributeTypeDescription> allAtds = SchemaUtils.getAllAttributeTypeDescriptions( entry );
                AttributeTypeDescription atd = value.getAttribute().getAttributeTypeDescription();
                if ( !allAtds.contains( atd ) )
                {
                    message.append( NLS.bind( Messages.getString( "OpenBestEditorAction.AttributeNotInSubSchema" ), //$NON-NLS-1$
View Full Code Here

                : scope == SearchScope.ONELEVEL ? SearchControls.ONELEVEL_SCOPE : SearchControls.OBJECT_SCOPE;

            int num = 0;
            for ( int i = 0; !monitor.isCanceled() && i < entriesToCopy.length; i++ )
            {
                IEntry entryToCopy = entriesToCopy[i];

                if ( scope == SearchScope.OBJECT
                    || !parent.getDn().getNormName().endsWith( entryToCopy.getDn().getNormName() ) )
                {
                    dummyMonitor.reset();
                    num = copyEntry( entryToCopy, parent, null, copyScope, num, dialog, dummyMonitor, monitor );
                }
                else
View Full Code Here

                                    targetBrowserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry(
                                        newLdapDn.getUpName(), mis.toArray( new ModificationItem[mis.size()] ), null,
                                        dummyMonitor, null );

                                    // force reloading of attributes
                                    IEntry newEntry = targetBrowserConnection.getEntryFromCache( newLdapDn );
                                    if ( newEntry != null )
                                    {
                                        newEntry.setAttributesInitialized( false );
                                    }

                                    break;

                                case RENAME_AND_CONTINUE:
View Full Code Here

     */
    public void openEntryEditor( EntryEditorExtension extension, IEntry[] entries, ISearchResult[] searchResults,
        IBookmark[] bookmarks )
    {
        EntryEditorInput input = null;
        IEntry entry;
        if ( entries.length == 1 )
        {
            input = new EntryEditorInput( entries[0], extension );
            entry = entries[0];
        }
        else if ( searchResults.length == 1 )
        {
            input = new EntryEditorInput( searchResults[0], extension );
            entry = searchResults[0].getEntry();
        }
        else if ( bookmarks.length == 1 )
        {
            input = new EntryEditorInput( bookmarks[0], extension );
            entry = bookmarks[0].getEntry();
            if ( entry.getBrowserConnection().getEntryFromCache( entry.getDn() ) == null )
            {
                EntryEditorUtils.ensureAttributesInitialized( entry );
            }
        }
        else
View Full Code Here

     *      an arrays of bookmarks
     */
    public void openEntryEditor( IEntry[] entries, ISearchResult[] searchResults, IBookmark[] bookmarks )
    {
        // Looking for the entry to test the editor on
        IEntry entry = null;
        if ( entries.length == 1 )
        {
            entry = entries[0];
        }
        else if ( searchResults.length == 1 )
View Full Code Here

    }


    private void updateOscSharedReferenceCopy( IEntry entry )
    {
        IEntry referenceCopy = oscSharedReferenceCopies.remove( entry );
        if ( referenceCopy != null )
        {
            EntryEditorUtils.ensureAttributesInitialized( entry );
            EventRegistry.suspendEventFiringInCurrentThread();
            new CompoundModification().replaceAttributes( entry, referenceCopy, this );
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.