Examples of LdifControlLine


Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

                    IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );

                    LdifValueLineBase newLine;
                    if ( line instanceof LdifControlLine )
                    {
                        LdifControlLine oldControlLine = ( LdifControlLine ) line;
                        if ( newValue instanceof String )
                        {
                            newLine = LdifControlLine.create( oldControlLine.getUnfoldedOid(), oldControlLine
                                .getUnfoldedCriticality(), ( String ) newValue );
                        }
                        else
                        {
                            newLine = LdifControlLine.create( oldControlLine.getUnfoldedOid(), oldControlLine
                                .getUnfoldedCriticality(), ( byte[] ) newValue );
                        }
                    }
                    else
                    {
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

                    {
                        this.addStyleRange( presentation, offset, line.getLength(), VALUETYPE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifControlLine )
                    {
                        LdifControlLine controlLine = ( LdifControlLine ) line;
                        int controlSpecLength = controlLine.getRawControlSpec().length();
                        int controlTypeLength = controlLine.getRawControlType().length();
                        int oidLength = controlLine.getRawOid().length();
                        int critLength = controlLine.getRawCriticality().length();
                        int valueTypeLength = controlLine.getRawControlValueType().length();
                        int valueLength = controlLine.getRawControlValue().length();
                        this.addStyleRange( presentation, offset, controlSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + controlSpecLength, controlTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + controlSpecLength + controlTypeLength, oidLength,
                            ATTRIBUTE_TEXT_ATTRIBUTE );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

            LdifChangeRecord changeRecord = ( LdifChangeRecord ) record;
            LdifControlLine[] controlLines = changeRecord.getControls();
            controls = new Control[controlLines.length];
            for ( int i = 0; i < controlLines.length; i++ )
            {
                LdifControlLine line = controlLines[i];
                // TODO: encoded control value
                controls[i] = new JNDIControl( line.getUnfoldedOid(), line.isCritical(), null );
            }
        }
        return controls;
    }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

        // save comment lines after dns
        LdifCommentLine[] commentLines = getCommentLines();

        // check record type: to decide the record type we need the next token
        // first check keywords 'control' and 'changetype'
        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

                    }
                    sepToken = this.scanner.matchSep();
                }
            }

            LdifControlLine controlLine = new LdifControlLine( controlSpecToken.getOffset(),
                getValueOrNull( controlSpecToken ), getValueOrNull( controlTypeToken ), getValueOrNull( oidToken ),
                getValueOrNull( criticalityToken ), getValueOrNull( valueTypeToken ), getValueOrNull( valueToken ),
                getValueOrNull( sepToken ) );

            return controlLine;
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

        if ( oid == null )
        {
            return "";
        }

        LdifControlLine line = LdifControlLine.create( getOid(), isCritical() ? " true" : " false", getControlValue() );
        String s = line.toRawString();
        s = s.substring( line.getRawControlSpec().length(), s.length() );
        s = s.substring( line.getRawControlType().length(), s.length() );
        s = s.substring( 0, s.length() - line.getRawNewLine().length() );

        // System.out.println(s);

        return s;
    }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

                    {
                        this.addStyleRange( presentation, offset, line.getLength(), VALUETYPE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifControlLine )
                    {
                        LdifControlLine controlLine = ( LdifControlLine ) line;
                        int controlSpecLength = controlLine.getRawControlSpec().length();
                        int controlTypeLength = controlLine.getRawControlType().length();
                        int oidLength = controlLine.getRawOid().length();
                        int critLength = controlLine.getRawCriticality().length();
                        int valueTypeLength = controlLine.getRawControlValueType().length();
                        int valueLength = controlLine.getRawControlValue().length();
                        this.addStyleRange( presentation, offset, controlSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + controlSpecLength, controlTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + controlSpecLength + controlTypeLength, oidLength,
                            ATTRIBUTE_TEXT_ATTRIBUTE );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifControlLine

                    IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );

                    LdifValueLineBase newLine;
                    if ( line instanceof LdifControlLine )
                    {
                        LdifControlLine oldControlLine = ( LdifControlLine ) line;
                        if ( newValue instanceof String )
                        {
                            newLine = LdifControlLine.create( oldControlLine.getUnfoldedOid(), oldControlLine
                                .getUnfoldedCriticality(), ( String ) newValue );
                        }
                        else
                        {
                            newLine = LdifControlLine.create( oldControlLine.getUnfoldedOid(), oldControlLine
                                .getUnfoldedCriticality(), ( byte[] ) newValue );
                        }
                    }
                    else
                    {
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifControlLine

        if ( oid == null )
        {
            return "";
        }

        LdifControlLine line = LdifControlLine.create( getOid(), isCritical() ? " true" : " false", getControlValue() );
        String s = line.toRawString();
        s = s.substring( line.getRawControlSpec().length(), s.length() );
        s = s.substring( line.getRawControlType().length(), s.length() );
        s = s.substring( 0, s.length() - line.getRawNewLine().length() );

        // System.out.println(s);

        return s;
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifControlLine

                    {
                        this.addStyleRange( presentation, offset, line.getLength(), VALUETYPE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifControlLine )
                    {
                        LdifControlLine controlLine = ( LdifControlLine ) line;
                        int controlSpecLength = controlLine.getRawControlSpec().length();
                        int controlTypeLength = controlLine.getRawControlType().length();
                        int oidLength = controlLine.getRawOid().length();
                        int critLength = controlLine.getRawCriticality().length();
                        int valueTypeLength = controlLine.getRawControlValueType().length();
                        int valueLength = controlLine.getRawControlValue().length();
                        this.addStyleRange( presentation, offset, controlSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + controlSpecLength, controlTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + controlSpecLength + controlTypeLength, oidLength,
                            ATTRIBUTE_TEXT_ATTRIBUTE );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.