Package org.apache.directory.studio.apacheds.configuration.editor.v156.dialogs

Examples of org.apache.directory.studio.apacheds.configuration.editor.v156.dialogs.AttributeValueObject


                    Iterator<Value<?>> values = attribute.iterator();
                    while ( values.hasNext() )
                    {
                        Value<?> value = values.next();
                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );

                    }

                }
View Full Code Here


    private void editSelectedContextEntry()
    {
        StructuredSelection selection = ( StructuredSelection ) contextEntryTableViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();

            String oldId = attributeValueObject.getAttribute();
            String oldValue = attributeValueObject.getValue();

            AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
            {
                Attribute attribute = contextEntry.get( oldId );
                if ( attribute != null )
                {
                    attribute.remove( oldValue );
                }

                AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                attribute = contextEntry.get( newAttributeValueObject.getAttribute() );

                if ( attribute != null )
                {
                    try
                    {
                        attribute.add( newAttributeValueObject.getValue() );
                    }
                    catch ( LdapInvalidAttributeValueException liave )
                    {
                        // TODO : handle the exception
                    }
                }
                else
                {
                    try
                    {
                        contextEntry.put( new DefaultAttribute( newAttributeValueObject.getAttribute(),
                            newAttributeValueObject.getValue() ) );
                    }
                    catch ( LdapException e )
                    {
                        // Will never occur
                    }
View Full Code Here

                    try
                    {
                        NamingEnumeration<?> values = attribute.getAll();
                        while ( values.hasMoreElements() )
                        {
                            elements.add( new AttributeValueObject( attribute.getID(), values.nextElement() ) );
                        }
                    }
                    catch ( NamingException e )
                    {
                    }
View Full Code Here

    private void editSelectedContextEntry()
    {
        StructuredSelection selection = ( StructuredSelection ) contextEntryTableViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();

            String oldId = attributeValueObject.getAttribute();
            Object oldValue = attributeValueObject.getValue();

            AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
            {
                Attribute attribute = contextEntry.get( oldId );
                if ( attribute != null )
                {
                    attribute.remove( oldValue );
                }

                AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
                if ( attribute != null )
                {
                    attribute.add( newAttributeValueObject.getValue() );
                }
                else
                {
                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
                        newAttributeValueObject.getValue() ) );
                }

                contextEntryTableViewer.refresh();
                resizeContextEntryTableColumnsToFit();
                masterDetailsBlock.setEditorDirty();
View Full Code Here

                    Iterator<Value<?>> values = attribute.iterator();
                    while ( values.hasNext() )
                    {
                        Value<?> value = values.next();
                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );

                    }

                }
View Full Code Here

    private void editSelectedContextEntry()
    {
        StructuredSelection selection = ( StructuredSelection ) contextEntryTableViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();

            String oldId = attributeValueObject.getAttribute();
            String oldValue = attributeValueObject.getValue();

            AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
            {
                Attribute attribute = contextEntry.get( oldId );
                if ( attribute != null )
                {
                    attribute.remove( oldValue );
                }

                AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                attribute = contextEntry.get( newAttributeValueObject.getAttribute() );

                if ( attribute != null )
                {
                    try
                    {
                        attribute.add( newAttributeValueObject.getValue() );
                    }
                    catch ( LdapInvalidAttributeValueException liave )
                    {
                        // TODO : handle the exception
                    }
                }
                else
                {
                    try
                    {
                        contextEntry.put( new DefaultAttribute( newAttributeValueObject.getAttribute(),
                            newAttributeValueObject.getValue() ) );
                    }
                    catch ( LdapException e )
                    {
                        // Will never occur
                    }
View Full Code Here

                    try
                    {
                        NamingEnumeration<?> values = attribute.getAll();
                        while ( values.hasMoreElements() )
                        {
                            elements.add( new AttributeValueObject( attribute.getID(), values.nextElement() ) );
                        }
                    }
                    catch ( NamingException e )
                    {
                    }
View Full Code Here

    private void editSelectedContextEntry()
    {
        StructuredSelection selection = ( StructuredSelection ) contextEntryTableViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();

            String oldId = attributeValueObject.getAttribute();
            Object oldValue = attributeValueObject.getValue();

            AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
            {
                Attribute attribute = contextEntry.get( oldId );
                if ( attribute != null )
                {
                    attribute.remove( oldValue );
                }

                AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
                if ( attribute != null )
                {
                    attribute.add( newAttributeValueObject.getValue() );
                }
                else
                {
                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
                        newAttributeValueObject.getValue() ) );
                }

                contextEntryTableViewer.refresh();
                resizeContextEntryTableColumnsToFit();
                masterDetailsBlock.setEditorDirty();
View Full Code Here

                    Iterator<Value<?>> values = attribute.iterator();
                    while ( values.hasNext() )
                    {
                        Value<?> value = values.next();
                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );

                    }

                }
View Full Code Here

    private void editSelectedContextEntry()
    {
        StructuredSelection selection = ( StructuredSelection ) contextEntryTableViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();

            String oldId = attributeValueObject.getAttribute();
            String oldValue = attributeValueObject.getValue();

            AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
            if ( Dialog.OK == dialog.open() && dialog.isDirty() )
            {
                Attribute attribute = contextEntry.get( oldId );
                if ( attribute != null )
                {
                    attribute.remove( oldValue );
                }

                AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                attribute = contextEntry.get( newAttributeValueObject.getAttribute() );

                if ( attribute != null )
                {
                    try
                    {
                        attribute.add( newAttributeValueObject.getValue() );
                    }
                    catch ( LdapInvalidAttributeValueException liave )
                    {
                        // TODO : handle the exception
                    }
                }
                else
                {
                    try
                    {
                        contextEntry.put( new DefaultAttribute( newAttributeValueObject.getAttribute(),
                            newAttributeValueObject.getValue() ) );
                    }
                    catch ( LdapException e )
                    {
                        // Will never occur
                    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.apacheds.configuration.editor.v156.dialogs.AttributeValueObject

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.