directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1502156 - in /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2: actions/ editor/
Date Thu, 11 Jul 2013 08:48:16 GMT
Author: pamarcelot
Date: Thu Jul 11 08:48:16 2013
New Revision: 1502156

URL: http://svn.apache.org/r1502156
Log:
Fix for DIRSTUDIO-934 (Exporting the configuration from the ApacheDS 2.0 Configuration Editor
should not change the input).

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorUtils.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=1502156&r1=1502155&r2=1502156&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
Thu Jul 11 08:48:16 2013
@@ -82,7 +82,7 @@ public class EditorExportConfigurationAc
         try
         {
             ServerConfigurationEditorUtils.saveAs( new NullProgressMonitor(), editor.getSite()
-                .getShell(), editor.getEditorInput(), editor.getConfigWriter() );
+                .getShell(), editor.getEditorInput(), editor.getConfigWriter(), false );
         }
         catch ( Exception e )
         {

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java?rev=1502156&r1=1502155&r2=1502156&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
Thu Jul 11 08:48:16 2013
@@ -213,7 +213,7 @@ public class ServerConfigurationEditor e
     {
         // Saving the configuration as a new file and getting the associated new editor input
         IEditorInput newInput = ServerConfigurationEditorUtils.saveAs( monitor, getSite().getShell(),
-            getEditorInput(), getConfigWriter() );
+            getEditorInput(), getConfigWriter(), true );
 
         // Checking if the 'save as' is successful 
         boolean success = newInput != null;

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorUtils.java?rev=1502156&r1=1502155&r2=1502156&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorUtils.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditorUtils.java
Thu Jul 11 08:48:16 2013
@@ -76,12 +76,14 @@ public class ServerConfigurationEditorUt
      *      the editor input
      * @param configWriter
      *      the configuration writer
+     * @param newInput
+     *      a flag to indicate if a new input is required
      * @return
      *      the new input for the editor
      * @throws Exception
      */
     public static IEditorInput saveAs( IProgressMonitor monitor, Shell shell, IEditorInput
input,
-        ConfigWriter configWriter )
+        ConfigWriter configWriter, boolean newInput )
         throws Exception
     {
         // detect IDE or RCP:
@@ -189,10 +191,16 @@ public class ServerConfigurationEditorUt
             // Saving the file to disk
             saveConfiguration( path, configWriter );
 
-            // Creating the new input for the editor
-            PathEditorInput newInput = new PathEditorInput( new Path( path ) );
-
-            return newInput;
+            // Checking if a new input is required
+            if ( newInput )
+            {
+                // Creating the new input for the editor
+                return new PathEditorInput( new Path( path ) );
+            }
+            else
+            {
+                return null;
+            }
         }
     }
 



Mime
View raw message