Package org.apache.directory.ldapstudio.browser.core.model

Examples of org.apache.directory.ldapstudio.browser.core.model.RDN


     * @return a negative integer, zero, or a positive integer
     */
    private int compareRdnValues( IEntry entry1, IEntry entry2 )
    {

        RDN rdn1 = entry1.getRdn();
        RDN rdn2 = entry2.getRdn();

        if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
            && ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
        {
            return equal();
        }
        else if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
            && !( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
        {
            return greaterThan();
        }
        else if ( !( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
            && ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
        {
            return lessThan();
        }

        else if ( rdn1.getValue().matches( "\\d*" ) && !rdn2.getValue().matches( "\\d*" ) )
        {
            // return lessThan();
            return compare( rdn1.getValue(), rdn2.getValue() );
        }
        else if ( !rdn1.getValue().matches( "\\d*" ) && rdn2.getValue().matches( "\\d*" ) )
        {
            // return greaterThan();
            return compare( rdn1.getValue(), rdn2.getValue() );
        }
        else if ( rdn1.getValue().matches( "\\d*" ) && rdn2.getValue().matches( "\\d*" ) )
        {
            BigInteger bi1 = new BigInteger( rdn1.getValue() );
            BigInteger bi2 = new BigInteger( rdn2.getValue() );
            return compare( bi1, bi2 );
            // return Integer.parseInt(rdn1.getValue()) -
            // Integer.parseInt(rdn2.getValue());
        }
        else
        {
            return compare( rdn1.getValue(), rdn2.getValue() );
        }
    }
View Full Code Here


        {
            return BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
        }
        else
        {
            RDN rdn = entry.getRdn();
            RDNPart[] rdnParts = rdn.getParts();
            for ( int i = 0; i < rdnParts.length; i++ )
            {
                RDNPart part = rdnParts[i];
                if ( "cn".equals( part.getType() ) || "sn".equals( part.getType() ) || "uid".equals( part.getType() )
                    || "userid".equals( part.getType() ) )
View Full Code Here

                    else
                    {
                        rdnLine.rdnDeleteButton.setEnabled( false );
                    }
                }
                this.rdn = new RDN( rdnNames, rdnValues, false );
            }
            catch ( Exception e )
            {
                rdnE = e;
                this.rdn = null;
View Full Code Here

        else if ( wizard.getSelectedEntry() != null )
        {
            parentDn = wizard.getSelectedEntry().getDn();
        }

        RDN rdn = newEntry.getRdn();

        this.dnBuilderWidget.setInput( wizard.getSelectedConnection(), attributeNames, rdn, parentDn );
    }
View Full Code Here


    private int compareRdns( IEntry entry1, IEntry entry2 )
    {

        RDN rdn1 = entry1.getRdn();
        RDN rdn2 = entry2.getRdn();

        if ( rdn1 == null && rdn2 == null )
        {
            return equal();
        }
        else if ( rdn1 == null && rdn2 != null )
        {
            return greaterThan();
        }
        else if ( rdn1 != null && rdn2 == null )
        {
            return lessThan();
        }
        else
        {
            return compare( rdn1.toString(), rdn2.toString() );
        }
    }
View Full Code Here


    private int compareRdnValues( IEntry entry1, IEntry entry2 )
    {

        RDN rdn1 = entry1.getRdn();
        RDN rdn2 = entry2.getRdn();

        if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
            && ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
        {
            return equal();
        }
        else if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
            && !( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
        {
            return greaterThan();
        }
        else if ( !( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
            && ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
        {
            return lessThan();
        }

        else if ( rdn1.getValue().matches( "\\d*" ) && !rdn2.getValue().matches( "\\d*" ) )
        {
            // return lessThan();
            return compare( rdn1.getValue(), rdn2.getValue() );
        }
        else if ( !rdn1.getValue().matches( "\\d*" ) && rdn2.getValue().matches( "\\d*" ) )
        {
            // return greaterThan();
            return compare( rdn1.getValue(), rdn2.getValue() );
        }
        else if ( rdn1.getValue().matches( "\\d*" ) && rdn2.getValue().matches( "\\d*" ) )
        {
            BigInteger bi1 = new BigInteger( rdn1.getValue() );
            BigInteger bi2 = new BigInteger( rdn2.getValue() );
            return compare( bi1, bi2 );
            // return Integer.parseInt(rdn1.getValue()) -
            // Integer.parseInt(rdn2.getValue());
        }
        else
        {
            return compare( rdn1.getValue(), rdn2.getValue() );
        }
    }
View Full Code Here

            return BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
        }
        else
        {

            RDN rdn = entry.getRdn();
            RDNPart[] rdnParts = rdn.getParts();
            for ( int i = 0; i < rdnParts.length; i++ )
            {
                RDNPart part = rdnParts[i];
                if ( "cn".equals( part.getType() ) || "sn".equals( part.getType() ) || "uid".equals( part.getType() )
                    || "userid".equals( part.getType() ) )
View Full Code Here

        else if ( wizard.getSelectedEntry() != null )
        {
            parentDn = wizard.getSelectedEntry().getDn();
        }

        RDN rdn = newEntry.getRdn();

        dnBuilderWidget.setInput( wizard.getSelectedConnection(), attributeNames, rdn, parentDn );
    }
View Full Code Here

                    else
                    {
                        rdnLine.rdnDeleteButton.setEnabled( false );
                    }
                }
                rdn = new RDN( rdnNames, rdnValues, false );
            }
            catch ( Exception e )
            {
                rdnE = e;
                rdn = null;
View Full Code Here

    protected void renameEntry( final IEntry entry )
    {
        RenameEntryDialog renameDialog = new RenameEntryDialog( getShell(), entry );
        if ( renameDialog.open() == Dialog.OK )
        {
            RDN newRdn = renameDialog.getRdn();
            boolean deleteOldRdn = renameDialog.isDeleteOldRdn();
            if ( newRdn != null && !newRdn.equals( entry.getRdn() ) )
            {
                new RenameEntryJob( entry, newRdn, deleteOldRdn ).execute();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.RDN

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.