Package org.apache.directory.studio.ldifparser.model.lines

Examples of org.apache.directory.studio.ldifparser.model.lines.LdifDnLine


            if ( dnToken != null )
            {
                dnSepToken = this.scanner.matchSep();
            }
        }
        LdifDnLine dnLine = new LdifDnLine( dnSpecToken.getOffset(), getValueOrNull( dnSpecToken ),
            getValueOrNull( dnValueTypeToken ), getValueOrNull( dnToken ), getValueOrNull( dnSepToken ) );
        LdifToken dnErrorToken = null;
        if ( dnSepToken == null )
        {
            dnErrorToken = this.scanner.matchCleanupLine();
View Full Code Here


    }


    public static LdifDnLine dnToLdifDnLine( Dn dn )
    {
        LdifDnLine line = LdifDnLine.create( dn.getName() );
        return line;
    }
View Full Code Here

        LdifContainer[] selectedLdifContainers = getSelectedLdifContainers();
        String dn = null;
        if ( selectedLdifContainers.length == 1 && selectedLdifContainers[0] instanceof LdifRecord )
        {
            LdifRecord record = ( LdifRecord ) selectedLdifContainers[0];
            LdifDnLine dnLine = record.getDnLine();
            dn = dnLine.getValueAsString();
        }
        return dn;
    }
View Full Code Here

            {
                if ( isLinkedToLdapBrowser )
                {
                    LdifContentRecord record = ( LdifContentRecord ) element;

                    LdifDnLine dnLine = record.getDnLine();
                    if ( dnLine != null )
                    {
                        String dn = dnLine.getUnfoldedDn();
                        if ( dn != null && "".equals( dn ) ) //$NON-NLS-1$
                        {
                            // Root DSE
                            return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_ENTRY_ROOT );
                        }
View Full Code Here

                LdifContainer container = enumeration.next();

                if ( container instanceof LdifContentRecord )
                {
                    LdifContentRecord record = ( LdifContentRecord ) container;
                    LdifDnLine dnLine = record.getDnLine();
                    LdifAttrValLine[] attrValLines = record.getAttrVals();
                    LdifSepLine sepLine = record.getSepLine();

                    // sort and format
                    DummyEntry entry = ModelConverter.ldifContentRecordToEntry( record, browserConnection );
View Full Code Here

                    {
                        this.addStyleRange( presentation, offset, line.getLength(), COMMENT_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifDnLine )
                    {
                        LdifDnLine dnLine = ( LdifDnLine ) line;
                        int dnSpecLength = dnLine.getRawDnSpec().length();
                        int valueTypeLength = dnLine.getRawValueType().length();
                        int dnLength = dnLine.getRawDn().length();
                        this.addStyleRange( presentation, offset, dnSpecLength, DN_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + dnSpecLength, valueTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + dnSpecLength + valueTypeLength, dnLength,
                            DN_TEXT_ATTRIBUTE );
View Full Code Here

        LdifContainer[] selectedLdifContainers = getSelectedLdifContainers();
        String dn = null;
        if ( selectedLdifContainers.length == 1 && selectedLdifContainers[0] instanceof LdifRecord )
        {
            LdifRecord record = ( LdifRecord ) selectedLdifContainers[0];
            LdifDnLine dnLine = record.getDnLine();
            dn = dnLine.getUnfoldedDn();

        }
        return dn;
    }
View Full Code Here

                LdifContainer container = enumeration.next();

                if ( container instanceof LdifContentRecord )
                {
                    LdifContentRecord record = ( LdifContentRecord ) container;
                    LdifDnLine dnLine = record.getDnLine();
                    LdifAttrValLine[] attrValLines = record.getAttrVals();
                    LdifSepLine sepLine = record.getSepLine();

                    // sort and format
                    Arrays.sort( attrValLines, comparator );
View Full Code Here

    }


    public String getInvalidString()
    {
        LdifDnLine dnLine = getDnLine();
        LdifSepLine sepLine = getSepLine();

        if ( dnLine == null )
            return "Record must start with DN";
        else if ( !dnLine.isValid() )
            return dnLine.getInvalidString();

        if ( sepLine == null )
            return "Record must end with an empty line";
        else if ( !sepLine.isValid() )
            return sepLine.getInvalidString();
View Full Code Here

    }


    public static LdifDnLine dnToLdifDnLine( LdapDN dn )
    {
        LdifDnLine line = LdifDnLine.create( dn.getUpName() );
        return line;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldifparser.model.lines.LdifDnLine

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.