OSDN Git Service

android-x86/sdk.git
13 years agoBetter default selection when choosing a device config.
Xavier Ducrohet [Mon, 21 Mar 2011 22:41:57 +0000 (15:41 -0700)]
Better default selection when choosing a device config.

Change-Id: Iacaabec4ad9e9dd55397dc2cc3e6bfadc0c11ff2

13 years agoMerge "NPE fix"
Tor Norbye [Mon, 21 Mar 2011 22:38:35 +0000 (15:38 -0700)]
Merge "NPE fix"

13 years agoNPE fix
Tor Norbye [Mon, 21 Mar 2011 22:35:35 +0000 (15:35 -0700)]
NPE fix

Change-Id: I35d0407ef20557c19b6eca5324075de9fbbf8583

13 years agoMerge "SDK Manager dialog to manage user add-on sites."
Raphael Moll [Mon, 21 Mar 2011 20:28:13 +0000 (13:28 -0700)]
Merge "SDK Manager dialog to manage user add-on sites."

13 years agoMerge "Revamp of the SDK Manager UI."
Raphael Moll [Mon, 21 Mar 2011 20:26:38 +0000 (13:26 -0700)]
Merge "Revamp of the SDK Manager UI."

13 years agoMerge "Applying the previous rotation state when refreshing screen image."
Tor Norbye [Mon, 21 Mar 2011 20:21:05 +0000 (13:21 -0700)]
Merge "Applying the previous rotation state when refreshing screen image."

13 years agoMerge "Refactoring Quick Assistant"
Tor Norbye [Mon, 21 Mar 2011 20:03:49 +0000 (13:03 -0700)]
Merge "Refactoring Quick Assistant"

13 years agoMerge "Add go to declaration support for styles and embedded text"
Tor Norbye [Mon, 21 Mar 2011 19:59:51 +0000 (12:59 -0700)]
Merge "Add go to declaration support for styles and embedded text"

13 years agoAdd go to declaration support for styles and embedded text
Tor Norbye [Fri, 18 Mar 2011 18:31:26 +0000 (11:31 -0700)]
Add go to declaration support for styles and embedded text

This changeset adds support to the Go To Declaration code for styles.
Style strings are a bit different from resource URLs - they can have
an @android: prefix, but they don't specify a resource type.  For
example, go to declaration can now jump to the value in the parent
attribute:

   <style name="BrowserTheme" parent="@android:Theme.Black">

This will show the Theme.Black style definition in the SDK's
styles.xml document.

In addition, the hyperlink resolver can now also link to fragments of
an attribute value. In particular, in the above, if you point anywhere
to the left of the ".", only the @android:Theme range will be
selected. This lets you go to parents, since styles inherit from other
styles by adding to them with dots.

Third, the hyperlink resolver can now link to resource urls that is in
the content part of XML documents (e.g. a text node, not an element
name or attribute value). As an example, you can now jump to the color
defined inside this style element:

    <style name="CustomTheme" parent="android:Theme.Light">
        <item name="android:bg">@color/custom_theme_color</item>
    </style>

Finally, this changeset adds unit/plugin tests for the hyperlink
resolver, which asserts the expected list of matches, and the expected
editor context when the default link is opened.

Change-Id: I73757ec78405f7c711e13387d0bb046f698799f1

13 years agoMerge "More code completion fixes"
Tor Norbye [Mon, 21 Mar 2011 19:43:18 +0000 (12:43 -0700)]
Merge "More code completion fixes"

13 years agoMore code completion fixes
Tor Norbye [Sat, 19 Mar 2011 22:35:02 +0000 (15:35 -0700)]
More code completion fixes

This changeset fixes additional corner cases for XML code completion.

It handles inserting "new" attributes in more places, meaning for
example that if you code complete here <Button ^/> you will still get
"new" completion where the inserted attribute contains ="^".

Similarly the completer also handles inserting full element tags (with
opening and closing tags) in more scenarios, and still avoids doing
this in the case where you are on an opening line of an element which
already contains attributes on subsequent lines.

The new unit tests reveal additional minor corner cases.

Change-Id: I3f1b903e1c1768e4bdd42a5486ce729e348c4da5

13 years agoRefactoring Quick Assistant
Tor Norbye [Sun, 20 Mar 2011 22:45:20 +0000 (15:45 -0700)]
Refactoring Quick Assistant

Add another quick assistant to the editor which offers the various
refactoring operations for the current editing context.  If the caret
is in a value declaration, then the "Extract String" refactoring is
offered. Otherwise, if the caret is on an element tag name (or opening
or closing tag), then the element-related visual refactorings are
offered (wrap in, change widget, change layout, extract as include)
provided of course the current editor is a layout editor.

Change-Id: Iee4033d2766d2d4a1157789b81602d37a5175c88

13 years agoMerge "On ImageView or ImageButton drop, ask user for drawable"
Tor Norbye [Mon, 21 Mar 2011 19:27:25 +0000 (12:27 -0700)]
Merge "On ImageView or ImageButton drop, ask user for drawable"

13 years agoMerge "Add large, medium and small TextViews to the palette"
Tor Norbye [Mon, 21 Mar 2011 19:27:12 +0000 (12:27 -0700)]
Merge "Add large, medium and small TextViews to the palette"

13 years agoMerge "Add newline inside new root elements, and some move code around"
Tor Norbye [Mon, 21 Mar 2011 19:26:42 +0000 (12:26 -0700)]
Merge "Add newline inside new root elements, and some move code around"

