diff options
author | Xavier Ducrohet <xav@android.com> | 2011-01-13 16:35:58 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-01-13 16:35:58 -0800 |
commit | 8ff62c3e67cbbb50fa6660d7497089d6b9e20af1 (patch) | |
tree | 7788af760a3cce2628044beef7bdb2de265f6094 | |
parent | a9378b553784782e24cbc64cbdbcbd75a243ee1a (diff) | |
parent | 339a84f11e383fd081423bab38db2c2bee96cfc1 (diff) | |
download | sdk-8ff62c3e67cbbb50fa6660d7497089d6b9e20af1.zip sdk-8ff62c3e67cbbb50fa6660d7497089d6b9e20af1.tar.gz sdk-8ff62c3e67cbbb50fa6660d7497089d6b9e20af1.tar.bz2 |
Merge "ProjectResources can now be queried for all source file for a given resource." into tools_r9
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java index 08d195b..260da86 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java @@ -368,6 +368,26 @@ public class ProjectResources implements IResourceRepository { } /** + * Returns the list of source files for a given resource. + * + * @param type the type of the resource. + * @param name the name of the resource. + * + * @return a list of files generating this resource or null if it was not found. + */ + public List<ResourceFile> getSourceFiles(ResourceType type, String name) { + ProjectResourceItem[] resources = getResources(type); + + for (ProjectResourceItem item : resources) { + if (name.equals(item.getName())) { + return item.getSourceFileList(); + } + } + + return null; + } + + /** * Returns the resources values matching a given {@link FolderConfiguration}. * @param referenceConfig the configuration that each value must match. */ |