directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1236334 - in /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards: ImportProjectsWizard.java messages.properties messages_de.properties messages_fr.properties
Date Thu, 26 Jan 2012 18:04:48 GMT
Author: pamarcelot
Date: Thu Jan 26 18:04:48 2012
New Revision: 1236334

URL: http://svn.apache.org/viewvc?rev=1236334&view=rev
Log:
DIRSTUDIO-630 (Importing a Schema project twice shouldn't be possible).

Modified:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_de.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_fr.properties

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java?rev=1236334&r1=1236333&r2=1236334&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/ImportProjectsWizard.java
Thu Jan 26 18:04:48 2012
@@ -94,7 +94,32 @@ public class ImportProjectsWizard extend
                         {
                             Project project = ProjectsImporter.getProject( new FileInputStream(
projectFile ),
                                 projectFile.getAbsolutePath() );
-                            projectsHandler.addProject( project );
+
+                            if ( projectsHandler.isProjectNameAlreadyTaken( project.getName()
) )
+                            {
+                                PluginUtils
+                                    .logError(
+                                        NLS
+                                            .bind(
+                                                Messages.getString( "ImportProjectsWizard.ErrorImportingProject"
), //$NON-NLS-1$
+                                                new String[]
+                                                    { project.getName() } ), null );
+                                ViewUtils
+                                    .displayErrorMessageDialog(
+                                        Messages.getString( "ImportProjectsWizard.ImportError"
), //$NON-NLS-1$
+                                        NLS
+                                            .bind(
+                                                Messages.getString( "ImportProjectsWizard.ErrorImportingProject"
) //$NON-NLS-1$
+                                                    + "\n" //$NON-NLS-1$
+                                                    + Messages
+                                                        .getString( "ImportProjectsWizard.ErrorProjectNameExists"
), //$NON-NLS-1$
+                                                new String[]
+                                                    { project.getName() } ) );
+                            }
+                            else
+                            {
+                                projectsHandler.addProject( project );
+                            }
                         }
                         catch ( ProjectsImportException e )
                         {

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages.properties?rev=1236334&r1=1236333&r2=1236334&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages.properties
Thu Jan 26 18:04:48 2012
@@ -124,6 +124,7 @@ ImportCoreSchemasWizardPage.ErrorNoSchem
 ImportCoreSchemasWizardPage.ImportCoreSchemas=Import core schemas
 ImportCoreSchemasWizardPage.PleaseSelectCoreSchemas=Please select the 'core' schemas to import.
 ImportProjectsWizard.ErrorImportingProject=An error occurred when importing project "{0}".
+ImportProjectsWizard.ErrorProjectNameExists=A project with this name already exists.
 ImportProjectsWizard.ImportError=Import Error
 ImportProjectsWizard.ImportingProjects=Importing projects\: 
 ImportProjectsWizardPage.Browse=Browse...

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_de.properties?rev=1236334&r1=1236333&r2=1236334&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_de.properties
Thu Jan 26 18:04:48 2012
@@ -129,6 +129,7 @@ ImportCoreSchemasWizardPage.ImportCoreSc
 ImportCoreSchemasWizardPage.PleaseSelectCoreSchemas=Bitte die Kern-Schemas f\u00FCr dein
Import ausw\u00E4hlen.
 
 ImportProjectsWizard.ErrorImportingProject=Ein Fehler ist beim Importieren des Projektes
"{0}" aufgetreten.
+ImportProjectsWizard.ErrorProjectNameExists=Ein Projekt mit diesem Namen existiert bereits.
 ImportProjectsWizard.ImportError=Import Fehler
 ImportProjectsWizard.ImportingProjects=Projekte importieren\: 
 ImportProjectsWizardPage.Browse=Browsen...

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_fr.properties?rev=1236334&r1=1236333&r2=1236334&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/messages_fr.properties
Thu Jan 26 18:04:48 2012
@@ -129,6 +129,7 @@ ImportCoreSchemasWizardPage.ImportCoreSc
 ImportCoreSchemasWizardPage.PleaseSelectCoreSchemas=Veuillez s\u00E9lectionner les sch\u00E9mas
de base ('core') \u00E0 importer.
 
 ImportProjectsWizard.ErrorImportingProject=Une erreur est survenue lors de l''importation
du projet "{0}".
+ImportProjectsWizard.ErrorProjectNameExists=Un projet avec ce nom existe d\u00E9j\u00E0.
 ImportProjectsWizard.ImportError=Erreur d'importation
 ImportProjectsWizard.ImportingProjects=Importation des projets\: 
 ImportProjectsWizardPage.Browse=Parcourir...



Mime
View raw message