13 years agoAdd newline inside new root elements, and some move code around
Tor Norbye [Fri, 18 Mar 2011 02:59:38 +0000 (19:59 -0700)]
Add newline inside new root elements, and some move code around

Tweak the "New XML File" creation code to insert a new line inside the
created root element, indent, and place the cursor there.  This means
that you end up with:

    <LinearLayout>
        |
    </LinearLayout>

instead of (where | denotes the initial caret position):

   |<LinearLayout>
    </LinearLayout>

This means you can instantly press Ctrl-Space to complete on the
elements, etc., and is similar to how Eclipse creates new method
bodies from templates, adding newlines such that you can instantly
write code there instead of having to "open them up".

All the diffs for this are in NewXmlFileWizard.java; the other
modifications in this changeset are simple move refactoring
operations as described next:

The second change in this changeset is moving some code around such
that common utility methods live in more natural places rather than
where they were first needed.

In particular:
Hyperlinks.openUrl                             => AdtPlugin
Hyperlinks.openJavaClass                       => AdtPlugin
Hyperlinks.openFile                            => AdtPlugin
AndroidContentAssist.getAndroidXmlEditor       => AndroidXmlEditor
ResourceChooser.canCreateResource              => ResourceHelper
ResourceChooser.createResource                 => ResourceHelper
Hyperlinks.parseResource                       => ResourceHelper
ResourceNameValidator.isValueBasedResourceType => ResourceHelper
ResourceNameValidator.isFileBasedResourceType  => ResourceHelper

Change-Id: If7690df9ce59c709c1d909ffd9f74c2684f3dd46

13 years agoApplying the previous rotation state when refreshing screen image.
Keiji Ariyama [Mon, 21 Mar 2011 08:52:18 +0000 (17:52 +0900)]
Applying the previous rotation state when refreshing screen image.

Change-Id: I04e81b591701e096bb553ac31af3226fa6d6b3f6

13 years agoMerge "Add custom views and third party views to the palette"
Tor Norbye [Mon, 21 Mar 2011 18:23:12 +0000 (11:23 -0700)]
Merge "Add custom views and third party views to the palette"

13 years agoAdd large, medium and small TextViews to the palette
Tor Norbye [Mon, 21 Mar 2011 03:32:14 +0000 (20:32 -0700)]
Add large, medium and small TextViews to the palette

Add variations of TextView using the various textAppearance
attributes to get the standard styles for large, medium
and small text views:
  ?android:attr/textAppearanceLarge
  ?android:attr/textAppearanceMedium
  ?android:attr/textAppearanceSmall

Also removes EditText from the Form Widgets category to
discourage using the untyped field.

Change-Id: I8cf58492d3acbee7a6d2a7f183830fb8a854e3c8

13 years agoAdd custom views and third party views to the palette
Tor Norbye [Thu, 17 Mar 2011 16:00:14 +0000 (09:00 -0700)]
Add custom views and third party views to the palette

This changeset adds a new category to the palette, "Custom & Third
Party Views", which is populated with android.view.View subclasses
found in the current project (or any of its libraries), and in any
jars included by the project. They can be dragged directly to the
canvas, and control clicking on the palette entries will jump to the
source.

There are a bunch of adjustments in various places to make working
with custom views better - from ensuring that we don't use fully
qualified class names in default ids, to showing the Java class icon
for custom views in outline and elsewhere, to making zero-sized view
highlight and expand when selected like we do for laoyuts - since with
custom views it's quite easy to end up with an "invisible" view that
you can't see after dropping it.

There are also some fixes to the code which looks up third party and
custom views (which was already used by the Wrap In refactoring) - to
handle inner classes, to filter out non public or abstract classes,
and most importantly to only include views reachable from the current
project (since the view search necessarily is workspace wide.)

Change-Id: If1d8c7e5c7dd907a68d8d0962e85c5144e911503

13 years agoOn ImageView or ImageButton drop, ask user for drawable
Tor Norbye [Sat, 19 Mar 2011 23:22:58 +0000 (16:22 -0700)]
On ImageView or ImageButton drop, ask user for drawable

Similar to the <include> tag handling, when you drop an image a
resource chooser inputting @drawable resources pops up and lets you
pick the drawable to be shown in the image. If you cancel, then the
default image will be set instead.

Change-Id: Id09801a877acbeb437f518cefe60062ac92e7e7c

13 years agoMerge "Fix unit tests from the previous refactor."
Xavier Ducrohet [Fri, 18 Mar 2011 20:27:28 +0000 (13:27 -0700)]
Merge "Fix unit tests from the previous refactor."

13 years agoMerge "Make edit texts grow in horizontal LinearLayouts using weights"
Tor Norbye [Fri, 18 Mar 2011 20:00:49 +0000 (13:00 -0700)]
Merge "Make edit texts grow in horizontal LinearLayouts using weights"

13 years agoMerge "Fix AAPT error range"
Tor Norbye [Fri, 18 Mar 2011 19:59:52 +0000 (12:59 -0700)]
Merge "Fix AAPT error range"

13 years agoFix unit tests from the previous refactor.
Xavier Ducrohet [Fri, 18 Mar 2011 19:13:51 +0000 (12:13 -0700)]
Fix unit tests from the previous refactor.

Change-Id: I464fe3f94e701e619b474f82aaf84ee04d158e71

