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

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


            viewer.setSelection( new StructuredSelection( vmEvent.getNewValue() ), true );
        }
        else if ( event instanceof ValueRenamedEvent )
        {
            // select the renamed value
            ValueRenamedEvent vrEvent = ( ValueRenamedEvent ) event;
            viewer.setSelection( new StructuredSelection( vrEvent.getNewValue() ), true );
        }
    }
View Full Code Here


        }

        if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) //$NON-NLS-1$
            && !newAttributeDescription.equals( oldValues[0].getAttribute().getDescription() ) )
        {
            ValueRenamedEvent event = null;
            try
            {
                EventRegistry.suspendEventFiringInCurrentThread();
                for ( IValue oldValue : oldValues )
                {
                    if ( !newAttributeDescription.equals( oldValue.getAttribute().getDescription() ) )
                    {
                        IAttribute oldAttribute = oldValue.getAttribute();
                        IEntry entry = oldAttribute.getEntry();
                        IValue newValue = null;

                        // delete old value
                        oldAttribute.deleteValue( oldValue );
                        if ( oldAttribute.getValueSize() == 0 )
                        {
                            entry.deleteAttribute( oldAttribute );
                        }

                        // add new value
                        IAttribute attribute = entry.getAttribute( newAttributeDescription );
                        if ( attribute == null )
                        {
                            attribute = new Attribute( entry, newAttributeDescription );
                            entry.addAttribute( attribute );
                        }
                        newValue = new Value( attribute, oldValue.getRawValue() );
                        attribute.addValue( newValue );

                        // prepare event
                        if ( event == null )
                        {
                            event = new ValueRenamedEvent( entry.getBrowserConnection(), entry, oldValue, newValue );
                        }
                    }
                }
            }
            finally
View Full Code Here

        }

        if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) //$NON-NLS-1$
            && !newAttributeDescription.equals( oldValues[0].getAttribute().getDescription() ) )
        {
            ValueRenamedEvent event = null;
            try
            {
                EventRegistry.suspendEventFiringInCurrentThread();
                for ( IValue oldValue : oldValues )
                {
                    if ( !newAttributeDescription.equals( oldValue.getAttribute().getDescription() ) )
                    {
                        IAttribute oldAttribute = oldValue.getAttribute();
                        IEntry entry = oldAttribute.getEntry();
                        IValue newValue = null;

                        // delete old value
                        oldAttribute.deleteValue( oldValue );
                        if ( oldAttribute.getValueSize() == 0 )
                        {
                            entry.deleteAttribute( oldAttribute );
                        }

                        // add new value
                        IAttribute attribute = entry.getAttribute( newAttributeDescription );
                        if ( attribute == null )
                        {
                            attribute = new Attribute( entry, newAttributeDescription );
                            entry.addAttribute( attribute );
                        }
                        newValue = new Value( attribute, oldValue.getRawValue() );
                        attribute.addValue( newValue );

                        // prepare event
                        if ( event == null )
                        {
                            event = new ValueRenamedEvent( entry.getBrowserConnection(), entry, oldValue, newValue );
                        }
                    }
                }
            }
            finally
View Full Code Here

            viewer.setSelection( new StructuredSelection( vmEvent.getNewValue() ), true );
        }
        else if ( event instanceof ValueRenamedEvent )
        {
            // select the renamed value
            ValueRenamedEvent vrEvent = ( ValueRenamedEvent ) event;
            viewer.setSelection( new StructuredSelection( vrEvent.getNewValue() ), true );
        }
    }
View Full Code Here

                    .getModifiedAttribute(), e.getOldValue(), e.getNewValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueRenamedEvent )
            {
                ValueRenamedEvent e = ( ValueRenamedEvent ) event;
                ValueRenamedEvent delegateEvent = new ValueRenamedEvent( e.getConnection(), this, e.getOldValue(), e
                    .getNewValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
        }
    }
View Full Code Here

    {
        EntryModificationEvent event;

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

                    .getModifiedAttribute(), e.getOldValue(), e.getNewValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueRenamedEvent )
            {
                ValueRenamedEvent e = ( ValueRenamedEvent ) event;
                ValueRenamedEvent delegateEvent = new ValueRenamedEvent( e.getConnection(), this, e.getOldValue(), e
                    .getNewValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
        }
    }
View Full Code Here

            oldValues[i].getAttribute().deleteValue( oldValues[i] );

            if ( this.event == null )
            {
                this.event = new ValueRenamedEvent( entry.getBrowserConnection(), entry, oldValues[0], newValues[0] );
            }
        }

        if ( !monitor.errorsReported() )
        {
View Full Code Here

                    .getModifiedAttribute(), e.getOldValue(), e.getNewValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            else if ( event instanceof ValueRenamedEvent )
            {
                ValueRenamedEvent e = ( ValueRenamedEvent ) event;
                ValueRenamedEvent delegateEvent = new ValueRenamedEvent( e.getConnection(), this, e
                    .getOldValue(), e.getNewValue() );
                EventRegistry.fireEntryUpdated( delegateEvent, this );
            }
            // ValuesSetEvent
View Full Code Here

            viewer.setSelection( new StructuredSelection( vmEvent.getNewValue() ), true );
        }
        else if ( event instanceof ValueRenamedEvent )
        {
            // select the renamed value
            ValueRenamedEvent vrEvent = ( ValueRenamedEvent ) event;
            viewer.setSelection( new StructuredSelection( vrEvent.getNewValue() ), true );
        }
    }
View Full Code Here

TOP

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

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.