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

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


                IEntry entry = ( IEntry ) newInput;
                dn = Messages.getString( "EntryEditorWidgetContentProvider.DNLabel" ) + entry.getDn().getUpName(); //$NON-NLS-1$
            }
            else if ( newInput != null && newInput instanceof AttributeHierarchy )
            {
                AttributeHierarchy ah = ( AttributeHierarchy ) newInput;
                dn = Messages.getString( "EntryEditorWidgetContentProvider.DNLabel" ) + ah.getAttribute().getEntry().getDn().getUpName(); //$NON-NLS-1$
            }
            else
            {
                dn = Messages.getString( "EntryEditorWidgetContentProvider.NoEntrySelected" ); //$NON-NLS-1$
                enabled = false;
View Full Code Here


                return values;
            }
        }
        else if ( inputElement != null && inputElement instanceof AttributeHierarchy )
        {
            AttributeHierarchy ah = ( AttributeHierarchy ) inputElement;
            IAttribute[] attributes = ah.getAttributes();
            Object[] values = getValues( attributes, showOperationalAttributes );
            return values;
        }
        else
        {
View Full Code Here

            return null;
        }
        else
        {
            IAttribute[] attributes = attributeList.toArray( new IAttribute[attributeList.size()] );
            AttributeHierarchy ah = new AttributeHierarchy( this, attributeDescription, attributes );
            return ah;
        }
    }
View Full Code Here

                }

                for ( int r = 0; r < ras.length; r++ )
                {
                    // clear attributes requested from server, also include sub-types
                    AttributeHierarchy ah = entry.getAttributeWithSubtypes( ras[r] );
                    if ( ah != null )
                    {
                        for ( Iterator<IAttribute> it = ah.iterator(); it.hasNext(); )
                        {
                            IAttribute attribute = it.next();
                            entry.deleteAttribute( attribute );
                        }
                    }
View Full Code Here

    {
        if ( event instanceof EmptyValueAddedEvent && !editor.getActionGroup().isEditorActive() )
        {
            EmptyValueAddedEvent evae = ( EmptyValueAddedEvent ) event;
            IAttribute att = evae.getAddedValue().getAttribute();
            AttributeHierarchy ah = cursor.getSelectedAttributeHierarchy();
            if ( ah != null && ah.contains( att ) )
            {
                viewer.setSelection( null, true );
                viewer.getTable().setSelection( new TableItem[0] );
                if ( startEditAction.isEnabled() )
                {
View Full Code Here

                {
                    return result.getDn().getUpName();
                }
                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

            }
            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

        // validate non-modifiable attributes
        AttributeHierarchy[] attributeHierarchies = getSelectedAttributeHierarchies();
        if ( attributeHierarchies.length == 1 )
        {
            AttributeHierarchy attributeHierarchy = attributeHierarchies[0];
            StringBuffer message = new StringBuffer();

            if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize() == 0 )
            {
                // validate if value is allowed
                IEntry entry = attributeHierarchy.getAttribute().getEntry();
                Collection<AttributeTypeDescription> allAtds = SchemaUtils.getAllAttributeTypeDescriptions( entry );
                AttributeTypeDescription atd = attributeHierarchy.getAttribute().getAttributeTypeDescription();
                if ( !allAtds.contains( atd ) )
                {
                    message.append( NLS.bind( Messages.getString( "OpenBestEditorAction.AttributeNotInSubSchema" ), //$NON-NLS-1$
                        attributeHierarchy.getAttribute().getDescription() ) );
                    message.append( BrowserCoreConstants.LINE_SEPARATOR );
                    message.append( BrowserCoreConstants.LINE_SEPARATOR );
                }
            }

            if ( attributeHierarchy.size() == 1
                && attributeHierarchy.getAttribute().getValueSize() == 1
                && attributeHierarchy.getAttributeDescription().equalsIgnoreCase(
                    attributeHierarchy.getAttribute().getValues()[0].getAttribute().getDescription() )
                && !attributeHierarchy.getAttribute().getValues()[0].isRdnPart() )
            {
                // validate non-modifiable attributes
                IValue value = attributeHierarchy.getAttribute().getValues()[0];
                if ( !value.isEmpty() && !SchemaUtils.isModifiable( value.getAttribute().getAttributeTypeDescription() ) )
                {
                    message
                        .append( NLS
                            .bind(
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 && ah2 == null )
            {
                return equal();
            }
            else if ( ah1 == null && ah2 != null )
            {
                return lessThan();
            }
            else if ( ah1 != null && 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

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.