13 years agoMake edit texts grow in horizontal LinearLayouts using weights
Tor Norbye [Fri, 18 Mar 2011 03:53:52 +0000 (20:53 -0700)]
Make edit texts grow in horizontal LinearLayouts using weights

If you drop a text field in a vertical linear layout, then the *width*
of the text field is automatically set to fill.  This uses metadata to
check what the fill preference is of each dropped view.

This changeset extends this scheme to also grow text fields in a
horizontal linear layout. However, instead of using fill_parent on the
layout_width, this uses a layout_weight instead. This means that the
text field will fill, but it will not push subsequent children out of
the way the way a fill_parent would.

This changeset also changes the default orientation of a LinearLayout
that is created in new XML files. (I looked around and noticed most
layouts that have a LinearLayout at the root will use a vertical
LinearLayout.)

Change-Id: I52eec4841e4bac076da655c603235547cfd46b73

13 years agoMerge "Move classes to ide-common"
Xavier Ducrohet [Fri, 18 Mar 2011 18:29:08 +0000 (11:29 -0700)]
Merge "Move classes to ide-common"

13 years agoFix AAPT error range
Tor Norbye [Fri, 18 Mar 2011 18:27:52 +0000 (11:27 -0700)]
Fix AAPT error range

Turns out the AAPT errors always list a line number that corresponds
to the line where the element starts.  If the error occurs in an
attribute that is on a subsequent line, the code to identify the
editor offset failed.

This changeset addresses that, by using a document forward search to
locate the attribute. The quickfix code was also checking for an exact
line number match, so that code is tweaked as well.

Change-Id: Ib648d2e2e7ad3ba082fd3c6a48e7f077b3aebc10

13 years agoMerge "Remove references to SWT from classes that are moving to ide-common."
Xavier Ducrohet [Fri, 18 Mar 2011 17:05:14 +0000 (10:05 -0700)]
Merge "Remove references to SWT from classes that are moving to ide-common."

13 years agoMerge "Remove unused contentTypeBinding."
Raphael Moll [Fri, 18 Mar 2011 17:03:14 +0000 (10:03 -0700)]
Merge "Remove unused contentTypeBinding."

13 years agoRemove unused contentTypeBinding.
Raphael Moll [Fri, 18 Mar 2011 05:34:46 +0000 (22:34 -0700)]
Remove unused contentTypeBinding.

This was added as a test when investigating the issue 15003.
It's actually harmful and prevents from following links to
like @android:string/ok from XML resource files.

Change-Id: Ib0ae523a139cff960b222c138136c27902f26e7a

13 years agoMove classes to ide-common
Xavier Ducrohet [Fri, 18 Mar 2011 01:52:22 +0000 (18:52 -0700)]
Move classes to ide-common

ResourceFolder/File and children classes (single/multi file)
ResourceItem and children classes
ResourceRepository (base and framework, project stays in ADT for now)
All the ResourceQualifiers and FolderConfiguration

Change-Id: I5adc9bdc4886a8fa0ab44860763d594cf7af4bd5

13 years agoMerge "Add missing notice files."
Xavier Ducrohet [Fri, 18 Mar 2011 02:01:40 +0000 (19:01 -0700)]
Merge "Add missing notice files."

13 years agoRemove references to SWT from classes that are moving to ide-common.
Xavier Ducrohet [Fri, 18 Mar 2011 01:01:46 +0000 (18:01 -0700)]
Remove references to SWT from classes that are moving to ide-common.

- Move the SWT based getIcon from the resource qualifier and use a static
  helper instead.

- Make a new enum ResourceDeltaKind to replace the IResourceDelta
  integer constants, and use the same helper class to convert from
  one to the other.

- Make ResourceRepository exclusively use the IAbstractFile/Folder

- Use the ILogger in place of AdtPlugin (which implements ILogger)

Change-Id: I0011c01ac2064b07d28c980112c47cfa433ee372

13 years agoMerge "Fix bounds computation for drags from palette to canvas"
Tor Norbye [Fri, 18 Mar 2011 00:56:40 +0000 (17:56 -0700)]
Merge "Fix bounds computation for drags from palette to canvas"

13 years agoFix bounds computation for drags from palette to canvas
Tor Norbye [Thu, 17 Mar 2011 16:22:25 +0000 (09:22 -0700)]
Fix bounds computation for drags from palette to canvas

When you drag over the canvas, the potential drop location is shown
along with an outline of the component as it would appear at that
location. This relies on knowing the size of the dragged component.

When dragging from the palette we use the drag preview image. However,
the bounds were a bit too big because we were using the raw size of
the drag image, and it now includes a drop shadow!  This changeset
adjusts this such that we use the original ViewInfo bounds from the
render rather than the usually larger image bounds.

Change-Id: Ic4b870995e17284fbd8a7ed2f4b4a7ec02f4e2c3

13 years agoMerge "Disable the "unecessary else" warning."
Raphael Moll [Thu, 17 Mar 2011 20:59:51 +0000 (13:59 -0700)]
Merge "Disable the "unecessary else" warning."

13 years agoMerge "Remove xml content type binding from ExportEditor."
Raphael Moll [Thu, 17 Mar 2011 20:43:40 +0000 (13:43 -0700)]
Merge "Remove xml content type binding from ExportEditor."

13 years agoMerge "Add Quickfix and Quick Assistant for creating resources"
Tor Norbye [Thu, 17 Mar 2011 20:35:01 +0000 (13:35 -0700)]
Merge "Add Quickfix and Quick Assistant for creating resources"

