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

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


                for ( int i = 0; i < objects.length; i++ )
                {
                    Object object = objects[i];
                    if ( object instanceof AttributeHierarchy )
                    {
                        AttributeHierarchy ah = ( AttributeHierarchy ) object;
                        for ( IAttribute attribute : ah )
                        {
                            entry = attribute.getEntry();
                            IValue[] values = attribute.getValues();
                            for ( int v = 0; v < values.length; v++ )
View Full Code Here


                {
                    return result.getDn().getName();
                }
                else
                {
                    AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
                    return getDisplayValue( ah );
                }

            }
            catch ( ArrayIndexOutOfBoundsException aioobe )
View Full Code Here

            {
                return null;
            }
            else if ( property != null )
            {
                AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
                if ( ah != null )
                {
                    for ( int i = 0; i < ah.getAttributes().length; i++ )
                    {
                        IAttribute attribute = ah.getAttributes()[i];
                        if ( attribute.isObjectClassAttribute() )
                        {
                            FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator
                                .getDefault().getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OBJECTCLASS_FONT );
                            return BrowserCommonActivator.getDefault().getFont( fontData );
View Full Code Here

            {
                return false;
            }
            else
            {
                AttributeHierarchy ah = getSelectedAttributeHierarchies()[0];
                alternativeVps = valueEditorManager.getAlternativeValueEditors( ah );
                return Arrays.asList( alternativeVps ).contains( valueEditor ) && valueEditor.getRawValue( ah ) != null;
            }
        }
        else
View Full Code Here

                // compare normalized names
                return compare( entry1.getDn().getNormName(), entry2.getDn().getNormName() );
            }
            else
            {
                AttributeHierarchy ah1 = entry1.getAttributeWithSubtypes( attributeName );
                AttributeHierarchy ah2 = entry2.getAttributeWithSubtypes( attributeName );

                if ( ah1 == null )
                {
                    if ( ah2 == null )
                    {
                        return equal();
                    }
                    else
                    {
                        return lessThan();
                    }
                }
                else if ( ah2 == null )
                {
                    return greaterThan();
                }
                else
                {
                    IAttribute attribute1 = ah1.getAttribute();
                    IAttribute attribute2 = ah2.getAttribute();

                    String value1 = getValue( attribute1 );
                    String value2 = getValue( attribute2 );
                    return compare( value1, value2 );
                }
View Full Code Here

            String[] returningAttributes = searchResult.getSearch().getReturningAttributes();
            for ( int r = 0; r < returningAttributes.length; r++ )
            {
                String ra = returningAttributes[r];
                AttributeHierarchy ah = searchResult.getAttributeWithSubtypes( ra );
                if ( ah != null )
                {
                    IAttribute[] attributes = ah.getAttributes();
                    for ( int i = 0; i < attributes.length; i++ )
                    {
                        IValue[] values = attributes[i].getValues();
                        for ( int k = 0; k < values.length; k++ )
                        {
View Full Code Here

    public boolean canModify( Object element, String property )
    {
        if ( element != null && element instanceof ISearchResult && property != null )
        {
            ISearchResult result = ( ISearchResult ) element;
            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );

            // check Dn
            if ( BrowserUIConstants.DN.equals( property ) )
            {
                return false;
            }

            // attribute dummy
            if ( ah == null )
            {
                ah = new AttributeHierarchy( result.getEntry(), property, new IAttribute[]
                    { new Attribute( result.getEntry(), property ) } );
            }

            // call value editor
            return valueEditorManager.getCurrentValueEditor( ah ).getRawValue( ah ) != null;
View Full Code Here

    {
        if ( element != null && element instanceof ISearchResult && property != null )
        {
            // perform modifications on the clone
            ISearchResult result = cursor.getSelectedSearchResult();
            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );

            if ( !canModify( element, property ) )
            {
                return null;
            }

            if ( ah == null )
            {
                ah = new AttributeHierarchy( result.getEntry(), property, new IAttribute[]
                    { new Attribute( result.getEntry(), property ) } );
            }

            return valueEditorManager.getCurrentValueEditor( ah ).getRawValue( ah );
        }
View Full Code Here

        if ( element != null && element instanceof ISearchResult && property != null )
        {
            // perform modifications on the clone
            ISearchResult result = cursor.getSelectedSearchResult();
            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );

            // switch operation:
            if ( ah == null && newRawValue != null )
            {
                new CompoundModification().createValue( result.getEntry(), property, newRawValue );
            }
            else if ( ah != null && newRawValue == null )
            {
                List<IValue> values = new ArrayList<IValue>();
                for ( IAttribute attribute : ah.getAttributes() )
                {
                    for ( IValue value : attribute.getValues() )
                    {
                        values.add( value );
                    }
                }
                new CompoundModification().deleteValues( values );
            }
            else if ( ah != null && ah.size() == 1 && ah.getAttribute().getValueSize() == 1 && newRawValue != null )
            {
                new CompoundModification().modifyValue( ah.getAttribute().getValues()[0], newRawValue );
            }
        }
    }
View Full Code Here

            }
            for ( int a = 0; returningAttributes != null && a < returningAttributes.length; a++ )
            {

                AttributeComparator comparator = new AttributeComparator( entries[e] );
                AttributeHierarchy ah = entries[e].getAttributeWithSubtypes( returningAttributes[a] );
                if ( ah != null )
                {

                    StringBuffer valueSB = new StringBuffer();

                    for ( Iterator it = ah.iterator(); it.hasNext(); )
                    {
                        IAttribute attribute = ( IAttribute ) it.next();
                        if ( attribute != null )
                        {
View Full Code Here

TOP

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

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.