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

Examples of org.apache.directory.studio.ldapbrowser.core.events.ValueAddedEvent


        // selection value
        if ( event instanceof ValueAddedEvent )
        {
            // select the vadded value
            ValueAddedEvent vaEvent = ( ValueAddedEvent ) event;
            viewer.setSelection( new StructuredSelection( vaEvent.getAddedValue() ), true );
            viewer.refresh();
        }
        else if ( event instanceof ValueDeletedEvent )
        {
            // select another value of the deleted attribute
View Full Code Here


        if ( ArrayUtils.isEmpty( values ) )
        {
            throw new IllegalArgumentException( "Expected non-null and non-empty values array." ); //$NON-NLS-1$
        }

        ValueAddedEvent event = null;
        EventRegistry.suspendEventFiringInCurrentThread();
        for ( IValue value : values )
        {
            String attributeDescription = value.getAttribute().getDescription();
            IAttribute attribute = entry.getAttribute( attributeDescription );
            if ( attribute == null )
            {
                attribute = new Attribute( entry, attributeDescription );
                entry.addAttribute( attribute );
            }
            Value newValue = new Value( attribute, value.getRawValue() );
            attribute.addValue( newValue );
            if ( event == null )
            {
                event = new ValueAddedEvent( entry.getBrowserConnection(), entry, attribute, newValue );
            }
        }
        EventRegistry.resumeEventFiringInCurrentThread();

        // fire event
View Full Code Here

            viewer.refresh();

            // select added/modified value
            if ( event instanceof ValueAddedEvent )
            {
                ValueAddedEvent vaEvent = ( ValueAddedEvent ) event;
                viewer.setSelection( new StructuredSelection( vaEvent.getAddedValue() ), true );
                viewer.refresh();
            }
            else if ( event instanceof ValueModifiedEvent )
            {
                ValueModifiedEvent vmEvent = ( ValueModifiedEvent ) event;
View Full Code Here

     */
    public void addValue( IValue valueToAdd ) throws IllegalArgumentException
    {
        checkValue( valueToAdd );
        valueList.add( valueToAdd );
        attributeModified( new ValueAddedEvent( getEntry().getBrowserConnection(), getEntry(), this, valueToAdd ) );
    }
View Full Code Here

        if ( ArrayUtils.isEmpty( values ) )
        {
            throw new IllegalArgumentException( "Expected non-null and non-empty values array." ); //$NON-NLS-1$
        }

        ValueAddedEvent event = null;
        EventRegistry.suspendEventFiringInCurrentThread();
        for ( IValue value : values )
        {
            String attributeDescription = value.getAttribute().getDescription();
            IAttribute attribute = entry.getAttribute( attributeDescription );
            if ( attribute == null )
            {
                attribute = new Attribute( entry, attributeDescription );
                entry.addAttribute( attribute );
            }
            Value newValue = new Value( attribute, value.getRawValue() );
            attribute.addValue( newValue );
            if ( event == null )
            {
                event = new ValueAddedEvent( entry.getBrowserConnection(), entry, attribute, newValue );
            }
        }
        EventRegistry.resumeEventFiringInCurrentThread();

        // fire event
View Full Code Here

    {
        EntryModificationEvent event;

        if ( createdValues != null && createdValues.length > 0 )
        {
            event = new ValueAddedEvent( entry.getBrowserConnection(), entry, createdValues[0].getAttribute(),
                createdValues[0] );
        }
        else
        {
            event = new AttributesInitializedEvent( entry );
View Full Code Here

        // selection value
        if ( event instanceof ValueAddedEvent )
        {
            // select the vadded value
            ValueAddedEvent vaEvent = ( ValueAddedEvent ) event;
            viewer.setSelection( new StructuredSelection( vaEvent.getAddedValue() ), true );
            viewer.refresh();
        }
        else if ( event instanceof ValueDeletedEvent )
        {
            // select another value of the deleted attribute
View Full Code Here

                ChildrenInitializedEvent delegateEvent = new ChildrenInitializedEvent( this );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueAddedEvent )
            {
                ValueAddedEvent e = ( ValueAddedEvent ) event;
                ValueAddedEvent delegateEvent = new ValueAddedEvent( e.getConnection(), this, e.getModifiedAttribute(),
                    e.getAddedValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueDeletedEvent )
            {
View Full Code Here

    {
        EntryModificationEvent event;

        if ( createdValues != null && createdValues.length > 0 )
        {
            event = new ValueAddedEvent( entry.getBrowserConnection(), entry, createdValues[0].getAttribute(),
                createdValues[0] );
        }
        else
        {
            event = new AttributesInitializedEvent( entry );
View Full Code Here

                ChildrenInitializedEvent delegateEvent = new ChildrenInitializedEvent( this );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueAddedEvent )
            {
                ValueAddedEvent e = ( ValueAddedEvent ) event;
                ValueAddedEvent delegateEvent = new ValueAddedEvent( e.getConnection(), this, e.getModifiedAttribute(),
                    e.getAddedValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueDeletedEvent )
            {
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.events.ValueAddedEvent

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.