directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1062905 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
Date Mon, 24 Jan 2011 18:13:18 GMT
Author: pamarcelot
Date: Mon Jan 24 18:13:18 2011
New Revision: 1062905

URL: http://svn.apache.org/viewvc?rev=1062905&view=rev
Log:
Handling of the case where the imported configuration file cannot be read correctly.

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

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java?rev=1062905&r1=1062904&r2=1062905&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
Mon Jan 24 18:13:18 2011
@@ -39,8 +39,10 @@ import org.eclipse.jface.action.Action;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
 import org.eclipse.ui.dialogs.ISelectionStatusValidator;
 import org.eclipse.ui.model.WorkbenchContentProvider;
@@ -168,8 +170,11 @@ public class EditorImportConfigurationAc
             }
 
             // Requiring a confirmation from the user
-            if ( !MessageDialog.openConfirm( editor.getSite().getShell(), "Overwrite Existing
Configuration",
-                "Are you sure you want to overwrite the existing configuration with the selected
file?" ) )
+            if ( !MessageDialog
+                .openConfirm(
+                    editor.getSite().getShell(),
+                    "Overwrite Existing Configuration",
+                    "Are you sure you want to overwrite the existing configuration with the
contents of the selected file?" ) )
             {
                 return;
             }
@@ -182,8 +187,13 @@ public class EditorImportConfigurationAc
         }
         catch ( Exception e )
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            MessageDialog
+                .openError(
+                    editor.getSite().getShell(),
+                    "Error Importing Configuration File",
+                    NLS.bind(
+                        "An error occurred when importing the selected file:\n{0}\n\nIt does
not seem to be a correct LDIF configuration file.",
+                        e.getMessage() ) );
         }
     }
 



Mime
View raw message