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

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


            viewer.refresh();
        }
        else if ( event instanceof ValueDeletedEvent )
        {
            // select another value of the deleted attribute
            ValueDeletedEvent vdEvent = ( ValueDeletedEvent ) event;
            if ( viewer.getSelection().isEmpty() && vdEvent.getDeletedValue().getAttribute().getValueSize() > 0 )
            {
                viewer.setSelection(
                    new StructuredSelection( vdEvent.getDeletedValue().getAttribute().getValues()[0] ), true );
            }
        }
        else if ( event instanceof EmptyValueAddedEvent )
        {
            EmptyValueAddedEvent evaEvent = ( EmptyValueAddedEvent ) event;
View Full Code Here


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

        ValueDeletedEvent event = null;
        try
        {
            EventRegistry.suspendEventFiringInCurrentThread();
            for ( IValue value : values )
            {
                IAttribute attribute = value.getAttribute();
                IEntry entry = attribute.getEntry();

                attribute.deleteValue( value );
                if ( event == null )
                {
                    event = new ValueDeletedEvent( entry.getBrowserConnection(), entry, attribute, value );
                }

                if ( attribute.getValueSize() == 0 )
                {
                    attribute.getEntry().deleteAttribute( attribute );
View Full Code Here

                ValueModifiedEvent vmEvent = ( ValueModifiedEvent ) event;
                viewer.setSelection( new StructuredSelection( vmEvent.getNewValue() ), true );
            }
            else if ( event instanceof ValueDeletedEvent )
            {
                ValueDeletedEvent vdEvent = ( ValueDeletedEvent ) event;
                if ( vdEvent.getDeletedValue().getAttribute().getValueSize() > 0 )
                {
                    viewer.setSelection( new StructuredSelection(
                        vdEvent.getDeletedValue().getAttribute().getValues()[0] ), true );
                }
            }
            else if ( event instanceof EmptyValueAddedEvent )
            {
                viewer.refresh();
View Full Code Here

    {
        checkValue( valueToDelete );

        if ( internalDeleteValue( valueToDelete ) )
        {
            attributeModified( new ValueDeletedEvent( getEntry().getBrowserConnection(), getEntry(), this,
                valueToDelete ) );
        }
    }
View Full Code Here

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

        ValueDeletedEvent event = null;
        try
        {
            EventRegistry.suspendEventFiringInCurrentThread();
            for ( IValue value : values )
            {
                IAttribute attribute = value.getAttribute();
                IEntry entry = attribute.getEntry();

                attribute.deleteValue( value );
                if ( event == null )
                {
                    event = new ValueDeletedEvent( entry.getBrowserConnection(), entry, attribute, value );
                }

                if ( attribute.getValueSize() == 0 )
                {
                    attribute.getEntry().deleteAttribute( attribute );
View Full Code Here

            viewer.refresh();
        }
        else if ( event instanceof ValueDeletedEvent )
        {
            // select another value of the deleted attribute
            ValueDeletedEvent vdEvent = ( ValueDeletedEvent ) event;
            if ( viewer.getSelection().isEmpty() && vdEvent.getDeletedValue().getAttribute().getValueSize() > 0 )
            {
                viewer.setSelection(
                    new StructuredSelection( vdEvent.getDeletedValue().getAttribute().getValues()[0] ), true );
            }
        }
        else if ( event instanceof EmptyValueAddedEvent )
        {
            EmptyValueAddedEvent evaEvent = ( EmptyValueAddedEvent ) event;
View Full Code Here

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

    {
        EntryModificationEvent event;

        if ( deletedValues != null && deletedValues.length > 0 )
        {
            event = new ValueDeletedEvent( entry.getBrowserConnection(), entry, deletedValues[0].getAttribute(),
                deletedValues[0] );
        }
        else if ( deletedAttributes != null && deletedAttributes.length > 0 )
        {
            event = new AttributeDeletedEvent( entry.getBrowserConnection(), entry, deletedAttributes[0] );
View Full Code Here

    {
        EntryModificationEvent event;

        if ( deletedValues != null && deletedValues.length > 0 )
        {
            event = new ValueDeletedEvent( entry.getBrowserConnection(), entry, deletedValues[0].getAttribute(),
                deletedValues[0] );
        }
        else if ( deletedAttributes != null && deletedAttributes.length > 0 )
        {
            event = new AttributeDeletedEvent( entry.getBrowserConnection(), entry, deletedAttributes[0] );
View Full Code Here

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

TOP

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

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.