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

Examples of org.apache.directory.studio.ldapbrowser.core.model.IValue


        for ( int i = 0; i < attributes.length; i++ )
        {
            IValue[] values = attributes[i].getValues();
            for ( int ii = 0; ii < values.length; ii++ )
            {
                IValue value = values[ii];
                if ( value.getRawValue() instanceof LdifPart )
                {
                    mustCreateChangeTypeLine = false;
                }
            }
        }

        // LdifChangeAddRecord record =
        // LdifChangeAddRecord.create(entry.getDn().toString());
        LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( entry.getDn().getUpName() ) );
        if ( mustCreateChangeTypeLine )
        {
            addControls( record, entry );
            record.setChangeType( LdifChangeTypeLine.createAdd() );
        }

        for ( int i = 0; i < attributes.length; i++ )
        {
            String name = attributes[i].getDescription();
            IValue[] values = attributes[i].getValues();
            for ( int ii = 0; ii < values.length; ii++ )
            {
                IValue value = values[ii];
                if ( value.getRawValue() instanceof LdifPart )
                {
                    LdifPart part = ( LdifPart ) value.getRawValue();
                    if ( part instanceof LdifChangeTypeLine )
                    {
                        record.setChangeType( ( LdifChangeTypeLine ) part );
                    }
                    else if ( part instanceof LdifCommentLine )
                    {
                        record.addComment( ( LdifCommentLine ) part );
                    }
                    else if ( part instanceof LdifControlLine )
                    {
                        record.addControl( ( LdifControlLine ) part );
                    }
                }
                else if ( value.isString() )
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
                }
                else
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                }
            }
        }

        record.finish( LdifSepLine.create() );
View Full Code Here


        {
            String name = attributes[i].getDescription();
            IValue[] values = attributes[i].getValues();
            for ( int ii = 0; ii < values.length; ii++ )
            {
                IValue value = values[ii];
                if ( value.getRawValue() instanceof LdifPart )
                {
                    LdifPart part = ( LdifPart ) value.getRawValue();
                    if ( part instanceof LdifCommentLine )
                    {
                        record.addComment( ( LdifCommentLine ) part );
                    }
                }
                else if ( value.isString() )
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
                }
                else
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                }
            }
        }

        record.finish( LdifSepLine.create() );
View Full Code Here

    public static IValue ldifAttrValLineToValue( LdifAttrValLine line, IEntry entry )
    {
        try
        {
            IAttribute attribute = new Attribute( entry, line.getUnfoldedAttributeDescription() );
            IValue value = new Value( attribute, line.getValueAsObject() );
            return value;
        }
        catch ( Exception e )
        {
            return null;
View Full Code Here

                        IAttribute newAttribute = new Attribute( newEntry, attributeToCopy.getDescription() );
                        newEntry.addAttribute( newAttribute );
                        IValue[] valuesToCopy = attributeToCopy.getValues();
                        for ( int j = 0; j < valuesToCopy.length; j++ )
                        {
                            IValue valueToCopy = valuesToCopy[j];
                            IValue newValue = new Value( newAttribute, valueToCopy.getRawValue() );
                            newAttribute.addValue( newValue );
                        }
                    }
                }
View Full Code Here

                        else
                        {
                            return null;
                        }

                        IValue value = null;
                        if ( readIn.available() > 1 && attribute != null )
                        {
                            boolean isString = readIn.readBoolean();
                            int size = readIn.readInt();
                            byte[] val = new byte[size];
View Full Code Here

            && getSelectedAttributeHierarchies()[0].getAttribute().getValueSize() == 1
            && getSelectedSearchResults().length == 1 )
        {
            try
            {
                IValue value = getSelectedAttributeHierarchies()[0].getAttribute().getValues()[0];
                if ( value.isString() && new DN( value.getStringValue() ) != null )
                {
                    return new ConnectionAndDn( value.getAttribute().getEntry().getBrowserConnection(), new DN( value
                        .getStringValue() ) );
                }
            }
            catch ( NameException e )
            {
                // no valid DN
            }
        }

        if ( getSelectedValues().length == 1 && getSelectedAttributes().length == 0 )
        {
            try
            {
                IValue value = getSelectedValues()[0];
                if ( value.isString() && new DN( value.getStringValue() ) != null )
                {
                    return new ConnectionAndDn( value.getAttribute().getEntry().getBrowserConnection(), new DN( value
                        .getStringValue() ) );
                }
            }
            catch ( NameException e )
            {
View Full Code Here

                                    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 );
                                            }
                                        }
                                    }
View Full Code Here

        monitor.beginTask( BrowserCoreMessages.jobs__modify_value_task, 2 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        IValue newValue = new Value( attribute, newRawValue );
        attribute.modifyValue( oldValue, newValue );
        attribute.getEntry().getBrowserConnection().modify( oldValue, newValue, monitor );

        this.event = new ValueModifiedEvent( attribute.getEntry().getBrowserConnection(), attribute.getEntry(), attribute,
            oldValue, newValue );
View Full Code Here

            return false;
        }

        for ( Iterator it = valueList.iterator(); it.hasNext(); )
        {
            IValue value = ( IValue ) it.next();
            if ( value.isEmpty() )
            {
                return false;
            }
        }
View Full Code Here

     */
    public void addEmptyValue()
    {
        try
        {
            IValue emptyValue = new Value( this );
            valueList.add( emptyValue );
            this.attributeModified( new EmptyValueAddedEvent( getEntry().getBrowserConnection(), getEntry(), this, emptyValue ) );
        }
        catch ( ModelModificationException mme )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.IValue

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.