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

Examples of org.apache.directory.ldapstudio.browser.core.model.IAttribute


                            {
                                // select the value
                                LdifAttrValLine line = ( LdifAttrValLine ) element;
                                for ( int a = 0; a < attributes.length; a++ )
                                {
                                    IAttribute attribute = attributes[a];
                                    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 );
                                            }
                                        }
                                    }
                                }
                            }
                            else if ( element instanceof List )
                            {
                                // select attribute and all values
                                List list = ( List ) element;
                                if ( !list.isEmpty() && list.get( 0 ) instanceof LdifAttrValLine )
                                {
                                    LdifAttrValLine line = ( LdifAttrValLine ) list.get( 0 );
                                    for ( int a = 0; a < attributes.length; a++ )
                                    {
                                        IAttribute attribute = attributes[a];
                                        if ( attribute.getDescription().equals(
                                            line.getUnfoldedAttributeDescription() ) )
                                        {
                                            selectionList.add( attribute );
                                            selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                        }
                                    }
                                }
                            }
                            else if ( element instanceof LdifRecord )
                            {
                                for ( int a = 0; a < attributes.length; a++ )
                                {
                                    IAttribute attribute = attributes[a];
                                    selectionList.add( attribute );
                                    selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                }
                            }
                        }

                        IStructuredSelection selection = new StructuredSelection( selectionList );
View Full Code Here


           
            availableObjectClasses.addAll( Arrays.asList( wizard.getSelectedConnection().getSchema()
                .getObjectClassDescriptions() ) );

            DummyEntry newEntry = wizard.getPrototypeEntry();
            IAttribute ocAttribute = newEntry.getAttribute( IAttribute.OBJECTCLASS_ATTRIBUTE );
            if ( ocAttribute != null )
            {
                String[] ocValues = ocAttribute.getStringValues();
                for ( int i = 0; i < ocValues.length; i++ )
                {
                    String ocValue = ocValues[i];
                    ObjectClassDescription ocd = wizard.getSelectedConnection().getSchema().getObjectClassDescription(
                        ocValue );
View Full Code Here

        try
        {
            EventRegistry.suspendEventFireingInCurrentThread();

            // set new objectClass values
            IAttribute ocAttribute = newEntry.getAttribute( IAttribute.OBJECTCLASS_ATTRIBUTE );
            if ( ocAttribute == null )
            {
                ocAttribute = new Attribute( newEntry, IAttribute.OBJECTCLASS_ATTRIBUTE );
                newEntry.addAttribute( ocAttribute );
            }
            IValue[] values = ocAttribute.getValues();
            for ( int i = 0; i < values.length; i++ )
            {
                ocAttribute.deleteValue( values[i] );
            }
            for ( Iterator<ObjectClassDescription> it = selectedObjectClasses.iterator(); it.hasNext(); )
            {
                ObjectClassDescription ocd = it.next();
                ocAttribute.addValue( new Value( ocAttribute, ocd.getNames()[0] ) );
            }
        }
        catch ( ModelModificationException e )
        {
            e.printStackTrace();
View Full Code Here

    {

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

                        IEntry entry = value.getAttribute().getEntry();
                        select( entry );
                    }
                    else if ( obj instanceof IAttribute )
                    {
                        IAttribute attribute = ( IAttribute ) obj;
                        IEntry entry = attribute.getEntry();
                        select( entry );

                    }
                    else if ( obj instanceof ISearchResult )
                    {
View Full Code Here

        }

        List<IValue> valueList = new ArrayList<IValue>();
        for ( Iterator it = attributeHierarchy.iterator(); it.hasNext(); )
        {
            IAttribute attribute = ( IAttribute ) it.next();
            valueList.addAll( Arrays.asList( attribute.getValues() ) );
        }

        StringBuffer sb = new StringBuffer();
        for ( Iterator<IValue> it = valueList.iterator(); it.hasNext(); )
        {
View Full Code Here

    {

        List<IValue> valueList = new ArrayList<IValue>();
        for ( Iterator it = attributeHierarchy.iterator(); it.hasNext(); )
        {
            IAttribute attribute = ( IAttribute ) it.next();
            valueList.addAll( Arrays.asList( attribute.getValues() ) );
        }

        StringBuffer sb = new StringBuffer();
        if ( valueList.size() > 1 )
            sb.append( valueList.size() + " values: " );
View Full Code Here

    {
       
        Object oldRawValue;
        try
        {
            IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
            IValue value = new Value( attribute, "" ); //$NON-NLS-1$
            oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$
        }
        catch ( ModelModificationException e )
        {
View Full Code Here

        if ( oldValue != null )
        {
            Object oldRawValue;
            try
            {
                IAttribute attribute = new Attribute( context.getEntry(), "" ); //$NON-NLS-1$
                IValue value = new Value( attribute, oldValue ); //$NON-NLS-1$
                oldRawValue = valueEditor.getRawValue( value ); //$NON-NLS-1$
            }
            catch ( ModelModificationException e )
            {
View Full Code Here

        }

        List<IValue> valueList = new ArrayList<IValue>();
        for ( Iterator it = attributeHierarchy.iterator(); it.hasNext(); )
        {
            IAttribute attribute = ( IAttribute ) it.next();
            valueList.addAll( Arrays.asList( attribute.getValues() ) );
        }

        StringBuffer sb = new StringBuffer();
        for ( Iterator<IValue> it = valueList.iterator(); it.hasNext(); )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.IAttribute

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.