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

Examples of org.apache.directory.studio.ldapbrowser.core.internal.model.Attribute


        {

            IAttribute newAttribute = entry.getAttribute( newAttributeName );
            if ( newAttribute == null )
            {
                newAttribute = new Attribute( entry, newAttributeName );
                entry.addAttribute( newAttribute );
            }

            newValues[i] = new Value( newAttribute, oldValues[i].getRawValue() );
            newAttribute.addValue( newValues[i] );
View Full Code Here


            if ( ah == null )
            {
                try
                {
                    ah = new AttributeHierarchy( result.getEntry(), property, new IAttribute[]
                        { new Attribute( result.getEntry(), property ) } );
                }
                catch ( ModelModificationException e )
                {
                    e.printStackTrace();
                    return false;
View Full Code Here

            if ( ah == null )
            {
                try
                {
                    ah = new AttributeHierarchy( result.getEntry(), property, new IAttribute[]
                        { new Attribute( result.getEntry(), property ) } );
                }
                catch ( ModelModificationException e )
                {
                    e.printStackTrace();
                    return null;
View Full Code Here

                    IAttribute attributeToCopy = attributesToCopy[i];

                    if ( SchemaUtils.isModifyable( attributeToCopy.getAttributeTypeDescription() )
                        || IAttribute.REFERRAL_ATTRIBUTE.equalsIgnoreCase( attributeToCopy.getDescription() ) )
                    {
                        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 );
                        }
                    }
                }

                // check if RDN attributes ar present
                RDN newRdn = newEntry.getRdn();
                RDNPart[] oldRdnParts = rdn.getParts();
                for ( int i = 0; i < oldRdnParts.length; i++ )
                {
                    RDNPart part = oldRdnParts[i];
                    IAttribute rdnAttribute = newEntry.getAttribute( part.getType() );
                    if ( rdnAttribute != null )
                    {
                        IValue[] values = rdnAttribute.getValues();
                        for ( int ii = 0; ii < values.length; ii++ )
                        {
                            if ( part.getUnencodedValue().equals( values[ii].getRawValue() ) )
                            {
                                rdnAttribute.deleteValue( values[ii] );
                            }
                            if ( rdnAttribute.getValueSize() == 0 )
                            {
                                newEntry.deleteAttribute( rdnAttribute );
                            }
                        }
                    }
                }
                RDNPart[] newRdnParts = newRdn.getParts();
                for ( int i = 0; i < newRdnParts.length; i++ )
                {
                    RDNPart part = newRdnParts[i];
                    IAttribute rdnAttribute = newEntry.getAttribute( part.getType() );
                    if ( rdnAttribute == null )
                    {
                        rdnAttribute = new Attribute( newEntry, part.getType() );
                        newEntry.addAttribute( rdnAttribute );
                        rdnAttribute.addValue( new Value( rdnAttribute, part.getUnencodedValue() ) );
                    }
                    else
                    {
View Full Code Here

            for ( int i = 0; i < newRdnParts.length; i++ )
            {
                IAttribute rdnAttribute = newEntry.getAttribute( newRdnParts[i].getType() );
                if ( rdnAttribute == null )
                {
                    rdnAttribute = new Attribute( newEntry, newRdnParts[i].getType() );
                    newEntry.addAttribute( rdnAttribute );
                }
                String rdnValue = newRdnParts[i].getUnencodedValue();
                String[] stringValues = rdnAttribute.getStringValues();
                if ( !Arrays.asList( stringValues ).contains( rdnValue ) )
View Full Code Here

                // if(!Arrays.asList(possibleAttributeNames).contains(attributeNames[i]))
                // {
                // throw new ModelModificationException("Attribute
                // "+attributeNames[i]+" is not in subschema");
                // }
                attribute = new Attribute( entry, attributeDescriptions[i] );
                entry.addAttribute( attribute );
            }

            newValues[i] = new Value( attribute, rawValues[i] );
            attribute.addValue( newValues[i] );
View Full Code Here

                    oldValue = ""; //$NON-NLS-1$
                }
               
                try
                {
                    IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
                    IValue value = new Value( attribute, oldValue ); //$NON-NLS-1$
                    Object oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$

                    CellEditor cellEditor = valueEditor.getCellEditor();
                    cellEditor.setValue( oldRawValue );
View Full Code Here

     */
    private void addValue()
    {
        try
        {
            IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
            IValue value = new Value( attribute, "" ); //$NON-NLS-1$
            Object oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$
           
            CellEditor cellEditor = valueEditor.getCellEditor();
            cellEditor.setValue( oldRawValue );
View Full Code Here

        String oldValue = getSelectedValue();
        if ( oldValue != null )
        {
            try
            {
                IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
                IValue value = new Value( attribute, oldValue ); //$NON-NLS-1$
                Object oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$
               
                CellEditor cellEditor = valueEditor.getCellEditor();
                cellEditor.setValue( oldRawValue );
View Full Code Here

            if ( attributeHierarchie == null )
            {
                EventRegistry.suspendEventFireingInCurrentThread();
                try
                {
                    IAttribute attribute = new Attribute( entry, attributeDescription );
                    entry.addAttribute( attribute );
                    attribute.addEmptyValue();
                }
                catch ( ModelModificationException e )
                {
                }
                EventRegistry.resumeEventFireingInCurrentThread();
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.internal.model.Attribute

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.