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

Examples of org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable


            if ( newParentDn != null /* && !newRdn.equals(entry.getRdn()) */)
            {
                IEntry newParentEntry = entries[0].getBrowserConnection().getEntryFromCache( newParentDn );
                if ( newParentEntry == null )
                {
                    ReadEntryRunnable runnable = new ReadEntryRunnable( entries[0].getBrowserConnection(), newParentDn );
                    RunnableContextRunner.execute( runnable, null, true );
                    newParentEntry = runnable.getReadEntry();
                }
                if ( newParentEntry != null )
                {
                    new MoveEntriesJob( entries, newParentEntry, new SimulateRenameDialogImpl( getShell() ) ).execute();
                }
View Full Code Here


            Rdn rdn = dnBuilderWidget.getRdn();
            LdapDN parentDn = dnBuilderWidget.getParentDn();
            final LdapDN dn = DnUtils.composeDn( rdn, parentDn );

            // check if parent exists
            ReadEntryRunnable readEntryRunnable1 = new ReadEntryRunnable( wizard.getSelectedConnection(), parentDn );
            RunnableContextRunner.execute( readEntryRunnable1, getContainer(), false );
            IEntry parentEntry = readEntryRunnable1.getReadEntry();
            if ( parentEntry == null )
            {
                getShell().getDisplay().syncExec( new Runnable()
                {
                    public void run()
                    {
                        MessageDialog.openError( getShell(), "Error", "Parent "
                            + dnBuilderWidget.getParentDn().toString() + " doesn't exists" );
                    }
                } );
                return null;
            }

            // check that new entry does not exists yet
            ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
            RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
            IEntry entry = readEntryRunnable2.getReadEntry();
            if ( entry != null )
            {
                getShell().getDisplay().syncExec( new Runnable()
                {
                    public void run()
                    {
                        MessageDialog.openError( getShell(), "Error", "Entry " + dn.toString() + " already exists" );
                    }
                } );
                return null;
            }
        }
        else
        {
            try
            {
                final LdapDN dn = new LdapDN( contextEntryDnCombo.getText() );
               
                // check that new entry does not exists yet
                ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
                RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
                IEntry entry = readEntryRunnable2.getReadEntry();
                if ( entry != null )
                {
                    getShell().getDisplay().syncExec( new Runnable()
                    {
                        public void run()
View Full Code Here

                    if( suffix != null && suffix.size() > 0 )
                    {
                        rootEntry = browserConnection.getEntryFromCache( suffix );
                        if ( rootEntry == null )
                        {
                            ReadEntryRunnable runnable = new ReadEntryRunnable( browserConnection, suffix );
                            RunnableContextRunner.execute( runnable, null, true );
                            rootEntry = runnable.getReadEntry();
                        }
                    }

                    // calculate initial DN
                    LdapDN initialDN = dn;
                    if( suffix != null && suffix.size() > 0 )
                    {
                        if( initialDN != null && initialDN.size() > 0 )
                        {
                            initialDN = DnUtils.composeDn( initialDN, suffix );
                        }
                    }

                    // get initial entry
                    IEntry entry = rootEntry;
                    if ( initialDN != null && initialDN.size() > 0 )
                    {
                        entry = browserConnection.getEntryFromCache( initialDN );
                        if ( entry == null )
                        {
                            ReadEntryRunnable runnable = new ReadEntryRunnable( browserConnection, initialDN );
                            RunnableContextRunner.execute( runnable, null, true );
                            entry = runnable.getReadEntry();
                        }
                    }

                    // open dialog
                    SelectEntryDialog dialog = new SelectEntryDialog( parent.getShell(), "Select DN", rootEntry, entry );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable

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.