Package org.apache.directory.studio.schemaeditor.view.wrappers

Examples of org.apache.directory.studio.schemaeditor.view.wrappers.AttributeTypeWrapper


    {
        for ( TreeNode child : wrapper.getChildren() )
        {
            if ( child instanceof AttributeTypeWrapper )
            {
                AttributeTypeWrapper atw = ( AttributeTypeWrapper ) child;
                elementsToWrappersMap.remove( atw.getAttributeType(), child );
                removeRecursiveChildren( atw );
            }
            else if ( child instanceof ObjectClassWrapper )
            {
                ObjectClassWrapper ocw = ( ObjectClassWrapper ) child;
View Full Code Here


            Folder atFolder = new Folder( FolderType.ATTRIBUTE_TYPE, schemaWrapper );
            schemaWrapper.addChild( atFolder );

            for ( AttributeType attributeType : schema.getAttributeTypes() )
            {
                AttributeTypeWrapper atw = new AttributeTypeWrapper( attributeType, atFolder );
                atw.getParent().addChild( atw );
                elementsToWrappersMap.put( attributeType, atw );
            }

            Folder ocFolder = new Folder( FolderType.OBJECT_CLASS, schemaWrapper );
            schemaWrapper.addChild( ocFolder );

            for ( MutableObjectClass objectClass : schema.getObjectClasses() )
            {
                ObjectClassWrapper ocw = new ObjectClassWrapper( objectClass, ocFolder );
                ocw.getParent().addChild( ocw );
                elementsToWrappersMap.put( objectClass, ocw );
            }
        }
        else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
        {
            for ( AttributeType attributeType : schema.getAttributeTypes() )
            {
                AttributeTypeWrapper atw = new AttributeTypeWrapper( attributeType, schemaWrapper );
                atw.getParent().addChild( atw );
                elementsToWrappersMap.put( attributeType, atw );
            }

            for ( MutableObjectClass objectClass : schema.getObjectClasses() )
            {
View Full Code Here

        List<TreeNode> children = new ArrayList<TreeNode>();
        HierarchyManager hierarchyManager = new HierarchyManager();
        int mode = Activator.getDefault().getDialogSettings().getInt( PluginConstants.PREFS_HIERARCHY_VIEW_MODE );

        // Creating the wrapper of the attribute type
        AttributeTypeWrapper atw = new AttributeTypeWrapper( at );

        if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_TYPE )
        {
            // Creating the children's wrappers
            createChildrenHierarchy( atw, hierarchyManager.getChildren( at ), hierarchyManager );

            // Creating its parents' wrappers
            List<Object> parents = hierarchyManager.getParents( at );
            while ( ( parents != null ) && ( parents.size() == 1 ) )
            {
                Object parent = parents.get( 0 );
                if ( parent instanceof AttributeTypeImpl )
                {
                    AttributeTypeImpl parentAT = ( AttributeTypeImpl ) parent;

                    AttributeTypeWrapper atw2 = new AttributeTypeWrapper( parentAT );
                    atw.setParent( atw2 );
                    atw2.addChild( atw );

                    atw = atw2;

                    parents = hierarchyManager.getParents( parentAT );
                }
                else
                {
                    break;
                }
            }

            children.add( atw );
        }
        else if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE )
        {
            // Creating its parents' wrappers
            List<Object> parents = hierarchyManager.getParents( at );
            while ( ( parents != null ) && ( parents.size() == 1 ) )
            {
                Object parent = parents.get( 0 );
                if ( parent instanceof AttributeTypeImpl )
                {
                    AttributeTypeImpl parentAT = ( AttributeTypeImpl ) parent;

                    AttributeTypeWrapper atw2 = new AttributeTypeWrapper( parentAT );
                    atw.setParent( atw2 );
                    atw2.addChild( atw );

                    atw = atw2;

                    parents = hierarchyManager.getParents( parentAT );
                }
View Full Code Here

            {
                TreeNode childNode = null;
                if ( child instanceof AttributeTypeImpl )
                {
                    AttributeTypeImpl at = ( AttributeTypeImpl ) child;
                    childNode = new AttributeTypeWrapper( at, node );
                    node.addChild( childNode );
                }
                else if ( child instanceof ObjectClassImpl )
                {
                    ObjectClassImpl oc = ( ObjectClassImpl ) child;
View Full Code Here

            ObjectClassWrapper ocw = ( ObjectClassWrapper ) firstElement;
            openTypeHierarchy( ocw.getObjectClass() );
        }
        else if ( firstElement instanceof AttributeTypeWrapper )
        {
            AttributeTypeWrapper atw = ( AttributeTypeWrapper ) firstElement;
            openTypeHierarchy( atw.getAttributeType() );
        }
    }
View Full Code Here

                }
            }
            else if ( ( workbenchPart instanceof AttributeTypeEditor ) && ( wrapper instanceof AttributeTypeWrapper ) )
            {
                AttributeTypeEditor editor = ( AttributeTypeEditor ) workbenchPart;
                AttributeTypeWrapper atw = ( AttributeTypeWrapper ) wrapper;
                if ( editor.getOriginalAttributeType().equals( atw.getAttributeType() ) )
                {
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop( workbenchPart );
                    return;
                }
            }
View Full Code Here

                                // Creating the wrapper
                                if ( rootChild instanceof AttributeTypeImpl )
                                {
                                    AttributeTypeImpl at = ( AttributeTypeImpl ) rootChild;
                                    childNode = new AttributeTypeWrapper( at, atFolder );
                                    atFolder.addChild( childNode );
                                }
                                else if ( rootChild instanceof ObjectClassImpl )
                                {
                                    ObjectClassImpl oc = ( ObjectClassImpl ) rootChild;
View Full Code Here

            {
                TreeNode childNode = null;
                if ( child instanceof AttributeTypeImpl )
                {
                    AttributeTypeImpl at = ( AttributeTypeImpl ) child;
                    childNode = new AttributeTypeWrapper( at, node );
                    node.addChild( childNode );
                }
                else if ( child instanceof ObjectClassImpl )
                {
                    ObjectClassImpl oc = ( ObjectClassImpl ) child;
View Full Code Here

    {
        SchemaWrapper schemaWrapper = ( SchemaWrapper ) getWrapper( Activator.getDefault().getSchemaHandler()
            .getSchema( at.getSchema() ) );
        if ( schemaWrapper != null )
        {
            AttributeTypeWrapper atw = null;
            int group = store.getInt( PluginConstants.PREFS_SCHEMA_VIEW_GROUPING );
            if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
            {
                for ( TreeNode child : schemaWrapper.getChildren() )
                {
                    if ( ( ( Folder ) child ).getType() == FolderType.ATTRIBUTE_TYPE )
                    {
                        atw = new AttributeTypeWrapper( at, child );
                        break;
                    }
                }
            }
            else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
            {
                atw = new AttributeTypeWrapper( at, schemaWrapper );
            }

            atw.getParent().addChild( atw );
            elementsToWrappersMap.put( at, atw );
        }
    }
View Full Code Here

        if ( parents != null )
        {
            for ( Object parent : parents )
            {
                AttributeTypeWrapper parentATW = ( AttributeTypeWrapper ) getWrapper( parent );
                AttributeTypeWrapper atw = null;
                if ( parentATW == null )
                {
                    int group = store.getInt( PluginConstants.PREFS_SCHEMA_VIEW_GROUPING );
                    if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
                    {
                        for ( TreeNode child : root.getChildren() )
                        {
                            if ( child instanceof Folder )
                            {
                                Folder folder = ( Folder ) child;
                                if ( folder.getType().equals( FolderType.ATTRIBUTE_TYPE ) )
                                {
                                    atw = new AttributeTypeWrapper( at, folder );
                                    break;
                                }
                            }
                        }
                    }
                    else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
                    {
                        atw = new AttributeTypeWrapper( at, root );
                    }

                }
                else
                {
                    atw = new AttributeTypeWrapper( at, parentATW );
                }
                atw.getParent().addChild( atw );
                createdWrappers.add( atw );
                elementsToWrappersMap.put( at, atw );
            }
        }

        List<Object> children = hierarchyManager.getChildren( at );
        if ( children != null )
        {
            for ( Object child : children )
            {
                AttributeTypeWrapper childATW = ( AttributeTypeWrapper ) getWrapper( child );
                elementsToWrappersMap.remove( child );
                childATW.getParent().removeChild( childATW );

                for ( TreeNode createdWrapper : createdWrappers )
                {
                    AttributeTypeWrapper atw = new AttributeTypeWrapper( ( AttributeTypeImpl ) child, createdWrapper );
                    atw.getParent().addChild( atw );
                    elementsToWrappersMap.put( ( AttributeTypeImpl ) child, atw );
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.view.wrappers.AttributeTypeWrapper

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.