directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r556978 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor: ./ controller/ view/views/
Date Tue, 17 Jul 2007 17:24:34 GMT
Author: pamarcelot
Date: Tue Jul 17 10:24:32 2007
New Revision: 556978

URL: http://svn.apache.org/viewvc?view=rev&rev=556978
Log:
Fixed some problems with the ProblemsView.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/Activator.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsView.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsViewContentProvider.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/Activator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/Activator.java?view=diff&rev=556978&r1=556977&r2=556978
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/Activator.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/Activator.java
Tue Jul 17 10:24:32 2007
@@ -79,7 +79,6 @@
         projectsHandler = ProjectsHandler.getInstance();
         projectsHandler.addListener( new ProjectsHandlerListener()
         {
-
             public void openProjectChanged( Project oldProject, Project newProject )
             {
                 if ( newProject == null )

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java?view=diff&rev=556978&r1=556977&r2=556978
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
Tue Jul 17 10:24:32 2007
@@ -188,11 +188,6 @@
                     {
                         public void run()
                         {
-                            SchemaChecker schemaChecker = Activator.getDefault().getSchemaChecker();
-                            int errors = schemaChecker.getErrors().size();
-                            int warnings = schemaChecker.getWarnings().size();
-
-                            view.setErrorsAndWarningsCount( errors, warnings );
                             view.reloadViewer();
                         }
                     } );

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsView.java?view=diff&rev=556978&r1=556977&r2=556978
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsView.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsView.java
Tue Jul 17 10:24:32 2007
@@ -57,6 +57,9 @@
     /** The overview label */
     private Label overviewLabel;
 
+    /** The SchemaChecker */
+    private SchemaChecker schemaChecker;
+
 
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
@@ -75,7 +78,7 @@
         parent.setLayout( gridLayout );
 
         overviewLabel = new Label( parent, SWT.NULL );
-        overviewLabel.setText( "0 error, 0 warning" );
+        setErrorsAndWarningsCount( 0, 0 );
         overviewLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         initViewer( parent );
@@ -104,6 +107,8 @@
         contentProvider = new ProblemsViewContentProvider( treeViewer );
         treeViewer.setContentProvider( contentProvider );
         treeViewer.setLabelProvider( new ProblemsViewLabelProvider() );
+        treeViewer.setInput( new ProblemsViewRoot() );
+        treeViewer.expandAll();
     }
 
 
@@ -135,8 +140,16 @@
     {
         treeViewer.setInput( new ProblemsViewRoot() );
         treeViewer.expandAll();
-        SchemaChecker schemaChecker = Activator.getDefault().getSchemaChecker();
-        setErrorsAndWarningsCount( schemaChecker.getErrors().size(), schemaChecker.getWarnings().size()
);
+
+        schemaChecker = Activator.getDefault().getSchemaChecker();
+        if ( schemaChecker != null )
+        {
+            setErrorsAndWarningsCount( schemaChecker.getErrors().size(), schemaChecker.getWarnings().size()
);
+        }
+        else
+        {
+            setErrorsAndWarningsCount( 0, 0 );
+        }
     }
 
 
@@ -152,4 +165,5 @@
     {
         overviewLabel.setText( String.format( "%d error(s), %d warning(s)", errors, warnings
) );
     }
+    
 }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsViewContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsViewContentProvider.java?view=diff&rev=556978&r1=556977&r2=556978
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsViewContentProvider.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/ProblemsViewContentProvider.java
Tue Jul 17 10:24:32 2007
@@ -105,25 +105,28 @@
             {
                 SchemaChecker schemaChecker = Activator.getDefault().getSchemaChecker();
 
-                List<SchemaError> errors = schemaChecker.getErrors();
-                if ( !errors.isEmpty() )
+                if ( schemaChecker != null )
                 {
-                    Folder errorsFolder = new Folder( FolderType.ERROR, root );
-                    root.addChild( errorsFolder );
-                    for ( SchemaError error : errors )
+                    List<SchemaError> errors = schemaChecker.getErrors();
+                    if ( !errors.isEmpty() )
                     {
-                        errorsFolder.addChild( new SchemaErrorWrapper( error, errorsFolder
) );
+                        Folder errorsFolder = new Folder( FolderType.ERROR, root );
+                        root.addChild( errorsFolder );
+                        for ( SchemaError error : errors )
+                        {
+                            errorsFolder.addChild( new SchemaErrorWrapper( error, errorsFolder
) );
+                        }
                     }
-                }
 
-                List<SchemaWarning> warnings = schemaChecker.getWarnings();
-                if ( !warnings.isEmpty() )
-                {
-                    Folder warningsFolder = new Folder( FolderType.WARNING, root );
-                    root.addChild( warningsFolder );
-                    for ( SchemaWarning warning : warnings )
+                    List<SchemaWarning> warnings = schemaChecker.getWarnings();
+                    if ( !warnings.isEmpty() )
                     {
-                        warningsFolder.addChild( new SchemaWarningWrapper( warning, warningsFolder
) );
+                        Folder warningsFolder = new Folder( FolderType.WARNING, root );
+                        root.addChild( warningsFolder );
+                        for ( SchemaWarning warning : warnings )
+                        {
+                            warningsFolder.addChild( new SchemaWarningWrapper( warning, warningsFolder
) );
+                        }
                     }
                 }
             }



Mime
View raw message