directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r569426 - in /directory/studio/trunk/studio-apacheds-schemaeditor: plugin.xml src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorSchemaCheckerLabelDecorator.java
Date Fri, 24 Aug 2007 15:51:52 GMT
Author: pamarcelot
Date: Fri Aug 24 08:51:51 2007
New Revision: 569426

URL: http://svn.apache.org/viewvc?rev=569426&view=rev
Log:
Improved SchemaCheckerLabelDecorator to also decorate the Folders.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorSchemaCheckerLabelDecorator.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml?rev=569426&r1=569425&r2=569426&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml (original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml Fri Aug 24 08:51:51 2007
@@ -265,6 +265,9 @@
                 <objectClass
                       name="org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.SchemaWrapper">
                 </objectClass>
+                <objectClass
+                      name="org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.Folder">
+                </objectClass>
              </or>
           </enablement>
           <description>

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorSchemaCheckerLabelDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorSchemaCheckerLabelDecorator.java?rev=569426&r1=569425&r2=569426&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorSchemaCheckerLabelDecorator.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorSchemaCheckerLabelDecorator.java
Fri Aug 24 08:51:51 2007
@@ -26,7 +26,9 @@
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
 import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaChecker;
+import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.Folder.FolderType;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.AttributeTypeWrapper;
+import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.Folder;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ObjectClassWrapper;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.SchemaWrapper;
 import org.eclipse.jface.viewers.IDecoration;
@@ -118,6 +120,48 @@
                 {
                     decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                         PluginConstants.IMG_OVERLAY_WARNING ), IDecoration.BOTTOM_LEFT );
+                }
+            }
+        }
+        else if ( element instanceof Folder )
+        {
+            Folder folder = ( Folder ) element;
+            Schema schema = ( ( SchemaWrapper ) folder.getParent() ).getSchema();
+
+            if ( folder.getType().equals( FolderType.ATTRIBUTE_TYPE ) )
+            {
+                for ( AttributeTypeImpl at : schema.getAttributeTypes() )
+                {
+                    if ( schemaChecker.hasErrors( at ) )
+                    {
+                        decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin(
Activator.PLUGIN_ID,
+                            PluginConstants.IMG_OVERLAY_ERROR ), IDecoration.BOTTOM_LEFT
);
+                        return;
+                    }
+
+                    if ( schemaChecker.hasWarnings( at ) )
+                    {
+                        decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin(
Activator.PLUGIN_ID,
+                            PluginConstants.IMG_OVERLAY_WARNING ), IDecoration.BOTTOM_LEFT
);
+                    }
+                }
+            }
+            else if ( folder.getType().equals( FolderType.OBJECT_CLASS ) )
+            {
+                for ( ObjectClassImpl oc : schema.getObjectClasses() )
+                {
+                    if ( schemaChecker.hasErrors( oc ) )
+                    {
+                        decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin(
Activator.PLUGIN_ID,
+                            PluginConstants.IMG_OVERLAY_ERROR ), IDecoration.BOTTOM_LEFT
);
+                        return;
+                    }
+
+                    if ( schemaChecker.hasWarnings( oc ) )
+                    {
+                        decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin(
Activator.PLUGIN_ID,
+                            PluginConstants.IMG_OVERLAY_WARNING ), IDecoration.BOTTOM_LEFT
);
+                    }
                 }
             }
         }



Mime
View raw message