13 years agoRemove xml content type binding from ExportEditor.
Raphael Moll [Wed, 16 Mar 2011 22:22:39 +0000 (15:22 -0700)]
Remove xml content type binding from ExportEditor.

This was added by mistake when we were investigating the
issue of bug 15003. The contentTypeBinding seems to be
unused by Eclipse when selecting the proper editor, but
it's still wrong to have it set on XML For the ExportEditor.
since this one uses export.properties files.

Change-Id: I82396debe6bcb4571f150b929aa5e0287f4e9dea

13 years agoAdd Quickfix and Quick Assistant for creating resources
Tor Norbye [Tue, 15 Mar 2011 04:15:57 +0000 (21:15 -0700)]
Add Quickfix and Quick Assistant for creating resources

This changeset adds two related features:

- A "marker resolution" which adds a quickfix to aapt errors for
  nonexistent resources. This means that you can right click on the
  error in the Problems view to create the associated missing
  resource.

- A "quick assistant" which looks for a missing resource on the
  current line and if found adds a fix handler for it, similar to the
  quickfix above.

When a fix is invoked, it will create the new file or value, and open
it in the editor with the relevant value section selected.

The quick assistant can be invoked by the normal Ctrl-1 (Cmd-1). The
quickfix must be invoked from the Problems view; the Java editor seems
to add an extra level of integration with a lightbulb in the editor
margin but we don't get that in XML.

The quickfixes work for all value-based resources, as well as some
file-based ones (in particular, those supported by the New XML File
wizard, which it reuses.)

This changeset also adds unit tests for quickfixes along with a few
infrastructure changes to support it.

Change-Id: I962bcf6c98934685e4d74389469d0903115a75e3

13 years agoMerge "XML code completion improvements"
Tor Norbye [Thu, 17 Mar 2011 19:42:40 +0000 (12:42 -0700)]
Merge "XML code completion improvements"

13 years agoDisable the "unecessary else" warning.
Raphael Moll [Wed, 16 Mar 2011 22:15:34 +0000 (15:15 -0700)]
Disable the "unecessary else" warning.

This can be a matter of personal taste, but I find it a lot
more readable to write an if {} else {} sometimes, and it's
perfectly valid, so really it shouldn't be marked as a warning.

Change-Id: Iac1b9bd5f9602b5018f7432422e0a083f4836490

13 years agoSDK Manager dialog to manage user add-on sites.
Raphael Moll [Tue, 15 Mar 2011 23:29:28 +0000 (16:29 -0700)]
SDK Manager dialog to manage user add-on sites.

Change-Id: I36209964b8a59c6f8b987032e175849a35cf467a

13 years agoRevamp of the SDK Manager UI.
Raphael Moll [Sat, 26 Feb 2011 03:37:29 +0000 (19:37 -0800)]
Revamp of the SDK Manager UI.

This replaces the Installed Packages and
Available Packages page by a single one that
combines both installed and available updates.

This is still experimental and is actually
not enabled unless the env var EXPERIMENTAL is
set.

Change-Id: I5ec5776da69d2668ce746c07df022bf5adc6fbf7

13 years agoMerge "Removing emulator/opengl from the sdk.git"
David Turner [Wed, 16 Mar 2011 12:36:43 +0000 (05:36 -0700)]
Merge "Removing emulator/opengl from the sdk.git"

13 years agoRemoving emulator/opengl from the sdk.git
Jacky Romano [Wed, 16 Mar 2011 12:31:38 +0000 (14:31 +0200)]
Removing emulator/opengl from the sdk.git

This project code is moving to live under development.git/tools/emulator

Change-Id: I3f7673bc17681a0ffa14bb0b4d0880977b77f24d

13 years agoAdd missing notice files.
Xavier Ducrohet [Tue, 15 Mar 2011 19:10:31 +0000 (12:10 -0700)]
Add missing notice files.

Also fix some makefiles to make sure the notices are
picked up.
- move the makefile outside of the source folder.
- resources are now in the source folder directly instead
  of being inside src/resources. It's much simpler.

Change-Id: Ica8ee4c2bc8a9b035d23fc914d4137cdca7e567d

13 years agoMerge "ConcurrentModificationException in AbstractPropertiesFieldsPart"
Tor Norbye [Tue, 15 Mar 2011 19:05:36 +0000 (12:05 -0700)]
Merge "ConcurrentModificationException in AbstractPropertiesFieldsPart"

13 years agoMerge "Add specifc warnings config for most sdk eclipse projects."
Xavier Ducrohet [Tue, 15 Mar 2011 18:28:42 +0000 (11:28 -0700)]
Merge "Add specifc warnings config for most sdk eclipse projects."

13 years agoConcurrentModificationException in AbstractPropertiesFieldsPart
Tor Norbye [Tue, 15 Mar 2011 03:57:35 +0000 (20:57 -0700)]
ConcurrentModificationException in AbstractPropertiesFieldsPart

I ran into a ConcurrentModificationException when creating an XML file
using the plain XML wizard (not the Android XML wizard - because I
wanted to create an XML drawable which is not supported by the new
Android XML wizard.)

Change-Id: Id2ae606e9da47e6f7d42cf6a0dea61eb3e9ca15d

13 years agoXML code completion improvements
Tor Norbye [Tue, 15 Mar 2011 04:03:56 +0000 (21:03 -0700)]
XML code completion improvements

