directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r558787 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
Date Mon, 23 Jul 2007 16:16:44 GMT
Author: pamarcelot
Date: Mon Jul 23 09:16:40 2007
New Revision: 558787

URL: http://svn.apache.org/viewvc?view=rev&rev=558787
Log:
Added some code to close a project before deleting it.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java?view=diff&rev=558787&r1=558786&r2=558787
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/DeleteProjectAction.java
Mon Jul 23 09:16:40 2007
@@ -25,6 +25,8 @@
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
+import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
+import org.apache.directory.studio.apacheds.schemaeditor.model.Project.ProjectState;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ProjectWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -121,7 +123,15 @@
                 for ( Iterator<?> iterator = selection.iterator(); iterator.hasNext();
)
                 {
                     ProjectWrapper wrapper = ( ProjectWrapper ) iterator.next();
-                    projectsHandler.removeProject( wrapper.getProject() );
+                    Project project = wrapper.getProject();
+
+                    if ( project.getState() == ProjectState.OPEN )
+                    {
+                        // Closing the project before removing it. 
+                        projectsHandler.closeProject( project );
+                    }
+
+                    projectsHandler.removeProject( project );
                 }
             }
         }



Mime
View raw message