OSDN Git Service

Improve hyperlink resolution for configurations
authorTor Norbye <tnorbye@google.com>
Fri, 14 Jan 2011 01:04:26 +0000 (17:04 -0800)
committerTor Norbye <tnorbye@google.com>
Sat, 15 Jan 2011 01:02:54 +0000 (17:02 -0800)
commitdcef17367f317f2b79dca6069a46bedc06ffd4e9
tree17230bd4ada6dcf2aae752a6bab1c61449a4f1fd
parent1ed748ab4fdcf2662c59cfd61ef5dad3a4cce0a2
Improve hyperlink resolution for configurations

The hyperlink resolver would only look for values in the base values/
folder. This did not work well for resources that are ONLY defined in
specific configurations. This changeset improves the search to look in
all eligible resource folders. It also uses support from the layout
library to more quickly identify the right files to check.

The hyperlink resolver now also considers the configuration chooser in
the designtab (if opened), and uses this configuration
first. Therefore, if you for example have chosen to view a particular
language, hyperlink resolution will jump to the specific translation
string rather than the base string as before.

A few other fixes are included:

- Look in the current file for @id references to resolve first (common
  in a layout where you have @id references to attachments)
- Fix search for @attr/ attributes
- Fix bug where attributes inside a custom view class would be ignored
  and it would jump to the custom class instead

Change-Id: Ia97a3f45bf454cc28378387b219af0fdd855a902
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/Hyperlinks.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFileWrapper.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/io/IFolderWrapper.java