This changeset contains a number of improvements to the code
completion in XML files.

(1) Add suffix completion in attribute values. For dimensional
    attributes, this will add in (or complete prefixes of) units like
    "dp", "sp", etc. For fractional attributes, the % and %p suffixes
    are completed. (In both cases, there is also a tooltip message
    provided shown in the completion documentation popup).  In
    addition, for flag values, when completing at the end of a flag,
    then the separator character (|) along with the other flag values
    (except those already set) are offered.

(2) Handle completion when the caret is not at the end. For example,
    if you have the following source:

        layout_w^idth="wrap_content"    (^ = caret position)

    then if you invoke code completion you will also be offered the
    attribute layout_weight, and selecting it will -replace- the
    layout_width attribute with layout_height, it will not insert
    layout_weight in the middle of layout_width. This handling is done
    not just for attribute names as shown here but for attribute
    values and element tag names as well.

(3) Improve @resource/ completion sorting. When completing resources,
    consider which attribute is being completed, and use that
    information to sort the resources.  For example, if completing a
    "text" attribute then @string/, and @android:string/ resources
    will be listed first.  For attributes like margins @dimen will be
    first, for include layout the @layout attributes will be listed
    first, and so on.  Also, the resources are sorted alphabetically
    as the second sort key.

(4) Hide some builtin Eclipse code completion items. In particular,
    the default code completion provider for Eclipse will always add
    the current attribute value as a completion. This is extremely
    confusing since if you have a typo, code completion will tell you
    that what you have is okay. I personally witnessed this confusing
    a user who had typed something from memory and code completion
    seemed to him to "confirm" that he had it right.

    To fix this, the code which installs completion providers, will
    identify the builting WST completion provider, and when found,
    replace it with a "filtering" wrapper. This completion provider
    delegates all its calls to the WST completion provider, but it
    recognizes a few patterns, in particular the above attribute value
    completion proposal as well as some namespace and schema ones, and
    removes these.

    (The reason we only filter out these items instead of removing it
    completely is that the completion provider also appears to be
    responsible for inserting code templates defined by the user, and
    we don't want to neuter those if defined by the user.)

(5) Fix a bunch of corner cases - flags could only have a single
    separator (|), resource attribute completion items were missing
    icons, and completion in some positions was not working.

(6) Unit tests. There are now comprehensive unit tests for code
    completion. Each unit test points to a particular source file
    and a particular position within the source file, and code completion
    is invoked for that position. A set of unit tests dump out the
    allowed completion items for each such position, and these are
    compared against golden files. A second set of unit tests then
    specify a particular code completion item among the choices to
    be applied, and then applies that completion item to the document.
    This, along with the caret position (indicated as ^) is written
    into a golden file and used for comparisons. To make it easy
    to see what these tests do, the golden file is actually recorded
    as a diff, so in the test you will see something like this:

Code completion in completion1.xml for android:gravity="left|b^ottom"
selecting bottom:
<         android:gravity="left|bottom"
---
>         android:gravity="left|bottom^"

(6) There are some other misc changes. We had some code which used
    "dip" for device indepdendent pixels (such as the AbsoluteLayout
    handler). Since "dp" seems to be preferred, the code will now
    use that instead.

Change-Id: I8bd5c8336d8747dac1f10a9269ea4197f304cb70

13 years agoAdd specifc warnings config for most sdk eclipse projects.
Xavier Ducrohet [Wed, 9 Mar 2011 22:06:37 +0000 (14:06 -0800)]
Add specifc warnings config for most sdk eclipse projects.

Change-Id: I9837714c5673d43fa7108b16ab264f1017c4bd3d

13 years agoMerge "Prepare for moving platform-specific emulator modules to development.git"
David 'Digit' Turner [Mon, 14 Mar 2011 16:41:43 +0000 (09:41 -0700)]
Merge "Prepare for moving platform-specific emulator modules to development.git"

13 years agoMerge "XML code completion improvements"
Tor Norbye [Sat, 12 Mar 2011 01:23:41 +0000 (17:23 -0800)]
Merge "XML code completion improvements"

13 years agoXML code completion improvements
Tor Norbye [Thu, 10 Mar 2011 20:16:22 +0000 (12:16 -0800)]
XML code completion improvements

First, fix code completion for @android: resources such that if you
type @android: the various resource types (@android:drawable/,
@android:layout/, etc) are offered.

Second, fix completion for the @android: token itself such that if you
type "@a" then "@android:" is offered as a completion.

Finally, make resource name completion work even for attributes that
aren't marked in the metadata as allowing resource references.  This
will not be done for empty completion context, but if the user
-explicitly- types a "@" in the value field, then resource completion
will work. This is necessary for some attributes where our metadata is
wrong, such as android:minHeight, where code completion currently
refuses to complete a @dimen/ completion prefix.

Change-Id: I175c8f7230d56987b9a945a2b791a2eb3e018a7c

13 years agoMerge "Extract as Include support for configuration variations"
Tor Norbye [Sat, 12 Mar 2011 00:25:06 +0000 (16:25 -0800)]
Merge "Extract as Include support for configuration variations"

13 years agoExtract as Include support for configuration variations
Tor Norbye [Mon, 7 Mar 2011 22:16:48 +0000 (14:16 -0800)]
Extract as Include support for configuration variations

First, add support for the "Extract as Include" refactoring to update
all identical code fragments in configuration variations of the same
file.  For example, if you have a particular subtree of XML elements
in a file that you have then duplicated into say a landscape mode,
then applying the Extract as Include refactoring will locate the same
code fragment in both files, and replace *both* code fragments with an
include (and this is optional with a checkbox in the wizard
dialog). This only happens when the extracted code fragment is
"identical" in both files. The code fragments can vary in terms of XML
formatting and attribute order (and namespace prefix choice), but the
element hierarchy order, names, attributes defined and attribute
values must be identical.

Second, make fixes to the Change Layout and Change Widget Type
refactorings such that when the id of the converted element is
changed, then references to that id are updated as well.

Third, ensure that the refactorings are enabled even when there is no
text selection; in that case the refactoring will apply to the element
containing the caret.

Some test infrastructure improvements.

Change-Id: Idb4ba40f4217dba2b13881b3d06e269c80ba4b97

13 years agoMerge "Underline the error range for aapt errors"
Tor Norbye [Sat, 12 Mar 2011 00:05:35 +0000 (16:05 -0800)]
Merge "Underline the error range for aapt errors"

13 years agoUnderline the error range for aapt errors
Tor Norbye [Fri, 11 Mar 2011 16:52:18 +0000 (08:52 -0800)]
Underline the error range for aapt errors

Currently, aapt errors only show up as an error icon in the left hand
margin, and the user has to figure out from the error message where on
the line the error occurred.

This changeset uses information in the error message to identify the
specific range of text on the line that is affected, and underlines
it.

Change-Id: I322a8193af4e90bb972276aee80124771b6a46cd

13 years agoMerge "Add drop-support for include tags"
Tor Norbye [Fri, 11 Mar 2011 21:50:10 +0000 (13:50 -0800)]
Merge "Add drop-support for include tags"

13 years agoPrepare for moving platform-specific emulator modules to development.git
David 'Digit' Turner [Fri, 11 Mar 2011 14:59:18 +0000 (15:59 +0100)]
Prepare for moving platform-specific emulator modules to development.git

We need to move the platform-specific modules to development.git to
avoid some clashes. This patch uses a guard Make variable to ensure that
each module is only built once.

The plan is to simply copy these modules to development.git, then remove
the current ones from sdk.git. The guard variable is here to ensure that
the transition happens smoothly, i.e. if a build contains modules in
both directories, only one of them will be built.

Change-Id: I4bc58741a18488f18a4b17e8a1edc4a4a5a93cbc

13 years agoMerge "Avoid repeating manifest element names."
Raphael Moll [Fri, 11 Mar 2011 03:05:15 +0000 (19:05 -0800)]
Merge "Avoid repeating manifest element names."

13 years agoAvoid repeating manifest element names.
Raphael Moll [Fri, 11 Mar 2011 00:40:19 +0000 (16:40 -0800)]
Avoid repeating manifest element names.

In the manifest form tree, avoid repeating element names
in the tree labels. E.g. "MyActivity (Activity)" can just
be "MyActivity".

Change-Id: I8de481aabcbc33e830e18c528cb10a0b2a14138a

13 years agoMerge "Guard against badly configured projects in aidl processor."
Xavier Ducrohet [Fri, 11 Mar 2011 01:45:10 +0000 (17:45 -0800)]
Merge "Guard against badly configured projects in aidl processor."

13 years agoGuard against badly configured projects in aidl processor.
Xavier Ducrohet [Fri, 11 Mar 2011 00:33:47 +0000 (16:33 -0800)]
Guard against badly configured projects in aidl processor.

The project could have source folders that don't exist.

Change-Id: Ie8f9e35580918d9fade5074ca90d295c49e6cae4

13 years agoMerge "A bit more refactoring around the resource repository."
Xavier Ducrohet [Thu, 10 Mar 2011 23:04:29 +0000 (15:04 -0800)]
Merge "A bit more refactoring around the resource repository."

13 years agoA bit more refactoring around the resource repository.
Xavier Ducrohet [Thu, 10 Mar 2011 22:18:28 +0000 (14:18 -0800)]
A bit more refactoring around the resource repository.

- Move Configurable in the same package as FolderConfiguration.
- Move ResourceManager.getConfig in FolderConfiguration.
- Move ResourceMaanger.processFolder in ResourceRepository.
- Move ResourceManager.processFile in ResourceFolder.
- Rename some misc methods.

Change-Id: Ifa557c7db22c3fb82327a68f4365c08d152d9cf4

13 years agoMerge "Deactive the logging code used for issue 15003."
Raphael Moll [Thu, 10 Mar 2011 20:32:21 +0000 (12:32 -0800)]
Merge "Deactive the logging code used for issue 15003."

13 years agoMerge "Make inline ResourceItem able to generate ResourceValue"
Xavier Ducrohet [Thu, 10 Mar 2011 20:06:37 +0000 (12:06 -0800)]
Merge "Make inline ResourceItem able to generate ResourceValue"

13 years agoMake inline ResourceItem able to generate ResourceValue
Xavier Ducrohet [Thu, 10 Mar 2011 18:55:52 +0000 (10:55 -0800)]
Make inline ResourceItem able to generate ResourceValue

This change fix the issue that since the simplification of
the resource repository, the resource item for inline ID values
would not be called to generate a ResourceValue since their
list of source file was empty.

This moves the creation of the ResourceValue to the ResourceItem
so that InlineResourceItem can override it.

This required moving findMatchingConfigurable into FolderConfiguration
which is a much better place for it anyway.

Change-Id: I36d6b148528c593ea432c9fd0ac8d542cbe2a26e

13 years agoMerge "ADT: fix unittests."
Xavier Ducrohet [Thu, 10 Mar 2011 00:30:00 +0000 (16:30 -0800)]
Merge "ADT: fix unittests."

13 years agoAdd drop-support for include tags
Tor Norbye [Wed, 9 Mar 2011 21:18:34 +0000 (13:18 -0800)]
Add drop-support for include tags

Add the include tag back into the palette, and add special drop
support for it such that when it is drop, a resource chooser pops up
and asks you which layout to include. A new validator prevents any
layouts from being chosen that would result in a cyclic
dependency.

This requires some infrastructure changes: First, drop handlers must
distinguish between a view getting created as part of a previewing
operation and getting created interactively. Second, in order to
support cancel removing an inserted include if the user decides not to
set an include, the node wrappers need to support removing an element.
Also, use the metadata originally intended for the preview icon
factory to also bypass palette drag previews for widgets that don't
have UI.

Change-Id: I1bdd1766ca4cfa2fdbca25b77c50c74e9c332cbd

13 years agoADT: fix unittests.
Xavier Ducrohet [Wed, 9 Mar 2011 23:51:38 +0000 (15:51 -0800)]
ADT: fix unittests.

Change-Id: I258d393b5297d916b58ed3574b77f521968a13c0

13 years agoMerge "Fix potential NPE in AvdCreationDialog"
Raphael Moll [Wed, 9 Mar 2011 21:11:24 +0000 (13:11 -0800)]
Merge "Fix potential NPE in AvdCreationDialog"

13 years agoDeactive the logging code used for issue 15003.
Raphael Moll [Wed, 9 Mar 2011 21:10:43 +0000 (13:10 -0800)]
Deactive the logging code used for issue 15003.

This doesn't quite remove the logging code,
just deactivate it for right now.

Change-Id: I9a471926f6575bce117bf6079200f7939457fb57

13 years agoMerge "Deactive BinaryXml ContentType."
Raphael Moll [Wed, 9 Mar 2011 21:09:48 +0000 (13:09 -0800)]
Merge "Deactive BinaryXml ContentType."

13 years agoMerge "Resource management refactoring and clean-up."
Xavier Ducrohet [Wed, 9 Mar 2011 21:08:53 +0000 (13:08 -0800)]
Merge "Resource management refactoring and clean-up."

13 years agoMerge "- Fix a NPE when arguments are not properly understood by MonkeyRunner - Add...
Bill Napier [Wed, 9 Mar 2011 17:11:56 +0000 (09:11 -0800)]
Merge "- Fix a NPE when arguments are not properly understood by MonkeyRunner - Add the ability to pass Boolean types for Intent extras (extras={'a':True, 'b':False}) - Fix an improper flag being passed to am start - Pass the key and value to am start instead of just the value."

13 years ago- Fix a NPE when arguments are not properly understood by MonkeyRunner
Vijay Yellapragada [Wed, 9 Mar 2011 16:01:18 +0000 (10:01 -0600)]
- Fix a NPE when arguments are not properly understood by MonkeyRunner
- Add the ability to pass Boolean types for Intent extras (extras={'a':True, 'b':False})
- Fix an improper flag being passed to am start
- Pass the key and value to am start instead of just the value.

Change-Id: Ifd0c69ccb4c2755a49efca2d3f8b3befa212a69f

13 years agoDeactive BinaryXml ContentType.
Raphael Moll [Wed, 9 Mar 2011 07:31:27 +0000 (23:31 -0800)]
Deactive BinaryXml ContentType.

This breask the BinaryXml Editor feature.
However it fixes the issue 15003, which is more important:
  http://code.google.com/p/android/issues/detail?id=15003

Change-Id: Iac0fb6ef38b7d6e60da1c8526ce9f58db2e7994b

13 years agoFix potential NPE in AvdCreationDialog
Raphael Moll [Wed, 9 Mar 2011 02:05:49 +0000 (18:05 -0800)]
Fix potential NPE in AvdCreationDialog

Change-Id: Ic71e0242b34979f621e291c808b6a0ee35b711ff

13 years agoResource management refactoring and clean-up.
Xavier Ducrohet [Tue, 1 Mar 2011 00:49:37 +0000 (16:49 -0800)]
Resource management refactoring and clean-up.

- (I)ResourceRepository is now a common class instead of an
  interface. This contains most of the code to control
  a repository (which was extracted from ProjectResources)
  ProjectResources extends it adding minor features such as
      library support, and inline ID definition.
  FrameworkResources extends it adding support for public
      resources (which used to be duplicated and dispersed
      in weird places).
  Changed the way resources are reloaded on resource change event.
  Instead of marking the resources as modified (using
  Resource.touch()), the resources are now parsed as the files are
  processed during the resource delta visitor. This makes more sense
  as there are now other listeners to the resource changes (hyperlinks)
  that access the resource list in their listeners, which wouldn't work
  previously.
  This also makes the code cleaner as the previous method had to query
  the repo for items and return a list of new ones, which was kinda
  crappy. The new code is much simpler, as is the post update process.

- ResourceItem is now the base class for resource items. It includes
  all the small methods that were added by all the child classes or
  interfaces.
  Project/ConfigurableResourceItem are merged into the based class.
  IIdResourceItem and IdResourceItem are gone and replaced by a
  simpler InlineResourceItem.
  FrameworkResourceItem is a simple override for framework resources.

- Also improved the API of a bit for the resource repository, making
  more use of unmodifiable lists and emptyList/Map()

Change-Id: Ie3ac1995213fed66153c7e7ecbdd170ec257be62

13 years agoMerge "Make the feature require Eclipse 3.5"
Xavier Ducrohet [Wed, 9 Mar 2011 01:12:44 +0000 (17:12 -0800)]
Merge "Make the feature require Eclipse 3.5"

13 years agoMake the feature require Eclipse 3.5
Xavier Ducrohet [Wed, 9 Mar 2011 00:31:02 +0000 (16:31 -0800)]
Make the feature require Eclipse 3.5

Change-Id: Idcc1ae2566e41656327190053e8e0ea22264d31d

13 years agoMerge "ADT: differentiate icons in from editors."
Raphael Moll [Wed, 9 Mar 2011 00:14:03 +0000 (16:14 -0800)]
Merge "ADT: differentiate icons in from editors."

13 years agoADT: differentiate icons in from editors.
Raphael Moll [Sat, 5 Mar 2011 18:23:12 +0000 (10:23 -0800)]
ADT: differentiate icons in from editors.

In ElementDescriptor, provide 2 icon methods:
- getIcon() returns a generic icon whatever the descriptor.
  This is used by the XML content assist.
- getFormIcon() return an icon specific to the descriptor.
  This is used by the form editor in the block/detail tree.

The icons are the same auto-generated stuff than before.
A changeset with specific 'pretty' icons would be more than welcome.

Change-Id: Ib0ff8298101462a7dd7e8e92f671eb0171e46c48

13 years agoMerge "Add more logging to ADT for file open and binary XML."
Xavier Ducrohet [Tue, 8 Mar 2011 00:35:56 +0000 (16:35 -0800)]
Merge "Add more logging to ADT for file open and binary XML."

13 years agoMerge "Add logging to precompiler builder."
Xavier Ducrohet [Tue, 8 Mar 2011 00:29:16 +0000 (16:29 -0800)]
Merge "Add logging to precompiler builder."

13 years agoAdd logging to precompiler builder.
Xavier Ducrohet [Tue, 8 Mar 2011 00:16:05 +0000 (16:16 -0800)]
Add logging to precompiler builder.

There are some reports of NPE in the builders on mDerivedProgressMonitor
which means startupOnInitialize would fail to finish.

This adds a log in the method should an exception be thrown.

Change-Id: I90170b0dcc3c97a772b5d72111db9dbbbf2ee277

13 years agoAdd more logging to ADT for file open and binary XML.
Raphael Moll [Tue, 8 Mar 2011 00:22:08 +0000 (16:22 -0800)]
Add more logging to ADT for file open and binary XML.

Also in the plugin.xml, associate our editors to the "pure"
XML contentType. This should prevent Eclipse from trying
to use our editors for an invalid unsupported type.

It doesn't fix the fact the contentType isn't properly discovered.

Change-Id: Ife053c74a936d105537c49b54f3abc987001bca7

13 years agoMerge "ADT Manifest: fix XML attribute completion."
Raphael Moll [Mon, 7 Mar 2011 21:39:32 +0000 (13:39 -0800)]
Merge "ADT Manifest: fix XML attribute completion."

13 years agoMerge "DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)"
Raphael Moll [Mon, 7 Mar 2011 16:59:20 +0000 (08:59 -0800)]
Merge "DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)"

13 years agoDISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)
Raphael Moll [Mon, 7 Mar 2011 16:47:42 +0000 (08:47 -0800)]
DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)

