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

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


        // Creating the new attribute type and adding it to the schema
        AttributeTypeLiteral attributeTypeLiteral = new AttributeTypeLiteral( this.page.getOidField() );
        attributeTypeLiteral.setNames( new String[]
            { this.page.getNameField() } );
        AttributeType attributeType = new AttributeType( attributeTypeLiteral, schema );
        schema.addAttributeType( attributeType );

        // Opening the associated editor
        AttributeTypeEditorInput input = new AttributeTypeEditorInput( attributeType );
        String editorId = AttributeTypeEditor.ID;
View Full Code Here


            children = new ArrayList<ITreeNode>();
            children.add( ocw );
        }
        else if ( parentElement instanceof AttributeType )
        {
            AttributeType at = ( AttributeType ) parentElement;

            AttributeTypeWrapper atw = new AttributeTypeWrapper( at, null );
            children = new ArrayList<ITreeNode>();
            children.add( atw );
        }
        else if ( parentElement instanceof ObjectClassWrapper )
        {
            ObjectClassWrapper ocw = ( ObjectClassWrapper ) parentElement;
            ObjectClass oc = ocw.getMyObjectClass();

            if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE )
            {
                String[] superiors = oc.getSuperiors();
                for ( String superior : superiors )
                {
                    if ( superior != null || "".equals( superior ) ) //$NON-NLS-1$
                    {
                        ObjectClass supOC = schemaPool.getObjectClass( superior );
                        if ( supOC != null )
                        {
                            ObjectClassWrapper supOCW = new ObjectClassWrapper( supOC, ocw );
                            ocw.addChild( supOCW );
                        }
                    }
                }
            }
            else if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUBTYPE )
            {
                for ( ObjectClass objectClass : objectClasses )
                {
                    String[] superiors = objectClass.getSuperiors();
                    for ( String superior : superiors )
                    {
                        if ( superior != null || "".equals( superior ) ) //$NON-NLS-1$
                        {
                            ObjectClass supOC = schemaPool.getObjectClass( superior );
                            if ( supOC != null && oc.equals( supOC ) )
                            {
                                ObjectClassWrapper supOCW = new ObjectClassWrapper( objectClass, ocw );
                                ocw.addChild( supOCW );
                            }
                        }
                    }
                }
            }

            children = ocw.getChildren();
        }
        else if ( parentElement instanceof AttributeTypeWrapper )
        {
            AttributeTypeWrapper atw = ( AttributeTypeWrapper ) parentElement;
            AttributeType at = atw.getMyAttributeType();

            if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE )
            {
                String superior = at.getSuperior();
                if ( superior != null || "".equals( superior ) ) //$NON-NLS-1$
                {
                    AttributeType supAT = schemaPool.getAttributeType( superior );
                    if ( supAT != null )
                    {
                        AttributeTypeWrapper supATW = new AttributeTypeWrapper( supAT, atw );
                        atw.addChild( supATW );
                    }
                }
            }
            else if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUBTYPE )
            {
                for ( AttributeType attributeType : attributeTypes )
                {
                    String superior = attributeType.getSuperior();
                    if ( superior != null && !"".equals( superior ) ) //$NON-NLS-1$
                    {
                        AttributeType supAT = schemaPool.getAttributeType( superior );
                        if ( supAT != null && at.equals( supAT ) )
                        {
                            AttributeTypeWrapper supATW = new AttributeTypeWrapper( attributeType, atw );
                            atw.addChild( supATW );
                        }
View Full Code Here

        }
        else
        {
            String supAtName = modifiedAttributeType.getSuperior();

            AttributeType supAT = schemaPool.getAttributeType( supAtName );
            if ( supAT != null )
            {
                supComboViewer.setSelection( new StructuredSelection( supAT ), true );
            }
            else
View Full Code Here

        {
            ATESuperiorComboInput input = ( ATESuperiorComboInput ) inputElement;

            if ( input.getChildren().isEmpty() )
            {
                AttributeType editorAT = input.getAttributeType();

                // Creating the '(None)' item
                input.addChild( new NonExistingAttributeType( NonExistingAttributeType.NONE ) );

                // Creating Children
View Full Code Here

            {
                return false;
            }
            else
            {
                AttributeType supAT = schemaPool.getAttributeType( sup );
                if ( supAT == null )
                {
                    return false;
                }
                else
View Full Code Here

     */
    public int compare( ITreeNode o1, ITreeNode o2 )
    {
        if ( ( o1 instanceof AttributeTypeWrapper ) && ( o2 instanceof AttributeTypeWrapper ) )
        {
            AttributeType at1 = ( ( AttributeTypeWrapper ) o1 ).getMyAttributeType();
            AttributeType at2 = ( ( AttributeTypeWrapper ) o2 ).getMyAttributeType();

            return at1.getNames()[0].compareToIgnoreCase( at2.getNames()[0] );
        }
        else if ( ( o1 instanceof ObjectClassWrapper ) && ( o2 instanceof ObjectClassWrapper ) )
        {
            ObjectClass oc1 = ( ( ObjectClassWrapper ) o1 ).getMyObjectClass();
            ObjectClass oc2 = ( ( ObjectClassWrapper ) o2 ).getMyObjectClass();
View Full Code Here

     */
    public int compare( ITreeNode o1, ITreeNode o2 )
    {
        if ( ( o1 instanceof AttributeTypeWrapper ) && ( o2 instanceof AttributeTypeWrapper ) )
        {
            AttributeType at1 = ( ( AttributeTypeWrapper ) o1 ).getMyAttributeType();
            AttributeType at2 = ( ( AttributeTypeWrapper ) o2 ).getMyAttributeType();

            return at1.getOid().compareToIgnoreCase( at2.getOid() );
        }
        else if ( ( o1 instanceof ObjectClassWrapper ) && ( o2 instanceof ObjectClassWrapper ) )
        {
            ObjectClass oc1 = ( ( ObjectClassWrapper ) o1 ).getMyObjectClass();
            ObjectClass oc2 = ( ( ObjectClassWrapper ) o2 ).getMyObjectClass();
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

     */
    public String getColumnText( Object element, int columnIndex )
    {
        if ( element instanceof AttributeTypeWrapper )
        {
            AttributeType at = ( ( AttributeTypeWrapper ) element ).getMyAttributeType();
            return ViewUtils.concateAliases( at.getNames() ) + "   [" + at.getOid() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
        }

        // Default
        return null;
    }
View Full Code Here

    {
        hiddenAttributeTypes = new ArrayList<AttributeType>();

        for ( String name : names )
        {
            AttributeType at = schemaPool.getAttributeType( name );
            if ( at != null )
            {
                hiddenAttributeTypes.add( at );
            }
        }
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.