You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2011/12/07 19:46:53 UTC

svn commit: r1211588 - /directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java

Author: pamarcelot
Date: Wed Dec  7 18:46:53 2011
New Revision: 1211588

URL: http://svn.apache.org/viewvc?rev=1211588&view=rev
Log:
Fix for DIRSTUDIO-655 (Switch usage of SWT MessageBox to JFace MessageDialog for info, warning and error dialogs).

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

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java?rev=1211588&r1=1211587&r2=1211588&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java (original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java Wed Dec  7 18:46:53 2011
@@ -58,7 +58,6 @@ import org.eclipse.jface.operation.IRunn
 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.swt.widgets.Shell;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
@@ -468,12 +467,11 @@ public class ServerConfigurationEditor e
         }
         catch ( Exception e )
         {
-            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                SWT.OK | SWT.ICON_ERROR );
-            messageBox.setText( Messages.getString( "ServerConfigurationEditor.Error" ) ); //$NON-NLS-1$
-            messageBox
-                .setMessage( Messages.getString( "ServerConfigurationEditor.AnErrorOccurredWhenWritingTheFileToDisk" ) + "\n" + e.getMessage() ); //$NON-NLS-1$ //$NON-NLS-2$
-            messageBox.open();
+            MessageDialog.openError(
+                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                Messages.getString( "ServerConfigurationEditor.Error" ), //$NON-NLS-1$
+                Messages.getString( "ServerConfigurationEditor.AnErrorOccurredWhenWritingTheFileToDisk" ) + "\n" //$NON-NLS-1$ //$NON-NLS-2$
+                    + e.getMessage() );
             setDirty( true );
             monitor.done();
             return;
@@ -608,13 +606,11 @@ public class ServerConfigurationEditor e
                     }
                     catch ( Exception e )
                     {
-                        MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow()
-                            .getShell(), SWT.OK | SWT.ICON_ERROR );
-                        messageBox.setText( Messages.getString( "ServerConfigurationEditor.Error" ) ); //$NON-NLS-1$
-                        messageBox.setMessage( Messages
-                            .getString( "ServerConfigurationEditor.AnErrorOccurredWhenWritingTheFileToDisk" ) + "\n" //$NON-NLS-1$ //$NON-NLS-2$
-                            + e.getMessage() );
-                        messageBox.open();
+                        MessageDialog.openError(
+                            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                            Messages.getString( "ServerConfigurationEditor.Error" ), //$NON-NLS-1$ 
+                            Messages.getString( "ServerConfigurationEditor.AnErrorOccurredWhenWritingTheFileToDisk" ) //$NON-NLS-1$ 
+                                + "\n" + e.getMessage() ); //$NON-NLS-1$ 
                         setDirty( true );
                         monitor.done();
                         return;
@@ -624,12 +620,12 @@ public class ServerConfigurationEditor e
         }
         catch ( Exception e )
         {
-            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                SWT.OK | SWT.ICON_ERROR );
-            messageBox.setText( Messages.getString( "ServerConfigurationEditor.Error" ) ); //$NON-NLS-1$
-            messageBox
-                .setMessage( Messages.getString( "ServerConfigurationEditor.AnErrorOccurredWhenWritingTheFileToDisk" ) + "\n" + e.getMessage() ); //$NON-NLS-1$ //$NON-NLS-2$
-            messageBox.open();
+            MessageDialog
+                .openError(
+                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                    Messages.getString( "ServerConfigurationEditor.Error" ), //$NON-NLS-1$ 
+                    Messages.getString( "ServerConfigurationEditor.AnErrorOccurredWhenWritingTheFileToDisk" ) + "\n" //$NON-NLS-1$ //$NON-NLS-2$ 
+                        + e.getMessage() );
             return;
         }
     }