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

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


                        IAttribute newAttribute = new Attribute( newEntry, attributeToCopy.getDescription() );
                        newEntry.addAttribute( newAttribute );
                        IValue[] valuesToCopy = attributeToCopy.getValues();
                        for ( int j = 0; j < valuesToCopy.length; j++ )
                        {
                            IValue valueToCopy = valuesToCopy[j];
                            IValue newValue = new Value( newAttribute, valueToCopy.getRawValue() );
                            newAttribute.addValue( newValue );
                        }
                    }
                }
View Full Code Here


        monitor.beginTask( BrowserCoreMessages.jobs__modify_value_task, 2 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        IValue newValue = new Value( attribute, newRawValue );
        attribute.modifyValue( oldValue, newValue );
        attribute.getEntry().getConnection().modify( oldValue, newValue, monitor );

        this.event = new ValueModifiedEvent( attribute.getEntry().getConnection(), attribute.getEntry(), attribute,
            oldValue, newValue );
View Full Code Here

     */
    public void addEmptyValue()
    {
        try
        {
            IValue emptyValue = new Value( this );
            valueList.add( emptyValue );
            this.attributeModified( new EmptyValueAddedEvent( getEntry().getConnection(), getEntry(), this, emptyValue ) );
        }
        catch ( ModelModificationException mme )
        {
View Full Code Here

     */
    public void deleteEmptyValue()
    {
        for ( Iterator it = this.valueList.iterator(); it.hasNext(); )
        {
            IValue value = ( IValue ) it.next();
            if ( value.isEmpty() )
            {
                it.remove();
                attributeModified( new EmptyValueDeletedEvent( getEntry().getConnection(), getEntry(), this, value ) );
                return;
            }
View Full Code Here

     */
    private boolean internalDeleteValue( IValue valueToDelete )
    {
        for ( Iterator it = valueList.iterator(); it.hasNext(); )
        {
            IValue value = ( IValue ) it.next();
            if ( value.equals( valueToDelete ) )
            {
                it.remove();
                return true;
            }
        }
View Full Code Here

    public int compare( Object o1, Object o2 )
    {

        IAttribute attribute1 = null;
        IValue value1 = null;
        if ( o1 instanceof IAttribute )
        {
            attribute1 = ( IAttribute ) o1;
        }
        else if ( o1 instanceof IValue )
        {
            value1 = ( IValue ) o1;
            attribute1 = value1.getAttribute();
        }
        else if ( o1 instanceof LdifAttrValLine )
        {
            LdifAttrValLine line1 = ( LdifAttrValLine ) o1;
            value1 = ModelConverter.ldifAttrValLineToValue( line1, dummyEntry );
            attribute1 = value1.getAttribute();
        }

        IAttribute attribute2 = null;
        IValue value2 = null;
        if ( o2 instanceof IAttribute )
        {
            attribute2 = ( IAttribute ) o2;
        }
        else if ( o2 instanceof IValue )
        {
            value2 = ( IValue ) o2;
            attribute2 = value2.getAttribute();
        }
        else if ( o2 instanceof LdifAttrValLine )
        {
            LdifAttrValLine line2 = ( LdifAttrValLine ) o2;
            value2 = ModelConverter.ldifAttrValLineToValue( line2, dummyEntry );
            attribute2 = value2.getAttribute();
        }

        if ( value1 != null && value2 != null )
        {
            if ( this.getSortByOrDefault() == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION )
            {
                if ( value1.getAttribute() != value2.getAttribute() )
                {
                    return this.compareAttributeNames( value1.getAttribute(), value2.getAttribute() );
                }
                else
                {
                    return this.compareValues( value1, value2 );
                }
View Full Code Here

        StringBuffer sb = new StringBuffer();
        if ( valueList.size() > 1 )
            sb.append( valueList.size() + " values: " );
        for ( Iterator it = valueList.iterator(); it.hasNext(); )
        {
            IValue value = ( IValue ) it.next();
            IValueEditor vp = this.valueEditorManager.getCurrentValueEditor( value );
            sb.append( vp.getDisplayValue( value ) );
            if ( it.hasNext() )
                sb.append( ", " );
        }
View Full Code Here

                                        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 );
                                                }
                                            }
                                        }
View Full Code Here

            return true;
        }
        else if ( element instanceof IValue )
        {
            IValue value = ( IValue ) element;

            // check quick filter
            if ( !goesThroughQuickFilter( value ) )
            {
                return false;
            }

            // filter attribute types
            if ( value.getAttribute().isObjectClassAttribute() )
            {
                return isShowObjectClassAttribute();
            }
            else if ( value.getAttribute().isMustAttribute() )
            {
                return isShowMustAttributes();
            }
            else if ( value.getAttribute().isMayAttribute() )
            {
                return isShowMayAttributes();
            }
            else if ( value.getAttribute().isOperationalAttribute() )
            {
                return isShowOperationalAttributes();
            }
            else
            {
View Full Code Here

     */
    public boolean canModify( Object element, String property )
    {
        if ( element != null && element instanceof IValue && valueEditorManager != null )
        {
            IValue attributeValue = ( IValue ) element;

            if ( !SchemaUtils.isModifyable( attributeValue.getAttribute().getAttributeTypeDescription() ) )
            {
                return false;
            }
            if ( attributeValue.isRdnPart() )
            {
                return false;
            }
            if ( EntryEditorWidgetTableMetadata.KEY_COLUMN_NAME.equals( property ) )
            {
View Full Code Here

TOP

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

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.