Package org.apache.directory.ldapstudio.schemas.model

Examples of org.apache.directory.ldapstudio.schemas.model.AttributeType


                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_AUXILIARY ), IDecoration.BOTTOM_RIGHT );
            }
        }
        else if ( element instanceof AttributeType )
        {
            AttributeType at = ( AttributeType ) element;

            UsageEnum usage = at.getUsage();

            if ( usage == UsageEnum.USER_APPLICATIONS )
            {
                decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                    PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_USER_APPLICATION ), IDecoration.BOTTOM_RIGHT );
View Full Code Here


    public Object[] getElements( Object inputElement )
    {
        if ( inputElement instanceof AttributeType )
        {
            List<ObjectClass> results = new ArrayList<ObjectClass>();
            AttributeType inputAT = ( AttributeType ) inputElement;
            SchemaPool schemaPool = SchemaPool.getInstance();

            List<String> names = new ArrayList<String>();
            for ( String name : inputAT.getNames() )
            {
                names.add( name.toLowerCase() );
            }

            List<ObjectClass> objectClasses = schemaPool.getObjectClasses();
View Full Code Here

        }
        else
        {
            if ( item == DeleteAction.ItemType.attributeType )
            {
                AttributeType attributeType = ( ( AttributeTypeWrapper ) selection ).getMyAttributeType();
                MessageBox messageBox = new MessageBox(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK | SWT.CANCEL
                        | SWT.ICON_QUESTION );
                messageBox
                    .setMessage( Messages.getString( "DeleteAction.Are_you_sure_you_want_to_delete_the_attribute_type" ) + attributeType.getNames()[0] + Messages.getString( "DeleteAction.Interrogation" ) ); //$NON-NLS-1$ //$NON-NLS-2$
                if ( messageBox.open() == SWT.OK )
                {
                    schema.removeAttributeType( attributeType );
                }
            }
View Full Code Here

            List<Object> results = new ArrayList<Object>();

            String[] attributes = ( String[] ) inputElement;
            for ( String attribute : attributes )
            {
                AttributeType at = schemaPool.getAttributeType( attribute );
                if ( at != null )
                {
                    results.add( at );
                }
                else
View Full Code Here

        {
            // Superior
            String supName = at.getSuperior();
            if ( supName != null )
            {
                AttributeType sup = schemaPool.getAttributeType( supName );
                if ( sup != null )
                {
                    if ( !schema.equals( sup.getOriginatingSchema() ) )
                    {
                        schemaNames.add( sup.getOriginatingSchema().getName() );
                    }
                }
            }
        }

        // Looping on Object Classes
        for ( ObjectClass oc : schema.getObjectClassesAsArray() )
        {
            // Superiors
            for ( String supName : oc.getSuperiors() )
            {
                ObjectClass sup = schemaPool.getObjectClass( supName );
                if ( sup != null )
                {
                    if ( !schema.equals( sup.getOriginatingSchema() ) )
                    {
                        schemaNames.add( sup.getOriginatingSchema().getName() );
                    }
                }
            }

            // Mays
            for ( String mayName : oc.getMay() )
            {
                AttributeType may = schemaPool.getAttributeType( mayName );
                if ( may != null )
                {
                    if ( !schema.equals( may.getOriginatingSchema() ) )
                    {
                        schemaNames.add( may.getOriginatingSchema().getName() );
                    }
                }
            }

            // Musts
            for ( String mustName : oc.getMust() )
            {
                AttributeType must = schemaPool.getAttributeType( mustName );
                if ( must != null )
                {
                    if ( !schema.equals( must.getOriginatingSchema() ) )
                    {
                        schemaNames.add( must.getOriginatingSchema().getName() );
                    }
                }
            }
        }
View Full Code Here

        DisplayableTreeElement wrapper = null;

        // Only editors for attribute types and object class are accepted
        if ( editorID.equals( AttributeTypeFormEditor.ID ) )
        {
            AttributeType at = SchemaPool.getInstance().getAttributeType( editorName );
            wrapper = new AttributeTypeWrapper( at, null );
            structuredSelection = new StructuredSelection( wrapper );

            schemasView.getViewer().setSelection( structuredSelection, true );
        }
View Full Code Here

        DisplayableTreeElement wrapper = null;

        // Only editors for attribute types and object class are accepted
        if ( editorID.equals( AttributeTypeFormEditor.ID ) )
        {
            AttributeType at = SchemaPool.getInstance().getAttributeType( editorName );
            wrapper = new AttributeTypeWrapper( at, null );
            structuredSelection = new StructuredSelection( wrapper );

            hierarchyView.getViewer().setSelection( structuredSelection, true );
        }
View Full Code Here

            }
            else
            {
                if ( item == DeleteAction.ItemType.attributeType )
                {
                    AttributeType attributeType = ( ( AttributeTypeWrapper ) selection ).getMyAttributeType();
                    MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                        .getShell(), SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION );
                    messageBox
                        .setMessage( Messages
                            .getString( "DeleteAction.Are_you_sure_you_want_to_delete_the_attribute_type" ) + attributeType.getNames()[0] + Messages.getString( "DeleteAction.Interrogation" ) ); //$NON-NLS-1$ //$NON-NLS-2$
                    if ( messageBox.open() == SWT.OK )
                    {
                        schema.removeAttributeType( attributeType );
                    }
                }
View Full Code Here

    public void setUp()
    {
        elementChanged = false;
        schema = new Schema( "test" ); //$NON-NLS-1$
        at = new AttributeType( new AttributeTypeLiteral( "1.2.3" ), schema ); //$NON-NLS-1$
        oc = new ObjectClass( new ObjectClassLiteral( "4.5.6" ), schema ); //$NON-NLS-1$
        schema.addAttributeType( at );
        schema.addObjectClass( oc );
    }
View Full Code Here

        if ( attributeTypes.length != 0 )
        {
            for ( int i = 0; i < attributeTypes.length; i++ )
            {
                AttributeType attributeType = attributeTypes[i];
                sb.append( attributeType.write() );
                sb.append( "\n" ); //$NON-NLS-1$
            }
        }
        if ( objectClasses.length != 0 )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.schemas.model.AttributeType

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.