directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1059052 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorImportConfigurationAction.java
Date Fri, 14 Jan 2011 16:08:30 GMT
Author: pamarcelot
Date: Fri Jan 14 16:08:30 2011
New Revision: 1059052

URL: http://svn.apache.org/viewvc?rev=1059052&view=rev
Log:
Added a confirmation dialog before swapping to the new configuration.

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=1059052&r1=1059051&r2=1059052&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
Fri Jan 14 16:08:30 2011
@@ -37,6 +37,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 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.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
@@ -96,8 +97,6 @@ public class EditorImportConfigurationAc
     {
         try
         {
-            // TODO Add confirmation ?
-
             // The input stream that will be used to load the configuration
             InputStream inputStream = null;
 
@@ -153,6 +152,13 @@ public class EditorImportConfigurationAc
                 return;
             }
 
+            // 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?" ) )
+            {
+                return;
+            }
+
             // Reading the configuration of the file
             ConfigBean configBean = LoadConfigurationRunnable.readConfiguration( inputStream
);
 



Mime
View raw message