Examples of LdifAttrValLine


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

                            Object element = it.next();

                            if ( element instanceof LdifAttrValLine )
                            {
                                // select the value
                                LdifAttrValLine line = ( LdifAttrValLine ) element;
                                for ( int a = 0; a < attributes.length; a++ )
                                {
                                    IAttribute attribute = attributes[a];
                                    if ( attribute.getDescription().equals( line.getUnfoldedAttributeDescription() ) )
                                    {
                                        IValue[] values = attribute.getValues();
                                        for ( int v = 0; v < values.length; v++ )
                                        {
                                            IValue value = values[v];
                                            if ( value.getStringValue().equals( line.getValueAsString() ) )
                                            {
                                                selectionList.add( value );
                                            }
                                        }
                                    }
                                }
                            }
                            else if ( element instanceof List )
                            {
                                // select attribute and all values
                                List list = ( List ) element;
                                if ( !list.isEmpty() && list.get( 0 ) instanceof LdifAttrValLine )
                                {
                                    LdifAttrValLine line = ( LdifAttrValLine ) list.get( 0 );
                                    for ( int a = 0; a < attributes.length; a++ )
                                    {
                                        IAttribute attribute = attributes[a];
                                        if ( attribute.getDescription().equals(
                                            line.getUnfoldedAttributeDescription() ) )
                                        {
                                            selectionList.add( attribute );
                                            selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                        }
                                    }
View Full Code Here

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

            }

            // AttrValLine
            else if ( element instanceof LdifAttrValLine )
            {
                LdifAttrValLine line = ( LdifAttrValLine ) element;
                return Utils.getShortenedString( line.getValueAsString(), 20 );
            }

            else
            {
                return "";
View Full Code Here

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

                    else if ( element instanceof List )
                    {
                        List list = ( List ) element;
                        if ( !list.isEmpty() && list.get( 0 ) instanceof LdifAttrValLine )
                        {
                            LdifAttrValLine line = ( LdifAttrValLine ) list.get( 0 );
                            ldifEditor.selectAndReveal( line.getOffset(), line.getRawAttributeDescription()
                                .length() );
                        }
                    }
                    else if ( element instanceof LdifAttrValLine )
                    {
                        LdifAttrValLine line = ( LdifAttrValLine ) element;
                        ldifEditor.selectAndReveal( line.getOffset() + line.getRawAttributeDescription().length()
                            + line.getRawValueType().length(), line.getRawValue().length() );
                    }
                    else if ( element instanceof LdifModSpec )
                    {
                        LdifModSpec modSpec = ( LdifModSpec ) element;
                        ldifEditor.selectAndReveal( modSpec.getOffset(), modSpec.getModSpecType().getLength() );
View Full Code Here

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

            }

            // AttrValLine
            else if ( element instanceof LdifAttrValLine )
            {
                LdifAttrValLine line = ( LdifAttrValLine ) element;
                return Utils.getShortenedString( line.getValueAsString(), 20 );
            }

            else
            {
                return "";
View Full Code Here

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

                        this.addStyleRange( presentation, offset + dnSpecLength + valueTypeLength, dnLength,
                            DN_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifAttrValLine )
                    {
                        LdifAttrValLine attrValLine = ( LdifAttrValLine ) line;
                        int attributeNameLength = attrValLine.getRawAttributeDescription().length();
                        int valueTypeLength = attrValLine.getRawValueType().length();
                        int valueLength = attrValLine.getRawValue().length();
                        this.addStyleRange( presentation, offset, attributeNameLength, ATTRIBUTE_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + attributeNameLength, valueTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + attributeNameLength + valueTypeLength, valueLength,
                            VALUE_TEXT_ATTRIBUTE );
View Full Code Here

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

        this.setDn( new DN( schemaRecord.getDnLine().getValueAsString() ) );

        LdifAttrValLine[] lines = schemaRecord.getAttrVals();
        for ( int i = 0; i < lines.length; i++ )
        {
            LdifAttrValLine line = lines[i];
            String attributeName = line.getUnfoldedAttributeDescription();
            String value = line.getValueAsString();

            SchemaLexer lexer = new SchemaLexer( new StringReader( value ) );
            SchemaParser parser = new SchemaParser( lexer );

            try
View Full Code Here

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

        for ( int i = 0; i < parts.length; i++ )
        {
            if ( parts[i] instanceof LdifAttrValLine )
            {
                LdifAttrValLine line = ( LdifAttrValLine ) parts[i];
                String attributeName = line.getUnfoldedAttributeDescription();
                Object value = line.getValueAsObject();
                IAttribute attribute = entry.getAttribute( attributeName );
                if ( attribute == null )
                {
                    attribute = new Attribute( entry, attributeName );
                    entry.addAttribute( attribute );
View Full Code Here

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


    public static LdifAttrValLine valueToLdifAttrValLine( IValue value )
    {

        LdifAttrValLine line;
        if ( value.isString() )
        {
            line = LdifAttrValLine.create( value.getAttribute().getDescription(), value.getStringValue() );
        }
        else
View Full Code Here

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

                checkAndParseComment( record );

                // read attr-val lines
                do
                {
                    LdifAttrValLine line = this.getAttrValLine();
                    if ( line != null )
                    {
                        modSpec.addAttrVal( line );

                        // clean line
                        if ( "".equals( line.getRawNewLine() ) )
                        {
                            this.cleanupLine( record );
                        }
                    }
                    else
View Full Code Here

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

            {
                return;
            }

            // check attr-val line
            LdifAttrValLine line = this.getAttrValLine();
            if ( line != null )
            {
                if ( record instanceof LdifContentRecord )
                {
                    ( ( LdifContentRecord ) record ).addAttrVal( line );
                }
                else if ( record instanceof LdifChangeAddRecord )
                {
                    ( ( LdifChangeAddRecord ) record ).addAttrVal( line );
                }

                // clean line
                if ( "".equals( line.getRawNewLine() ) )
                {
                    this.cleanupLine( record );
                }
            }
            else
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.