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

Examples of org.apache.directory.studio.ldapbrowser.core.model.IValue


                        for ( Object element : ( ( IStructuredSelection ) event.getSelection() ).toArray() )
                        {
                            if ( element instanceof IValue )
                            {
                                // select the value
                                IValue value = ( IValue ) element;
                                selectionList.add( value );
                            }
                            else if ( element instanceof IAttribute )
                            {
                                // select attribute and all values
View Full Code Here


            }

            // Value
            else if ( element instanceof IValue )
            {
                IValue value = ( IValue ) element;
                return Utils.getShortenedString( value.getStringValue(), 20 );
            }

            else
            {
                return ""; //$NON-NLS-1$
View Full Code Here

        {
            String description = attributes[i].getDescription();
            IValue[] values = attributes[i].getValues();
            for ( int ii = 0; ii < values.length; ii++ )
            {
                IValue value = values[ii];
                Object rawValue = value.getRawValue();
                if ( jndiAttributes.get( description ) != null )
                {
                    jndiAttributes.get( description ).add( rawValue );
                }
                else
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 );

        modifyValue( attribute.getEntry().getBrowserConnection(), attribute.getEntry(), oldValue, newValue, monitor );
        if ( !monitor.errorsReported() )
        {
            createdNewValue = newValue;
View Full Code Here

                            it.remove();
                        }
                    }
                    for ( Iterator<IValue> it = valueList.iterator(); it.hasNext(); )
                    {
                        IValue value = it.next();
                        if ( value.isEmpty() )
                        {
                            value.getAttribute().deleteEmptyValue();
                            it.remove();
                        }
                    }

                    if ( !attributeList.isEmpty() || !valueList.isEmpty() )
View Full Code Here

                            it.remove();
                        }
                    }
                    for ( Iterator<IValue> it = valueList.iterator(); it.hasNext(); )
                    {
                        IValue value = it.next();
                        if ( value.isEmpty() )
                        {
                            value.getAttribute().deleteEmptyValue();
                            it.remove();
                        }
                    }

                    if ( !attributeList.isEmpty() || !valueList.isEmpty() )
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 );

        modifyValue( attribute.getEntry().getBrowserConnection(), attribute.getEntry(), oldValue, newValue, monitor );
        if ( !monitor.errorsReported() )
        {
            createdNewValue = newValue;
View Full Code Here


    protected Control createContents( Composite parent )
    {

        IValue value = getValue( getElement() );

        Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
        Composite mainGroup = BaseWidgetUtils.createColumnContainer( composite, 2, 1 );

        BaseWidgetUtils.createLabel( mainGroup, "Attribute Description:", 1 );
        descriptionText = BaseWidgetUtils.createLabeledText( mainGroup, "", 1 );

        BaseWidgetUtils.createLabel( mainGroup, "Value Type:", 1 );
        typeText = BaseWidgetUtils.createLabeledText( mainGroup, "", 1 );

        BaseWidgetUtils.createLabel( mainGroup, "Value Size:", 1 );
        sizeText = BaseWidgetUtils.createLabeledText( mainGroup, "", 1 );

        BaseWidgetUtils.createLabel( mainGroup, "Data:", 1 );
        if ( value != null && value.isString() )
        {
            valueText = new Text( mainGroup, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY );
            valueText.setFont( JFaceResources.getFont( JFaceResources.TEXT_FONT ) );
            GridData gd = new GridData( GridData.FILL_BOTH );
            gd.widthHint = convertHorizontalDLUsToPixels( ( int ) ( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2 ) );
            gd.heightHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 4 );
            valueText.setLayoutData( gd );
            valueText.setBackground( parent.getBackground() );
        }
        else
        {
            valueText = BaseWidgetUtils.createLabeledText( mainGroup, "", 1 );
        }

        if ( value != null )
        {
            super.setMessage( "Value "
                + org.apache.directory.studio.connection.core.Utils.shorten( value.toString(), 30 ) );

            descriptionText.setText( value.getAttribute().getDescription() );
            // valueText.setText(LdifUtils.mustEncode(value.getBinaryValue())?"Binary":value.getStringValue());
            valueText.setText( value.isString() ? value.getStringValue() : "Binary" );
            typeText.setText( value.isString() ? "String" : "Binary" );

            int bytes = value.getBinaryValue().length;
            int chars = value.isString() ? value.getStringValue().length() : 0;
            String size = value.isString() ? chars + ( chars > 1 ? " Characters, " : " Character, " ) : "";
            size += Utils.formatBytes( bytes );
            sizeText.setText( size );
        }

        return parent;
View Full Code Here

    }


    private static IValue getValue( Object element )
    {
        IValue value = null;
        if ( element instanceof IAdaptable )
        {
            value = ( IValue ) ( ( IAdaptable ) element ).getAdapter( IValue.class );
        }
        return value;
View Full Code Here

        super.setVisible( visible );

        if ( visible )
        {
            DummyEntry newEntry = wizard.getPrototypeEntry();
            IValue editValue = null;

            try
            {
                EventRegistry.suspendEventFireingInCurrentThread();
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.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.