Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 3793 invoked from network); 14 Jan 2011 16:09:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2011 16:09:01 -0000 Received: (qmail 57194 invoked by uid 500); 14 Jan 2011 16:09:01 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 57130 invoked by uid 500); 14 Jan 2011 16:08:59 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 57123 invoked by uid 99); 14 Jan 2011 16:08:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 16:08:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 16:08:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7686723889E7; Fri, 14 Jan 2011 16:08:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110114160830.7686723889E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 );