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

Examples of org.apache.directory.ldapstudio.browser.core.model.IValue$EmptyValue


    }


    private static IValue getValue( Object element )
    {
        IValue value = null;
        if ( element instanceof IAdaptable )
        {
            value = ( IValue ) ( ( IAdaptable ) element ).getAdapter( IValue.class );
        }
        return value;
View Full Code Here


        {
            IAttribute attribute = ( IAttribute ) it.next();
            IValue[] values = attribute.getValues();
            for ( int i = 0; i < values.length; i++ )
            {
                IValue value = values[i];
                if ( value.isEmpty() )
                {
                    this.mainWidget.getViewer().setSelection( new StructuredSelection( value ), true );
                    if ( this.actionGroup.getOpenDefaultEditorAction().isEnabled() )
                    {
                        this.actionGroup.getOpenDefaultEditorAction().run();
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

                            it.remove();
                        }
                    }
                    for ( Iterator it = valueList.iterator(); it.hasNext(); )
                    {
                        IValue value = ( IValue ) it.next();
                        if ( value.isEmpty() )
                        {
                            value.getAttribute().deleteEmptyValue();
                            it.remove();
                        }
                    }

                    if ( !attributeList.isEmpty() || !valueList.isEmpty() )
View Full Code Here

                            filterSet.add( LdapFilterUtils.getFilter( values[v] ) );
                        }
                    }
                    else if ( object instanceof IValue )
                    {
                        IValue value = ( IValue ) object;
                        entry = value.getAttribute().getEntry();
                        filterSet.add( LdapFilterUtils.getFilter( value ) );
                    }
                }

                exampleSearch.setConnection( entry.getConnection() );
View Full Code Here

        // check argument
        if ( o == null || !( o instanceof IValue ) )
        {
            return false;
        }
        IValue vc = ( IValue ) o;

        // compare attributes
        if ( !vc.getAttribute().equals( this.getAttribute() ) )
        {
            return false;
        }

        // compare values
        if ( this.isEmpty() && vc.isEmpty() )
        {
            return true;
        }
        else if ( this.isBinary() && vc.isBinary() )
        {
            return Utils.equals( this.getBinaryValue(), vc.getBinaryValue() );
        }
        else if ( this.isString() && vc.isString() )
        {
            return ( this.getStringValue().equals( vc.getStringValue() ) );
        }
        else
        {
            return false;
        }
View Full Code Here

        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().toString() ) );
        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

            return false;
        }

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

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.IValue$EmptyValue

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.