Author: xcoulon
Date: 2012-06-01 12:48:40 -0400 (Fri, 01 Jun 2012)
New Revision: 41636
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
Log:
Fixed - JBIDE-12078
Error when creating an application to merge into an existing project
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
===================================================================
---
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-06-01
16:47:29 UTC (rev 41635)
+++
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-06-01
16:48:40 UTC (rev 41636)
@@ -124,9 +124,11 @@
final IObservableValue applicationNameModelObservable = BeanProperties.value(
GitCloningSettingsWizardPageModel.PROPERTY_APPLICATION_NAME).observe(pageModel);
+ final IObservableValue newProjectModelObservable = BeanProperties.value(
+ GitCloningSettingsWizardPageModel.PROPERTY_NEW_PROJECT).observe(pageModel);
dbc.addValidationStatusProvider(new
RepoPathValidationStatusProvider(repoPathObservable,
- applicationNameModelObservable));
+ applicationNameModelObservable, newProjectModelObservable));
// Remote Name Management
useDefaultRemoteNameButton = new Button(cloneGroup, SWT.CHECK);
@@ -241,11 +243,13 @@
private final IObservableValue repoPathObservable;
private final IObservableValue applicationNameModelObservable;
+ private final IObservableValue newProjectModelObservable;
public RepoPathValidationStatusProvider(IObservableValue repoPathObservable,
- IObservableValue applicationNameModelObservable) {
+ IObservableValue applicationNameModelObservable, IObservableValue
newProjectModelObservable) {
this.repoPathObservable = repoPathObservable;
this.applicationNameModelObservable = applicationNameModelObservable;
+ this.newProjectModelObservable = newProjectModelObservable;
}
// Validator is also be called when application name is set..
@@ -253,7 +257,9 @@
protected IStatus validate() {
final String repoPath = (String) repoPathObservable.getValue();
final String applicationName = (String) applicationNameModelObservable.getValue();
+ final boolean newProject = (Boolean) newProjectModelObservable.getValue();
+ if(newProject) {
final IPath repoResourcePath = new Path(repoPath);
if (repoResourcePath.isEmpty()
|| !repoResourcePath.isAbsolute()
@@ -266,7 +272,7 @@
NLS.bind("The location \"{0}\" already contains a folder named
\"{1}\"",
repoResourcePath.toOSString(), applicationName));
}
-
+ }
return ValidationStatus.ok();
}
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
===================================================================
---
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-06-01
16:47:29 UTC (rev 41635)
+++
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-06-01
16:48:40 UTC (rev 41636)
@@ -32,6 +32,7 @@
public class GitCloningSettingsWizardPageModel extends ObservableUIPojo {
public static final String PROPERTY_APPLICATION_NAME = "applicationName";
+ public static final String PROPERTY_NEW_PROJECT = "newProject";
public static final String PROPERTY_REPO_PATH = "repositoryPath";
public static final String PROPERTY_REMOTE_NAME = "remoteName";
public static final String PROPERTY_USE_DEFAULT_REPO_PATH =
"useDefaultRepoPath";
Show replies by date