directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r556962 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SchemaViewContentProvider.java
Date Tue, 17 Jul 2007 16:35:53 GMT
Author: pamarcelot
Date: Tue Jul 17 09:35:47 2007
New Revision: 556962

URL: http://svn.apache.org/viewvc?view=rev&rev=556962
Log:
Modified the way of creating the wrappers.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SchemaViewContentProvider.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SchemaViewContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SchemaViewContentProvider.java?view=diff&rev=556962&r1=556961&r2=556962
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SchemaViewContentProvider.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SchemaViewContentProvider.java
Tue Jul 17 09:35:47 2007
@@ -106,7 +106,25 @@
                 List<Schema> schemas = Activator.getDefault().getSchemaHandler().getSchemas();
                 for ( Schema schema : schemas )
                 {
-                    root.addChild( new SchemaWrapper( schema, root ) );
+                    SchemaWrapper schemaWrapper = new SchemaWrapper( schema, root );
+                    root.addChild( schemaWrapper );
+
+                    Folder atFolder = new Folder( FolderType.ATTRIBUTE_TYPE, schemaWrapper
);
+                    schemaWrapper.addChild( atFolder );
+                    Folder ocFolder = new Folder( FolderType.OBJECT_CLASS, schemaWrapper
);
+                    schemaWrapper.addChild( ocFolder );
+
+                    List<AttributeTypeImpl> attributeTypes = schema.getAttributeTypes();
+                    for ( AttributeTypeImpl attributeType : attributeTypes )
+                    {
+                        atFolder.addChild( new AttributeTypeWrapper( attributeType, atFolder
) );
+                    }
+
+                    List<ObjectClassImpl> objectClasses = schema.getObjectClasses();
+                    for ( ObjectClassImpl objectClass : objectClasses )
+                    {
+                        ocFolder.addChild( new ObjectClassWrapper( objectClass, ocFolder
) );
+                    }
                 }
             }
 
@@ -114,35 +132,11 @@
         }
         else if ( parentElement instanceof SchemaWrapper )
         {
-            SchemaWrapper schemaWrapper = ( SchemaWrapper ) parentElement;
-
-            if ( schemaWrapper.getChildren().isEmpty() )
-            {
-                Folder atFolder = new Folder( FolderType.ATTRIBUTE_TYPE, schemaWrapper );
-                schemaWrapper.addChild( atFolder );
-                Folder ocFolder = new Folder( FolderType.OBJECT_CLASS, schemaWrapper );
-                schemaWrapper.addChild( ocFolder );
-
-                List<AttributeTypeImpl> attributeTypes = schemaWrapper.getSchema().getAttributeTypes();
-                for ( AttributeTypeImpl attributeType : attributeTypes )
-                {
-                    atFolder.addChild( new AttributeTypeWrapper( attributeType, atFolder
) );
-                }
-
-                List<ObjectClassImpl> objectClasses = schemaWrapper.getSchema().getObjectClasses();
-                for ( ObjectClassImpl objectClass : objectClasses )
-                {
-                    ocFolder.addChild( new ObjectClassWrapper( objectClass, ocFolder ) );
-                }
-            }
-
-            children = schemaWrapper.getChildren();
+            children = ( ( SchemaWrapper ) parentElement ).getChildren();
         }
         else if ( parentElement instanceof Folder )
         {
-            Folder folder = ( Folder ) parentElement;
-
-            children = folder.getChildren();
+            children = ( ( Folder ) parentElement ).getChildren();
         }
 
         return children.toArray();
@@ -154,6 +148,7 @@
      */
     public Object getParent( Object element )
     {
+
         if ( element instanceof TreeNode )
         {
             return ( ( TreeNode ) element ).getParent();



Mime
View raw message