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

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


        {
            IEntry entry = getSelectedBookmarks()[0].getBrowserConnection().getEntryFromCache(
                getSelectedBookmarks()[0].getDn() );
            if ( entry == null )
            {
                ReadEntryRunnable runnable = new ReadEntryRunnable( getSelectedBookmarks()[0].getBrowserConnection(),
                    getSelectedBookmarks()[0].getDn() );
                RunnableContextRunner.execute( runnable, null, true );
                entry = runnable.getReadEntry();
            }
            entryList.add( entry );
        }
        if ( getSelectedSearches().length == 1 )
        {
View Full Code Here


            Dn dn = connectionAndDn.dn;

            IEntry entry = connection.getEntryFromCache( dn );
            if ( entry == null )
            {
                ReadEntryRunnable runnable = new ReadEntryRunnable( connection, dn );
                RunnableContextRunner.execute( runnable, null, true );
                entry = runnable.getReadEntry();
            }

            if ( entry != null )
            {
                String targetId = BrowserView.getId();
View Full Code Here

                } );
                return null;
            }

            // check if selected Dn exists
            ReadEntryRunnable readEntryRunnable = new ReadEntryRunnable( browserConnection, dn );
            RunnableContextRunner.execute( readEntryRunnable, getContainer(), false );
            templateEntry = readEntryRunnable.getReadEntry();
            if ( templateEntry == null )
            {
                getShell().getDisplay().syncExec( new Runnable()
                {
                    public void run()
View Full Code Here

            try
            {
                final Dn dn = parentDn.add( rdn );

                // 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(),
                                    Messages.getString( "NewEntryDnWizardPage.Error" ), //$NON-NLS-1$
                                    NLS
                                        .bind(
                                            Messages.getString( "NewEntryDnWizardPage.ParentDoesNotExist" ), dnBuilderWidget.getParentDn().toString() ) ); //$NON-NLS-1$
                        }
                    } );

                    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(),
                                    Messages.getString( "NewEntryDnWizardPage.Error" ), NLS.bind( Messages.getString( "NewEntryDnWizardPage.EntryAlreadyExists" ), dn.toString() ) ); //$NON-NLS-1$ //$NON-NLS-2$
                        }
                    } );

                    return null;
                }
            }
            catch ( LdapInvalidDnException lide )
            {
                return null;
            }
        }
        else
        {
            try
            {
                final Dn dn = new Dn( 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 ( 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 StudioBrowserJob( new MoveEntriesRunnable( entries, newParentEntry,
                        new SimulateRenameDialogImpl( getShell() ) ) ).execute();
View Full Code Here

        {
            IEntry entry = getSelectedBookmarks()[0].getBrowserConnection().getEntryFromCache(
                getSelectedBookmarks()[0].getDn() );
            if ( entry == null )
            {
                ReadEntryRunnable runnable = new ReadEntryRunnable( getSelectedBookmarks()[0].getBrowserConnection(),
                    getSelectedBookmarks()[0].getDn() );
                RunnableContextRunner.execute( runnable, null, true );
                entry = runnable.getReadEntry();
            }
            entryList.add( entry );
        }
        if ( getSelectedSearches().length == 1 )
        {
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
                    Dn initialDn = dn;

                    if ( useLocalName && suffix != null && suffix.size() > 0 )
                    {
                        if ( initialDn != null && initialDn.size() > 0 )
                        {
                            try
                            {
                                initialDn = initialDn.add( suffix );
                            }
                            catch ( LdapInvalidDnException lide )
                            {
                                // Do nothing
                            }
                        }
                    }

                    // 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(), Messages
View Full Code Here

                } );
                return null;
            }

            // check if selected DN exists
            ReadEntryRunnable readEntryRunnable = new ReadEntryRunnable( browserConnection, dn );
            RunnableContextRunner.execute( readEntryRunnable, getContainer(), false );
            templateEntries[0] = readEntryRunnable.getReadEntry();
            if ( templateEntries[0] == null )
            {
                getShell().getDisplay().syncExec( new Runnable()
                {
                    public void run()
View Full Code Here

        {
            IEntry entry = getSelectedBookmarks()[0].getBrowserConnection().getEntryFromCache(
                getSelectedBookmarks()[0].getDn() );
            if ( entry == null )
            {
                ReadEntryRunnable runnable = new ReadEntryRunnable( getSelectedBookmarks()[0].getBrowserConnection(),
                    getSelectedBookmarks()[0].getDn() );
                RunnableContextRunner.execute( runnable, null, true );
                entry = runnable.getReadEntry();
            }
            entryList.add( entry );
        }
        if ( getSelectedSearches().length == 1 )
        {
View Full Code Here

            LdapDN dn = connectionAndDn.dn;

            IEntry entry = connection.getEntryFromCache( dn );
            if ( entry == null )
            {
                ReadEntryRunnable runnable = new ReadEntryRunnable( connection, dn );
                RunnableContextRunner.execute( runnable, null, true );
                entry = runnable.getReadEntry();
            }

            if ( entry != null )
            {
                String targetId = BrowserView.getId();
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.