Author: rombert
Date: Thu Oct 2 19:59:50 2014
New Revision: 1629060
URL: http://svn.apache.org/r1629060
Log:
SLING-3999 - Bundle creation wizard should warn early if a project with
the same name exists
Modified:
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/ArchetypeParametersWizardPage.java
Modified:
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java?rev=1629060&r1=1629059&r2=1629060&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
(original)
+++
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/AbstractNewMavenBasedSlingApplicationWizard.java
Thu Oct 2 19:59:50 2014
@@ -84,7 +84,7 @@ public abstract class AbstractNewMavenBa
IProject existingProject =
ResourcesPlugin.getWorkspace().getRoot().getProject(artifactId);
if (existingProject!=null && existingProject.exists()) {
- throw new IllegalStateException("Project already exists with name
"+artifactId);
+ throw new IllegalStateException("A project with the name " +
artifactId + " already exists.");
}
advance(monitor, 1);
Modified:
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/ArchetypeParametersWizardPage.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/ArchetypeParametersWizardPage.java?rev=1629060&r1=1629059&r2=1629060&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/ArchetypeParametersWizardPage.java
(original)
+++
sling/trunk/tooling/ide/eclipse-m2e-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/ArchetypeParametersWizardPage.java
Thu Oct 2 19:59:50 2014
@@ -24,6 +24,8 @@ import java.util.StringTokenizer;
import org.apache.maven.archetype.catalog.Archetype;
import org.apache.maven.archetype.metadata.RequiredProperty;
import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CellNavigationStrategy;
@@ -313,6 +315,14 @@ public class ArchetypeParametersWizardPa
updateStatus("package must be specified");
return;
}
+
+ IProject existingProject =
ResourcesPlugin.getWorkspace().getRoot().getProject(artifactId.getText());
+
+ if (existingProject.exists()) {
+ updateStatus("A project with the name " + artifactId.getText() + "
already exists.");
+ return;
+ }
+
int cnt = propertiesTable.getItemCount();
for(int i=0; i<cnt; i++) {
TableItem item = propertiesTable.getItem(i);