directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r556051 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor: controller/ProblemsViewController.java view/views/ProblemsView.java
Date Fri, 13 Jul 2007 16:04:16 GMT
Author: pamarcelot
Date: Fri Jul 13 09:04:16 2007
New Revision: 556051

URL: http://svn.apache.org/viewvc?view=rev&rev=556051
Log:
Added the ability to update the overview label of the Problems View.

Modified:
    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

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=556051&r1=556050&r2=556051
==============================================================================
--- 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
Fri Jul 13 09:04:16 2007
@@ -24,6 +24,7 @@
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
+import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaChecker;
 import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaCheckerListener;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
@@ -33,7 +34,6 @@
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.Folder;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.SchemaErrorWrapper;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.SchemaWarningWrapper;
-import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -89,7 +89,7 @@
      */
     private void initToolbar()
     {
-        IToolBarManager toolbar = view.getViewSite().getActionBars().getToolBarManager();
+//        IToolBarManager toolbar = view.getViewSite().getActionBars().getToolBarManager();
     }
 
 
@@ -184,6 +184,11 @@
                 {
                     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=556051&r1=556050&r2=556051
==============================================================================
--- 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
Fri Jul 13 09:04:16 2007
@@ -53,6 +53,9 @@
     /** The content provider of the viewer */
     private ProblemsViewContentProvider contentProvider;
 
+    /** The overview label */
+    private Label overviewLabel;
+
 
     /* (non-Javadoc)
      * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
@@ -70,8 +73,8 @@
         gridLayout.verticalSpacing = 0;
         parent.setLayout( gridLayout );
 
-        Label overviewLabel = new Label( parent, SWT.NULL );
-        overviewLabel.setText( "X error(s), X warning(s)" );
+        overviewLabel = new Label( parent, SWT.NULL );
+        overviewLabel.setText( "0 error, 0 warning" );
         overviewLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         initViewer( parent );
@@ -133,5 +136,19 @@
     {
         treeViewer.setInput( new ProblemsViewRoot() );
         treeViewer.expandAll();
+    }
+
+
+    /**
+     * Refresh the overview label with the number of errors and warnings
+     *
+     * @param errors
+     *      the number of errors
+     * @param warnings
+     *      the number of warnings
+     */
+    public void setErrorsAndWarningsCount( int errors, int warnings )
+    {
+        overviewLabel.setText( String.format( "%d error(s), %d warning(s)", errors, warnings
) );
     }
 }



Mime
View raw message