diff options
author | Tor Norbye <tnorbye@google.com> | 2012-02-23 08:07:27 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-02-23 08:08:00 -0800 |
commit | 145dc8fc87c819fc9a1845c4f0f9a13fdf83d8ee (patch) | |
tree | 5b3dd657220d40995f546f645dd5934facffc5fd /eclipse | |
parent | f20c7c7e502fcd4df97e6ba2597ccfe3c5962873 (diff) | |
download | sdk-145dc8fc87c819fc9a1845c4f0f9a13fdf83d8ee.zip sdk-145dc8fc87c819fc9a1845c4f0f9a13fdf83d8ee.tar.gz sdk-145dc8fc87c819fc9a1845c4f0f9a13fdf83d8ee.tar.bz2 |
Fix issue 25862
This changeset fixes issue 25862 and also makes a couple of other
tweaks such as avoiding the location getting cleared when you edit the
project name in a particular scenario.
Change-Id: I2ca0b4224a2c626fd0b525a34e9de527227c87ac
Diffstat (limited to 'eclipse')
3 files changed, 38 insertions, 22 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java index 7424d6c..ab34f92 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java @@ -364,7 +364,7 @@ public class NewProjectCreator { parameters.put(PARAM_PACKAGE, pkg); parameters.put(PARAM_APPLICATION, STRING_RSRC_PREFIX + STRING_APP_NAME); parameters.put(PARAM_SDK_TOOLS_DIR, AdtPlugin.getOsSdkToolsFolder()); - parameters.put(PARAM_IS_NEW_PROJECT, true); + parameters.put(PARAM_IS_NEW_PROJECT, !mValues.useExisting); parameters.put(PARAM_SRC_FOLDER, mValues.sourceFolder); parameters.put(PARAM_SDK_TARGET, mValues.target); parameters.put(PARAM_MIN_SDK_VERSION, mValues.minSdk); @@ -402,7 +402,8 @@ public class NewProjectCreator { description.setLocation(path); } - if (!mValues.useDefaultLocation && !validateNewProjectLocationIsEmpty(path)) { + if (!mValues.useExisting && !mValues.useDefaultLocation && + !validateNewProjectLocationIsEmpty(path)) { return null; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java index 6de6556..ff77b9f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java @@ -183,24 +183,29 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis super.setVisible(visible); if (visible) { - if (mValues.projectName != null) { - mProjectNameText.setText(mValues.projectName); - mProjectNameText.setFocus(); - } - if (mValues.mode == Mode.ANY || mValues.mode == Mode.TEST) { - if (mValues.useExisting) { - mCreateExistingRadioButton.setSelection(true); - } else { - mCreateNewButton.setSelection(true); + try { + mIgnore = true; + if (mValues.projectName != null) { + mProjectNameText.setText(mValues.projectName); + mProjectNameText.setFocus(); } - } else if (mValues.mode == Mode.SAMPLE) { - mCreateSampleRadioButton.setSelection(true); - } - if (mValues.projectLocation != null) { - mLocationText.setText(mValues.projectLocation.getPath()); + if (mValues.mode == Mode.ANY || mValues.mode == Mode.TEST) { + if (mValues.useExisting) { + mCreateExistingRadioButton.setSelection(true); + } else { + mCreateNewButton.setSelection(true); + } + } else if (mValues.mode == Mode.SAMPLE) { + mCreateSampleRadioButton.setSelection(true); + } + if (mValues.projectLocation != null) { + mLocationText.setText(mValues.projectLocation.getPath()); + } + mUseDefaultCheckBox.setSelection(mValues.useDefaultLocation); + updateLocationState(); + } finally { + mIgnore = false; } - mUseDefaultCheckBox.setSelection(mValues.useDefaultLocation); - updateLocationState(); } validatePage(); @@ -252,7 +257,9 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis mValues.testProjectName = ApplicationInfoPage.suggestTestProjectName(mValues.projectName); } - updateLocationPathField(null); + if (!mValues.projectLocationModifiedByUser) { + updateLocationPathField(null); + } } @Override @@ -265,12 +272,20 @@ class ProjectNamePage extends WizardPage implements SelectionListener, ModifyLis if (source == mCreateNewButton && mCreateNewButton.getSelection()) { mValues.useExisting = false; - mValues.mode = Mode.ANY; + if (mValues.mode == Mode.SAMPLE) { + // Only reset the mode if we're toggling from sample back to create new + // or create existing. We can only come to the sample state when we're in + // ANY mode. (In particular, we don't want to switch to ANY if you're + // in test mode. + mValues.mode = Mode.ANY; + } updateLocationState(); } else if (source == mCreateExistingRadioButton && mCreateExistingRadioButton.getSelection()) { mValues.useExisting = true; - mValues.mode = Mode.ANY; + if (mValues.mode == Mode.SAMPLE) { + mValues.mode = Mode.ANY; + } if (!mValues.activityNameModifiedByUser) { mValues.createActivity = false; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java index 51e1e46..2e03a21 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/TestTargetPage.java @@ -60,7 +60,7 @@ class TestTargetPage extends WizardPage implements SelectionListener { */ TestTargetPage(NewProjectWizardState values) { super("testTargetPage"); //$NON-NLS-1$ - setTitle("Select TestTarget"); + setTitle("Select Test Target"); setDescription("Choose a project to test"); mValues = values; } |