OSDN Git Service

Add a hyperlink resolved for Android XML files
authorTor Norbye <tnorbye@google.com>
Sat, 4 Dec 2010 21:52:52 +0000 (13:52 -0800)
committerTor Norbye <tnorbye@google.com>
Thu, 9 Dec 2010 21:58:21 +0000 (13:58 -0800)
commit2a58932d3c4e2642cbdbfc161b4f7b884b3d7ea6
tree9f9b6e4ffdd16c9894b14ef7a09827c75ba254fd
parentf7bb5e5fe9c3e6cda5f6d2c4a1db4673a2f8f02d
Add a hyperlink resolved for Android XML files

This changeset adds basic hyperlink handling to Android XML files
(such as AndroidManifest.xml and layout xml files).

It registers a hyperlink detector for our XML files, and the hyperlink
detector looks up the XML model and finds the node and attributes
under the cursor. If found. it then checks these attributes for a set
of patterns that it can link to:

* If it finds an <activity> element, it looks up the activity name and
  the package on the root element, and lets you jump to the activity.
  Ditto for services.
* If it finds a @layout attribute value, it attempts to open the
  corresponding layout file in the res/ folder in the project.  Ditto
  for other per-file resources like @drawable, etc.
* If it finds a value resource, like @string, @dimen, etc, it will
  search through the various XML files in values/ and open up the
  corresponding XML declaration in the editor with the declaration
  selected.

Note that the resolver does NOT use proper full resource resolution
based on the SDK parsing that we have in use within the layout editor
etc. That's the natural next step.

Change-Id: I5880878fe67f26fb8d3b08b808c02baa1049f2c5
eclipse/dictionary.txt
eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidSourceViewerConfig.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/xml/XmlHyperlinkResolver.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtPluginTest.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/xml/XmlHyperlinkResolverTest.java [new file with mode: 0644]