directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r607026 - in /directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration: editor/ wizards/
Date Thu, 27 Dec 2007 09:21:58 GMT
Author: pamarcelot
Date: Thu Dec 27 01:21:58 2007
New Revision: 607026

URL: http://svn.apache.org/viewvc?rev=607026&view=rev
Log:
Renamed 'ServerConfigurationEditorInput' class as 'NonExistingServerConfigurationInput' and
removed the no longer needed 'path' field.

Added:
    directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java
      - copied, changed from r606871, directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
Removed:
    directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
Modified:
    directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
    directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java

Copied: directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java
(from r606871, directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorInput.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java?p2=directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java&p1=directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorInput.java&r1=606871&r2=607026&rev=607026&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditorInput.java
(original)
+++ directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java
Thu Dec 27 01:21:58 2007
@@ -27,26 +27,24 @@
 
 
 /**
- * This class represents the Server Configuration Editor Input.
+ * This class represents the Non Existing Server Configuration Input.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ServerConfigurationEditorInput implements IEditorInput
+public class NonExistingServerConfigurationInput implements IEditorInput
 {
     /** The Server Configuration */
     private ServerConfiguration serverConfiguration;
-    /** The path of the file */
-    private String path;
 
 
     /**
-     * Creates a new instance of ServerConfigurationEditorInput.
+     * Creates a new instance of NonExistingServerConfigurationInput.
      *
      * @param serverConfiguration
      *      the Server Configuration
      */
-    public ServerConfigurationEditorInput( ServerConfiguration serverConfiguration )
+    public NonExistingServerConfigurationInput( ServerConfiguration serverConfiguration )
     {
         this.serverConfiguration = serverConfiguration;
     }
@@ -64,43 +62,12 @@
     }
 
 
-    /**
-     * Gets the path.
-     *
-     * @return
-     *      the path
-     */
-    public String getPath()
-    {
-        return path;
-    }
-
-
-    /**
-     * Sets the path.
-     * 
-     * @param path
-     *      the path
-     */
-    public void setPath( String path )
-    {
-        this.path = path;
-    }
-
-
     /* (non-Javadoc)
      * @see org.eclipse.ui.IEditorInput#getToolTipText()
      */
     public String getToolTipText()
     {
-        if ( path == null )
-        {
-            return "New Configuration File";
-        }
-        else
-        {
-            return path;
-        }
+        return "New Apache DS Configuration File";
     }
 
 
@@ -160,16 +127,16 @@
             return false;
         }
 
-        if ( obj instanceof ServerConfigurationEditorInput )
+        if ( obj instanceof NonExistingServerConfigurationInput )
         {
-            ServerConfigurationEditorInput input = ( ServerConfigurationEditorInput ) obj;
+            NonExistingServerConfigurationInput input = ( NonExistingServerConfigurationInput
) obj;
             if ( input.exists() && exists() )
             {
-                String inputPath = input.getPath();
+                ServerConfiguration inputServerConfiguration = input.getServerConfiguration();
 
-                if ( inputPath != null && path != null )
+                if ( ( inputServerConfiguration != null ) && ( serverConfiguration
!= null ) )
                 {
-                    return inputPath.equals( path );
+                    return inputServerConfiguration.equals( serverConfiguration );
                 }
             }
         }

Modified: directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java?rev=607026&r1=607025&r2=607026&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
Thu Dec 27 01:21:58 2007
@@ -122,11 +122,11 @@
                 ServerConfigurationParser parser = new ServerConfigurationParser();
                 serverConfiguration = parser.parse( new FileInputStream( new File( input.getToolTipText()
) ) );
             }
-            else if ( input instanceof ServerConfigurationEditorInput )
+            else if ( input instanceof NonExistingServerConfigurationInput )
             {
                 // The 'ServerConfigurationEditorInput' class is used when a
                 // new Server Configuration File is created.
-                serverConfiguration = ( ( ServerConfigurationEditorInput ) input ).getServerConfiguration();
+                serverConfiguration = ( ( NonExistingServerConfigurationInput ) input ).getServerConfiguration();
                 dirty = true;
             }
         }
@@ -209,7 +209,7 @@
                 saveConfiguration( input.getToolTipText() );
                 success = true;
             }
-            else if ( input instanceof ServerConfigurationEditorInput )
+            else if ( input instanceof NonExistingServerConfigurationInput )
             {
                 // The 'ServerConfigurationEditorInput' class is used when a
                 // new Server Configuration File is created.
@@ -367,7 +367,7 @@
         {
             // Asking the user for the location where to 'save as' the file
             SaveAsDialog dialog = new SaveAsDialog( getSite().getShell() );
-            if ( !( getEditorInput() instanceof ServerConfigurationEditorInput ) )
+            if ( !( getEditorInput() instanceof NonExistingServerConfigurationInput ) )
             {
                 dialog.setOriginalFile( ResourcesPlugin.getWorkspace().getRoot().getFile(
                     new Path( getEditorInput().getToolTipText() ) ) );

Modified: directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java?rev=607026&r1=607025&r2=607026&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java
Thu Dec 27 01:21:58 2007
@@ -22,7 +22,7 @@
 
 import org.apache.directory.studio.apacheds.configuration.Activator;
 import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
-import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditorInput;
+import org.apache.directory.studio.apacheds.configuration.editor.NonExistingServerConfigurationInput;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationParser;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationParserException;
@@ -62,7 +62,7 @@
                 .getResourceAsStream( "default-server.xml" ) );
 
             IWorkbenchPage page = window.getActivePage();
-            page.openEditor( new ServerConfigurationEditorInput( serverConfiguration ), ServerConfigurationEditor.ID
);
+            page.openEditor( new NonExistingServerConfigurationInput( serverConfiguration
), ServerConfigurationEditor.ID );
         }
         catch ( PartInitException e )
         {



Mime
View raw message