Author: adietish
Date: 2012-03-02 09:25:34 -0500 (Fri, 02 Mar 2012)
New Revision: 39258
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
Log:
[JBIDE-11132] removed recursion when resetting remote name. changed logic of resetting
remote name to a simplistic one.
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-03-02
14:23:28 UTC (rev 39257)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-03-02
14:25:34 UTC (rev 39258)
@@ -134,7 +134,6 @@
useDefaultRemoteNameButton = new Button(cloneGroup, SWT.CHECK);
useDefaultRemoteNameButton.setText("Use default remote name");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(3,
1).applyTo(useDefaultRemoteNameButton);
- useDefaultRemoteNameButton.addSelectionListener(onDefaultRemoteName());
this.remoteNameLabel = new Label(cloneGroup, SWT.NONE);
remoteNameLabel.setText("Remote name:");
@@ -205,16 +204,6 @@
};
}
- private SelectionListener onDefaultRemoteName() {
- return new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- pageModel.resetRemoteName();
- }
- };
- }
-
private SelectionAdapter onSshPrefs() {
return new SelectionAdapter() {
@@ -226,10 +215,6 @@
}
protected void onPageActivated(DataBindingContext dbc) {
- // allow to enable a proj only for as7 openshift applications
- // pageModel.resetRepositoryPath();
- pageModel.resetRemoteName();
- // pageModel.refreshApplicationName();
enableWidgets(pageModel.isNewProject());
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-03-02
14:23:28 UTC (rev 39257)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-03-02
14:25:34 UTC (rev 39258)
@@ -88,28 +88,11 @@
wizardModel.setRepositoryPath(repositoryPath));
}
- // public void resetRepositoryPath() {
- // if (wizardModel.isNewProject()
- // || getRepositoryPath() == null) {
- // setRepositoryPath(getDefaultRepositoryPath());
- // }
- // }
-
- public void resetRemoteName() {
+ private void resetRemoteName() {
if (!wizardModel.isNewProject()) {
- // if existing project and remote name is still 'origin'
- // -> switch to 'openshift' (leave as is if existing project and
- // remote name != 'origin')
- if (NEW_PROJECT_REMOTE_NAME_DEFAULT.equals(getRemoteName())) {
setRemoteName(EXISTING_PROJECT_REMOTE_NAME_DEFAULT);
- }
} else {
- // if new project and remote name is not 'origin'
- // -> restore 'origin'
- if (!NEW_PROJECT_REMOTE_NAME_DEFAULT.equals(getRemoteName())) {
- setUseDefaultRemoteName(true);
setRemoteName(NEW_PROJECT_REMOTE_NAME_DEFAULT);
- }
}
}
@@ -148,8 +131,6 @@
firePropertyChange(PROPERTY_USE_DEFAULT_REMOTE_NAME, useDefaultRemoteName,
this.useDefaultRemoteName = useDefaultRemoteName);
if (useDefaultRemoteName) {
- // setRemoteName(isNewProject() ? NEW_PROJECT_REMOTE_NAME_DEFAULT :
- // EXISTING_PROJECT_REMOTE_NAME_DEFAULT);
resetRemoteName();
}
}