OSDN Git Service

Add support for multiple hyperlink targets
authorTor Norbye <tnorbye@google.com>
Sat, 29 Jan 2011 01:01:49 +0000 (17:01 -0800)
committerTor Norbye <tnorbye@google.com>
Sat, 29 Jan 2011 17:09:35 +0000 (09:09 -0800)
commit6c9e1ff78b5d7613f4cff379373d69fda19812e6
tree320b729dbfc49f5b25534b8fa61f43faab6ee4f8
parent0f717400dbf7c45652d7553f67b4eee85e093101
Add support for multiple hyperlink targets

This changeset makes the Go To Declaration hyperlink resolver produce
a list of possible jump targets. Therefore, if you for example point
at @android:string/ok, you will get a popup listing all the various
string.xml files that define a translation for this string. If there
is a current configuration (which would be the case if you are
pointing at a resource url from a layout file, but not from a Java
file or a manifest file) then the declaration which best matches the
configuration is listed first, followed by everything else in
alphabetical order by the folder name.

This uses the resource maps which the IDE is already maintaining for
rendering, so it can compute the set of hyperlinks cheaply.

In addition, the hyperlink resolver now goes to the direct declaration
of the given resource. This definition can in turn reference another
resource url.

There is one exception to the instant resolution of files: ids. In
layouts it's common to define ids in place (via @+id), and these are
not available in the resource map. Therefore, if no id is found
defined in a value folder, then the search is deferred until the link
is actually clicked. The search will now search not just the base
layout folder, but all layout folders, starting with the same folder
as the link source, followed by all configuration-compatible folders,
followed by all folders.

Change-Id: I20fd4f5836e41e5a9839124b7be3a3230f5198f4
eclipse/dictionary.txt
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/Hyperlinks.java