OSDN Git Service
Tor Norbye [Mon, 28 Mar 2011 16:16:41 +0000 (09:16 -0700)]
Extract Style Refactoring
Adds a new refactoring, "Extract Style", which will show the user the
attributes for the current selected elements (or if invoked from an
editor context, the attributes overlapping the current caret or editor
selection). The user can select which attributes to extract, and these
are then added as a new style in the styles.xml file in the project
(which is created if necessary). The user can optionally replace the
attributes that were extracted, and the user can also optionally set
the style attribute on the elements to the new style. (Both are on by
default.) This is integrated with the refactoring quick assistant as
well.
Change-Id: I0504e86a824b00730482607150a879ff28233618
Tor Norbye [Thu, 31 Mar 2011 00:27:22 +0000 (17:27 -0700)]
Merge "Make sure files opened from XML wizard go to the WYSIWYG editor"
Tor Norbye [Wed, 30 Mar 2011 22:31:29 +0000 (15:31 -0700)]
Merge "Auto-zoom views the first time they are opened"
Xavier Ducrohet [Wed, 30 Mar 2011 20:55:33 +0000 (13:55 -0700)]
Merge "Add repeat count config to layoutlib_api's AdapterBinding."
Tor Norbye [Wed, 30 Mar 2011 16:20:02 +0000 (09:20 -0700)]
Auto-zoom views the first time they are opened
Now that we default to the tablet screen size, creating a new layout
usually opens up a view which only shows the top left part of the
design view, and horizontal and vertical scrollbars.
This changeset adds auto-zoom such that the first time a view is
opened, the view also auto-zooms. Note that the type of zooming
performed is zoom-out-only; it never zooms in, so a small phone layout
will continue to be shown at 100%. We already perform auto-zoom in
several other scenarios (such as changing orientation).
Change-Id: I1e9a9e8357c952f84b541ea799c529d5dc4b3239
Tor Norbye [Wed, 30 Mar 2011 15:44:15 +0000 (08:44 -0700)]
Make sure files opened from XML wizard go to the WYSIWYG editor
Change-Id: I51a0d96564b5fa896eb4daef50f193df7cadfa20
Xavier Ducrohet [Wed, 30 Mar 2011 00:26:07 +0000 (17:26 -0700)]
Add repeat count config to layoutlib_api's AdapterBinding.
Change-Id: Idbb54de6dee6d6b466476a0e3acdd87dd394ee42
Xavier Ducrohet [Tue, 29 Mar 2011 20:46:37 +0000 (13:46 -0700)]
Merge "Add support for data binding in the layout editor."
Xavier Ducrohet [Tue, 29 Mar 2011 18:01:49 +0000 (11:01 -0700)]
Add support for data binding in the layout editor.
The Layoutlib_api is changed to allow passing information regarding
adapter content, and querying eclipse to fill the items.
Change-Id: Ie5a047ab9cd0ed7677c13309d95663eae462c3e7
Tor Norbye [Mon, 28 Mar 2011 22:57:32 +0000 (15:57 -0700)]
Merge "Test infrastructure fixes"
Tor Norbye [Wed, 23 Mar 2011 13:58:26 +0000 (06:58 -0700)]
Test infrastructure fixes
Add methods which allow a test case to specify that it needs a unique
project for the testcase (or even for each individual test
method). This allows tests which modify the project (such as the
quickfix-resource-creation tests) to not cause side effects that
affect other tests (e.g. resources created by the quickfix could show
up in code completion results by the code completion tests, which
meant the goldenfiles would have to either include them or exclude
them, which meant the tests must always be run together or never run
together.
The changeset also adds an environment variable pointing to the git
working copy allowing tests with no golden file to create the golden
files directly. This makes it easy to add new test cases; just write
the test scenarios, run them, which will fail all the tests but also
write out the expected golden files. Verify them and check them in and
running the tests again should pass if the output is stable.
Change-Id: I2e2789c00c84a31a9fbc603851879d8d83342ad3
Tor Norbye [Mon, 28 Mar 2011 21:01:30 +0000 (14:01 -0700)]
Merge "15736: Eclipse crashes in layout editor when browsing element's properties"
Tor Norbye [Mon, 28 Mar 2011 21:01:18 +0000 (14:01 -0700)]
Merge "Code completion in style definitions & other improvements"
Xavier Ducrohet [Mon, 28 Mar 2011 20:29:45 +0000 (13:29 -0700)]
Merge "Better default selection when choosing a device config."
Tor Norbye [Mon, 28 Mar 2011 18:24:48 +0000 (11:24 -0700)]
15736: Eclipse crashes in layout editor when browsing element's properties
This changeset attempts to fix issue 15736. The root bug is an SWT bug
which can cause a JVM crash in some scenarios. However, it seems to be
triggered by code which performs a gradient paint in the property
sheet (which is in fact done to work around another SWT bug...).
Using a gradient is not necessary - a plain background paint will do -
so this changeset simplifies the code to only fill the background. It
also leaves the selection flag on the event alone such that other
parts of the list (such as category items) are not affected.
Change-Id: Ica32fe1e6f49f1e4154c3ffad9cae9799fcc4723
Tor Norbye [Wed, 23 Mar 2011 23:42:13 +0000 (16:42 -0700)]
Code completion in style definitions & other improvements
This changeset adds code completion support to resource files where
<style> elements are defined. In particular, you get two types of
completion:
- Completion on names: <style><item name="|" >
Here you get offered ALL matching attribute names from any view
descriptors.
- Completion on values: <style><item name="android:gravity">|</item>
Here you get offered all values that correspond to the attribute
named as the value of the name attribute of the surrounding item
element.
Unrelated to styles, code completion will now also move the caret
outside the attribute value quotes when you enter one of the value
alternatives (unless the value is a flag type or a resource token).
Also, run-on attributes are also handled more gracefully: if you
complete properties with the caret immediately following another
attribute, a separating space is added into the match as a prefix such
that the new attribute is separated and the XML valid.
There are a lot of diffs in this changeset. In order to allow the
ResourcesContentAssist to extend code completion to add its style-
specific logic, the content assist code had to be split up a bit.
Doing completion in text nodes, or potential text nodes (e.g. if you
have <item>|</item> you should get text completion at that caret
offset even though there is no text node child of the item element
until you insert actual text there) also required some changes.
There are many new unit tests. I also changed the golden file format
slightly to show the caret in the before-view such that it's more
obvious how the caret was affected by inserting the new item.
Change-Id: Ia985db7e848fea33e93ac8a70b2c3b4dbfd9056a
Tor Norbye [Fri, 25 Mar 2011 23:39:13 +0000 (16:39 -0700)]
Merge "Handle AAPT ranges in value resource files"
Tor Norbye [Fri, 25 Mar 2011 22:02:22 +0000 (15:02 -0700)]
Handle AAPT ranges in value resource files
The earlier fix to add editor column ranges for AAPT errors handled
the types of errors that occur in layout .xml files. In value
definition files there are several additional error messages that can
be parsed to infer the actual error range on the line. This changeset
adds handling for these additional cases, plus various unit tests.
It also fixes a couple of corner cases in layout files - in
particular, the case where a resource value is missing, and the case
where there are other -valid- uses of the same value earlier on the
same line where the first reference would be highlighted rather than
the one following the property in error.
Change-Id: I02906ada43a884d7518348924715892de9d33311
Brett Chabot [Fri, 25 Mar 2011 02:06:37 +0000 (19:06 -0700)]
Merge "Add more sdk lib tests to sdk build."
Brett Chabot [Thu, 24 Mar 2011 05:24:15 +0000 (22:24 -0700)]
Add more sdk lib tests to sdk build.
Change-Id: I09946be68f244922de0ad89d970e53165957fa2b
Xavier Ducrohet [Mon, 21 Mar 2011 22:41:57 +0000 (15:41 -0700)]
Better default selection when choosing a device config.
Change-Id: Iacaabec4ad9e9dd55397dc2cc3e6bfadc0c11ff2
Raphael Moll [Thu, 24 Mar 2011 17:00:12 +0000 (10:00 -0700)]
Merge "Revert "build/tools.atree: Move x86-specific changes to tools.x86.atree""
Raphael Moll [Wed, 23 Mar 2011 22:04:00 +0000 (15:04 -0700)]
Revert "build/tools.atree: Move x86-specific changes to tools.x86.atree"
This reverts commit
253acabecba0d9f649f04499f6dda980fbe7bf49.
Raphael Moll [Thu, 24 Mar 2011 16:55:59 +0000 (09:55 -0700)]
Merge "Revert "Fix WIN SDK build: don't break if emulator-x86 is missing.""
Tor Norbye [Thu, 24 Mar 2011 04:10:10 +0000 (21:10 -0700)]
Merge "Added a New Folder action in File Explorer."
Brett Chabot [Thu, 24 Mar 2011 02:34:03 +0000 (19:34 -0700)]
Merge "Add ddmlib-tests to sdk build in a tests/libtests dir."
Brett Chabot [Wed, 23 Mar 2011 03:50:22 +0000 (20:50 -0700)]
Add ddmlib-tests to sdk build in a tests/libtests dir.
Change-Id: Idba9f5b5724926209bbb96bfd75e04dbffa3760c
Raphael Moll [Wed, 23 Mar 2011 22:03:53 +0000 (15:03 -0700)]
Revert "Fix WIN SDK build: don't break if emulator-x86 is missing."
This reverts commit
ecd2f055e09ebe5a16244b91af1c6f80cae671a0.
Raphael Moll [Wed, 23 Mar 2011 20:05:59 +0000 (13:05 -0700)]
Merge "Fix WIN SDK build: don't break if emulator-x86 is missing."
Raphael Moll [Wed, 23 Mar 2011 20:01:10 +0000 (13:01 -0700)]
Fix WIN SDK build: don't break if emulator-x86 is missing.
The core issue is why emulator-x86 is missing from the build.
Whilst we investigate why, this will unbreak the build. We should
revert this once the emu-x86 is built correctly again.
Change-Id: I4852490f1fea91ea18a798be28411f5a57a31a89
David 'Digit' Turner [Wed, 23 Mar 2011 17:35:35 +0000 (10:35 -0700)]
Merge "build/tools.atree: Move x86-specific changes to tools.x86.atree"
David 'Digit' Turner [Wed, 23 Mar 2011 10:37:57 +0000 (11:37 +0100)]
build/tools.atree: Move x86-specific changes to tools.x86.atree
Unfortunately, the latest x86-specific changes to tools.atree break
internal Android builds that depend on this file.
This change moves the changes to a different file that is only
parsed for x86-specific SDK builds (sdk_x86-eng).
It depends on https://review.source.android.com/#change,21957
to allow the AOSP build to pick up tools.x86.atree properly.
Change-Id: I163d7fb43aa06609d9b0e4bfbaf56311958ea25e
Raphael Moll [Tue, 22 Mar 2011 18:48:26 +0000 (11:48 -0700)]
Merge "Fix AvdManager to correctly find emulator in AOSP."
Raphael Moll [Tue, 22 Mar 2011 18:10:53 +0000 (11:10 -0700)]
Fix AvdManager to correctly find emulator in AOSP.
This is a temporary workaround on the lack of a main
"emulator" binary in AOSP, which will be fixed later.
Change-Id: I61f03ed8a54a410469f95a1100ef38eef7ab4bf6
David Turner [Tue, 22 Mar 2011 17:31:00 +0000 (10:31 -0700)]
Merge "Revert "DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)""
Bruce Beare [Tue, 22 Mar 2011 16:04:03 +0000 (09:04 -0700)]
Revert "DISABLED 2 lines that break the SDK build (bios.bin in sdk/tools.atree)"
This reverts commit
147e8b73aefa28ef599628c718060450539b6102.
The original commit was merged out of sequence - thus the need for the
original revert. All dependent commits are now complete so we can put back
in place the original change.
Pierre Zurek [Fri, 11 Feb 2011 23:04:48 +0000 (00:04 +0100)]
Added a New Folder action in File Explorer.
This action allows the user to create a new folder if the current
selection in the tree is a folder. It executes the "mkdir" command
on the device. If an error occurs during execution, a popup is
displayed.
Change-Id: Id94485502849679ee9c753882b3e46f30e0edd1e
Tor Norbye [Mon, 21 Mar 2011 22:38:35 +0000 (15:38 -0700)]
Merge "NPE fix"
Tor Norbye [Mon, 21 Mar 2011 22:35:35 +0000 (15:35 -0700)]
NPE fix
Change-Id: I35d0407ef20557c19b6eca5324075de9fbbf8583
Raphael Moll [Mon, 21 Mar 2011 20:28:13 +0000 (13:28 -0700)]
Merge "SDK Manager dialog to manage user add-on sites."
Raphael Moll [Mon, 21 Mar 2011 20:26:38 +0000 (13:26 -0700)]
Merge "Revamp of the SDK Manager UI."
Tor Norbye [Mon, 21 Mar 2011 20:21:05 +0000 (13:21 -0700)]
Merge "Applying the previous rotation state when refreshing screen image."
Tor Norbye [Mon, 21 Mar 2011 20:03:49 +0000 (13:03 -0700)]
Merge "Refactoring Quick Assistant"
Tor Norbye [Mon, 21 Mar 2011 19:59:51 +0000 (12:59 -0700)]
Merge "Add 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
Tor Norbye [Mon, 21 Mar 2011 19:43:18 +0000 (12:43 -0700)]
Merge "More 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
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
Tor Norbye [Mon, 21 Mar 2011 19:27:25 +0000 (12:27 -0700)]
Merge "On ImageView or ImageButton drop, ask user for drawable"
Tor Norbye [Mon, 21 Mar 2011 19:27:12 +0000 (12:27 -0700)]
Merge "Add large, medium and small TextViews to the palette"
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"
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
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
Tor Norbye [Mon, 21 Mar 2011 18:23:12 +0000 (11:23 -0700)]
Merge "Add custom views and third party views 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
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
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
Xavier Ducrohet [Fri, 18 Mar 2011 20:27:28 +0000 (13:27 -0700)]
Merge "Fix unit tests from the previous refactor."
Tor Norbye [Fri, 18 Mar 2011 20:00:49 +0000 (13:00 -0700)]
Merge "Make edit texts grow in horizontal LinearLayouts using weights"
Tor Norbye [Fri, 18 Mar 2011 19:59:52 +0000 (12:59 -0700)]
Merge "Fix AAPT error range"
Xavier Ducrohet [Fri, 18 Mar 2011 19:13:51 +0000 (12:13 -0700)]
Fix unit tests from the previous refactor.
Change-Id: I464fe3f94e701e619b474f82aaf84ee04d158e71
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
Xavier Ducrohet [Fri, 18 Mar 2011 18:29:08 +0000 (11:29 -0700)]
Merge "Move classes to ide-common"
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
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."
Raphael Moll [Fri, 18 Mar 2011 17:03:14 +0000 (10:03 -0700)]
Merge "Remove 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
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
Xavier Ducrohet [Fri, 18 Mar 2011 02:01:40 +0000 (19:01 -0700)]
Merge "Add missing notice files."
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
Tor Norbye [Fri, 18 Mar 2011 00:56:40 +0000 (17:56 -0700)]
Merge "Fix 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
Raphael Moll [Thu, 17 Mar 2011 20:59:51 +0000 (13:59 -0700)]
Merge "Disable the "unecessary else" warning."
Raphael Moll [Thu, 17 Mar 2011 20:43:40 +0000 (13:43 -0700)]
Merge "Remove xml content type binding from ExportEditor."
Tor Norbye [Thu, 17 Mar 2011 20:35:01 +0000 (13:35 -0700)]
Merge "Add Quickfix and Quick Assistant for creating resources"
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
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
Tor Norbye [Thu, 17 Mar 2011 19:42:40 +0000 (12:42 -0700)]
Merge "XML code completion improvements"
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
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
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
David Turner [Wed, 16 Mar 2011 12:36:43 +0000 (05:36 -0700)]
Merge "Removing 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
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
Tor Norbye [Tue, 15 Mar 2011 19:05:36 +0000 (12:05 -0700)]
Merge "ConcurrentModificationException in AbstractPropertiesFieldsPart"
Xavier Ducrohet [Tue, 15 Mar 2011 18:28:42 +0000 (11:28 -0700)]
Merge "Add specifc warnings config for most sdk eclipse projects."
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
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
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
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"
Tor Norbye [Sat, 12 Mar 2011 01:23:41 +0000 (17:23 -0800)]
Merge "XML 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
Tor Norbye [Sat, 12 Mar 2011 00:25:06 +0000 (16:25 -0800)]
Merge "Extract 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
Tor Norbye [Sat, 12 Mar 2011 00:05:35 +0000 (16:05 -0800)]
Merge "Underline 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
Tor Norbye [Fri, 11 Mar 2011 21:50:10 +0000 (13:50 -0800)]
Merge "Add drop-support for include tags"
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
Raphael Moll [Fri, 11 Mar 2011 03:05:15 +0000 (19:05 -0800)]
Merge "Avoid 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