Change-Id: I7d589782bf898d1ce09d0e29108566f7560019f1

13 years agoADT Manifest: fix XML attribute completion.
Raphael Moll [Sat, 5 Mar 2011 18:21:49 +0000 (10:21 -0800)]
ADT Manifest: fix XML attribute completion.

XML completion wasn't done properly for attributes for element
that had a dash (-) in them.

Change-Id: I433f3711e1991246d099246847c7204e04ae3e40

13 years agoMerge "Don't erase SDCard when editing existing AVD."
Raphael Moll [Fri, 4 Mar 2011 21:48:29 +0000 (13:48 -0800)]
Merge "Don't erase SDCard when editing existing AVD."

13 years agoDon't erase SDCard when editing existing AVD.
Raphael Moll [Mon, 28 Feb 2011 22:11:44 +0000 (14:11 -0800)]
Don't erase SDCard when editing existing AVD.

SDK Bug 14162

Change-Id: I22493443e706bda830916ed0fc09741a1d6d1f15

13 years agoMerge "Add logging to help track down issue #15003 in the wild"
Tor Norbye [Fri, 4 Mar 2011 21:30:43 +0000 (13:30 -0800)]
Merge "Add logging to help track down issue #15003 in the wild"

13 years agoAdd logging to help track down issue #15003 in the wild
Tor Norbye [Fri, 4 Mar 2011 21:20:04 +0000 (13:20 -0800)]
Add logging to help track down issue #15003 in the wild

Change-Id: I3b7fb370e7e4b018d02b3986d81b14e89086c191

13 years agoMerge "Fix NPE in SdkManager: parsed props can be null."
Raphael Moll [Fri, 4 Mar 2011 20:55:56 +0000 (12:55 -0800)]
Merge "Fix NPE in SdkManager: parsed props can be null."