directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1378101 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ErrorPage.java
Date Tue, 28 Aug 2012 12:20:00 GMT
Author: pamarcelot
Date: Tue Aug 28 12:19:59 2012
New Revision: 1378101

URL: http://svn.apache.org/viewvc?rev=1378101&view=rev
Log:
Improved the error page.
Prevented a potential NPE in the case the exception is null.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ErrorPage.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ErrorPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ErrorPage.java?rev=1378101&r1=1378100&r2=1378101&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ErrorPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ErrorPage.java
Tue Aug 28 12:19:59 2012
@@ -104,8 +104,7 @@ public class ErrorPage extends FormPage
         toolkit.decorateFormHeading( form.getForm() );
 
         // Error Label
-        Label errorLabel = toolkit.createLabel( parent,
-            NLS.bind( "Could not open the editor: {0}", exception.getMessage() ) ); //$NON-NLS-1$
+        Label errorLabel = toolkit.createLabel( parent, "" );
         errorLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Details Button
@@ -114,12 +113,22 @@ public class ErrorPage extends FormPage
         detailsButton.setLayoutData( new GridData( SWT.RIGHT, SWT.NONE, false, false ) );
         detailsButton.addSelectionListener( new SelectionAdapter()
         {
-            @Override
             public void widgetSelected( SelectionEvent e )
             {
                 showOrHideDetailsView();
             }
         } );
+
+        // Initializing with the exception
+        if ( exception == null )
+        {
+            errorLabel.setText( "Could not open the editor." );
+            detailsButton.setVisible( false );
+        }
+        else
+        {
+            errorLabel.setText( NLS.bind( "Could not open the editor: {0}", exception.getMessage()
) ); //$NON-NLS-1$
+        }
     }
 
 



Mime
View raw message