OSDN Git Service

Improve validation error messages when SDKs are loading
authorTor Norbye <tnorbye@google.com>
Tue, 13 Sep 2011 21:35:48 +0000 (14:35 -0700)
committerTor Norbye <tnorbye@google.com>
Tue, 13 Sep 2011 21:35:48 +0000 (14:35 -0700)
If you bring up the "Create New Sample Project" wizard in an Eclipse
that has no open editors (so nothing has triggered an SDK load yet),
you will get an error message that is a bit misleading (that the
selected SDK has no samples), and even when the SDK finishes loading
the validation isn't updated.

This changeset improves this situation such that there is a message
during loading stating to wait, which gets cleared once it's done.

Change-Id: I5d0798eff3b4fea9c8835c2f88c5bc430110aac0

eclipse/changes.txt
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java

index 20db4a5..e77eca9 100644 (file)
   - Ability to suppress rendering fidelity warnings.
 - Asset Studio integration: Wizard creation of launcher icons, menu
     icons, tab icons, etc.
-- Many bug fixes, and some critical bug fixes on Linux
+- The New Project and the New XML File wizards have been reworked into
+  multiple pages. Sample Projects are now copied into the workspace
+  such that they can be modified and deleted without affecting the
+  master copy.
+- The dependency on Eclipse GEF was removed.
+- Many bug fixes, and in particular some critical bug fixes on Linux
 
 13.0.0
 - Tools release only (command line tools)
index a43306a..495db18 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.wizards.newproject;
 
+import com.android.ide.common.sdk.LoadStatus;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk.ITargetChangeListener;
@@ -252,11 +253,15 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener {
     private void validatePage() {
         String error = null;
 
-        if (mValues.target == null) {
+        if (AdtPlugin.getDefault().getSdkLoadStatus() == LoadStatus.LOADING) {
+            error = "The SDK is still loading; please wait.";
+        }
+
+        if (error == null && mValues.target == null) {
             error = "An SDK Target must be specified.";
         }
 
-        if (mValues.mode == Mode.SAMPLE) {
+        if (error == null && mValues.mode == Mode.SAMPLE) {
             // Make sure this SDK target contains samples
             if (mValues.samples == null || mValues.samples.size() == 0) {
                 error = "This target has no samples. Please select another target.";
@@ -318,6 +323,8 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener {
                 onSdkTargetModified();
             }
         }
+
+        validatePage();
     }
 
     public void onProjectTargetChange(IProject changedProject) {