directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1063259 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
Date Tue, 25 Jan 2011 12:51:38 GMT
Author: pamarcelot
Date: Tue Jan 25 12:51:38 2011
New Revision: 1063259

URL: http://svn.apache.org/viewvc?rev=1063259&view=rev
Log:
Handling of the case where exporting configuration file fails.

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

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.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/EditorExportConfigurationAction.java?rev=1063259&r1=1063258&r2=1063259&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
Tue Jan 25 12:51:38 2011
@@ -21,16 +21,15 @@
 package org.apache.directory.studio.apacheds.configuration.v2.actions;
 
 
-import java.lang.reflect.InvocationTargetException;
-
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPluginConstants;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditor;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditorUtils;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jface.action.Action;
-import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
 
 
 /**
@@ -82,28 +81,13 @@ public class EditorExportConfigurationAc
     {
         try
         {
-            editor.getSite().getWorkbenchWindow().run( false, false, new IRunnableWithProgress()
-            {
-                public void run( IProgressMonitor monitor ) throws InvocationTargetException,
InterruptedException
-                {
-                    try
-                    {
-                        ServerConfigurationEditorUtils.saveAs( monitor, editor.getSite()
+            ServerConfigurationEditorUtils.saveAs( new NullProgressMonitor(), editor.getSite()
                             .getShell(), editor.getEditorInput(), editor.getConfigWriter()
);
-                    }
-                    catch ( Exception e )
-                    {
-
-                        // TODO handle the exception
-                    }
-                }
-            } );
         }
         catch ( Exception e )
         {
-            // TODO handle the exception
-            e.printStackTrace();
+            MessageDialog.openError( editor.getSite().getShell(), "Error Exporting Configuration
File",
+                NLS.bind( "An error occurred when exporting the selected file:\n{0}", e.getMessage()
) );
         }
-
     }
 }



Mime
View raw message