if ( schemaHandler != null )
{
List<Schema> schemas = schemaHandler.getSchemas();
for ( Schema schema : schemas )
{
SchemaWrapper schemaWrapper = new SchemaWrapper( schema, root );
root.addChild( schemaWrapper );
if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )
{
Folder atFolder = new Folder( FolderType.ATTRIBUTE_TYPE, schemaWrapper );
schemaWrapper.addChild( atFolder );
for ( AttributeTypeImpl attributeType : schema.getAttributeTypes() )
{
atFolder.addChild( new AttributeTypeWrapper( attributeType, atFolder ) );
}
Folder ocFolder = new Folder( FolderType.OBJECT_CLASS, schemaWrapper );
schemaWrapper.addChild( ocFolder );
for ( ObjectClassImpl objectClass : schema.getObjectClasses() )
{
ocFolder.addChild( new ObjectClassWrapper( objectClass, ocFolder ) );
}
}
else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )
{
for ( AttributeTypeImpl attributeType : schema.getAttributeTypes() )
{
schemaWrapper.addChild( new AttributeTypeWrapper( attributeType, schemaWrapper ) );
}
for ( ObjectClassImpl objectClass : schema.getObjectClasses() )
{
schemaWrapper.addChild( new ObjectClassWrapper( objectClass, schemaWrapper ) );
}
}
}
}
}