Fix module import UI.

It is now possible to rename modules to import, including the
capability to use hierarchical Gradle names.
JTable was replaced with a custom UI to make the UI more detailed
and easier to navigate. Module-specific statuses are now always
shown, as opposed to tooltips used before.
Controller layer was refactored to make it more testable and to
handle edge cases better.

Change-Id: Ib7de2a5c662dc20470e773c914683762cbe64e3a
Change version to 0.8.6

Change-Id: I61005860184d47b0a2d10366fdce482adce3be16
Merge "Change version to 0.8.6" into idea133
Fixed test failures in AndroidProjectWizardTest

The tests in AndroidProjectWizardTest depended on some code in JetBrain's
version of the Android plugin that we didn't have, possibly due to a bad
merge earlier. I copied over the minimal changes required to get the tests
working again. In this case, JetBrain's version of a class that constructs
an Android module handled the creation of empty modules slightly differently
than ours did.

Change-Id: Ie479a4a24b314bf88e3731ebaab47e0bfbae5127
Merge "Fixed test failures in AndroidProjectWizardTest" into idea133
Makes string resources editable from strings editor.

All code that touches the string resource data now lives in
StringResourceDataController. The editor can call the updateData() method
of the controller to retrieve the most current data from the local resource
repository, and on successful data retrieval,
StringResourceEditor.onDataUpdated() is called so that the editor can
refresh the table view, etc.  When the user makes a change within the
editor, StringResourceDataController.doEdit(...) changes the data in the
appropriate file(s) and calls updateData().

Known issues: We do not check that the key the user enters is unique, and
we use the deprecated method AndroidFacet.getPrimaryResourceDir().

(1) How the editing works:
  (a) When the translatable attribute of a key is changed, updates the
      attribute in every locale for which the key has a value. Setting
      translatable to true causes the attribute to be deleted.
  (b) When the name of a key is changed, updates the name in every
      locale for which the key has a value. Setting the name to ""
      (after trimming) causes the key to be deleted. (We may want to
      warn the user before this happens.)
  (c) When a non-empty default value or translation is edited to a non-
      empty value, updates the text of the resource item accordingly.
  (d) When a default value or translation goes from empty to non-empty,
      creates a resource item with the appropriate values for the text
      and the translatable attribute.
  (e) When a default value or translation goes from non-empty to empty,
      deletes the corresponding resource item.
  (f) Creates values directories and string resource files as necessary,
      although the editor does not currently use this functionality.

(2) Change to the cell detail panel (renamed to the edit panel): The Key
and Default Value text components are editable when a table cell is
selected, and the Translation text component is editable when a
translation table cell is selected.

(3) Misc: Uses AndroidResourceUtil.getDefaultResourceFileName(ResourceType)
to slightly simplify the way we check for a string resource file.

Change-Id: I6c8c1ccf01e9f09173125a8fcedae76588cbbbd9
Signed-off-by: Rebecca Chen <rechen@google.com>
Merge "Makes string resources editable from strings editor." into idea133
Fixed bug 73640 in JPS builder.

The bug is about the IDE invoking "assemble" Gradle
task for modules that are of "local AAR" type. This
type of module do not have the "assemble" task and
when building the project the IDE should just skip
them.

This bug was already fixed in the GradleInvoker
strategy (in-process build) in
https://android-review.googlesource.com/103541
but it was not fixed in the JPS build (out-of-process
build.)

The solution to the problem is to carefully
add the "Java" facet only to the non-Android modules
that have the "compileJava" task. Then we would only
build the modules with either the Android or Java
facet. The main problem with this solution is that
we need a "Java facet" counterpart in the JPS world.
When dealing with JPS each facet needs to have 2
copies: one for the IDE and one for JPS.

The need for the facets is to be able to figure out
which Gradle tasks to call. We were doing this on
both GradleInvoker and JPS, duplicating the logic on
both sides.

This CL introduces a better solution: all the Gradle
tasks to invoke are figured out in one place: the IDE.
Then the IDE will pass the list of tasks to JPS via
Java properties. This way, we have only one place
where this logic lives, and we can remove a lot of
duplicated code in the JPS side.

Finally fixes issue
https://code.google.com/p/android/issues/detail?id=73640

Change-Id: Ib22de9b654ca975f9ce66bcf80899ce2936b9a37
Merge "Fixed bug 73640 in JPS builder." into idea133
Now we remove all IDEA files before importing a project.

The motivation for this is to start a project import with
completely clean project state. When working on
https://android-review.googlesource.com/103541 I noticed that
certain things (e.g. facets) get added to an iml file but
not removed. For example, we stopped adding the "Java" facet
to "local AAR" modules. After fixing this, the test still
failed, because the .iml file still had the "Java" facet.

To delete the .iml files in a project, before importing it
(very important,) we parse the .idea/modules.xml file and obtain
the list of .iml files from there. Then we delete the .iml
files and the .idea folder.

Change-Id: I5504ed0f4e1b33542b2f0b486bce2479fbe85431
Merge "Now we remove all IDEA files before importing a project." into idea133
We no longer prompt a user to download an older Android SDK if the user
already has a newer one already installed on their system.

This CL also removes a conditional branch which we think never actually
got it.

This CL lowers the urgency of bug http://b.android.com/74666

Change-Id: I375d05e1a548cfc617227f3ee0f10ce3f8cc1c99
Show Open in File action at the end of sign apk wizard

Fixes https://code.google.com/p/android/issues/detail?id=74574

Change-Id: Ie791bb2145ad9586e814af888966187e0e565081
Merge "Show Open in File action at the end of sign apk wizard" into idea133
Fixed broken test.

Change-Id: I81250d97e2e6f62e2c1765ce7b04e9e4be284611
Merge "Fixed broken test." into idea133
Fixed bug where AssertionError was thrown for project with custom location of build folder.

The problem is that when locating the content root parent of the build folder,
the check assumed that the folder was already created, which is not always the
case. For example, when importing a project that has not been built, the
build folder does not exist.

In this CL we check that if the build folder does not exist, we use the URL
of the folder specified in the content root to derive the path of the build
folder, this way we can properly set up the project "excluded" folders
during project sync.

This CL also includes a UI test and a project that reproduces this issue:
CentralBuildDirectoryTest and CentralBuildDirectory, respectively.

Fixes issue https://code.google.com/p/android/issues/detail?id=74259

Change-Id: If3eedf43c6eb86581dec815e16486211ea10f196
Merge "Fixed bug where AssertionError was thrown for project with custom location of build folder." into idea133
Merge "navigator: Customize representation for non Java modules" into idea133
navigator: Customize representation for non Java modules

The Android view for non-Android modules simply defaulted
to the package view. The idea was that the package view was
written with a similar intention: to place more importance on
the logical view of the project and less importance to the
on-disk structure.

However, it doesn't work really well. Users find it confusing
that tests, sources and resources are all mixed together.

This CL provides some structure to such projects. The info
available for such projects are really just the kind of
source roots that are specified for the module, so the Android
view groups sources by the source root type (java, tests,
resources or test resources).

Fixes https://code.google.com/p/android/issues/detail?id=74732
and possibly https://code.google.com/p/android/issues/detail?id=74057

Change-Id: I380cc2db81521ff8ea71fb2eb5ea4955154dc394