Merge branch 'master' of git.labs.intellij.net:idea/community

This commit is contained in:
Ilya Sergey
2009-10-22 16:52:55 +04:00
2 changed files with 19 additions and 2 deletions
@@ -18,6 +18,7 @@ package com.intellij.javaee;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* author: lesya
@@ -47,4 +48,7 @@ public abstract class ExternalResourceManagerEx extends ExternalResourceManager
public abstract void addExternalResourceListener(ExternalResourceListener listener);
public abstract void removeExternalResourceListener(ExternalResourceListener listener);
@Nullable
public abstract String getUserResourse(Project project, String url, String version);
}
@@ -130,8 +130,8 @@ public class ExternalResourceManagerImpl extends ExternalResourceManagerEx imple
}
public String getResourceLocation(@NonNls String url, String version) {
Map<String, String> map = getMap(myResources, version, false);
String result = map != null ? map.get(url) : null;
String result = getUserResourse(url, version);
Map<String, String> map;
if (result == null) {
map = getMap(myStdResources.getValue(), version, false);
@@ -145,6 +145,19 @@ public class ExternalResourceManagerImpl extends ExternalResourceManagerEx imple
return result;
}
@Override
@Nullable
public String getUserResourse(Project project, String url, String version) {
String resourse = getProjectResources(project).getUserResourse(url, version);
return resourse == null ? getUserResourse(url, version) : resourse;
}
@Nullable
private String getUserResourse(String url, String version) {
Map<String, String> map = getMap(myResources, version, false);
return map != null ? map.get(url) : null;
}
public String getResourceLocation(@NonNls String url, @NotNull Project project) {
String location = getProjectResources(project).getResourceLocation(url);
return location == null || location.equals(url) ? getResourceLocation(url) : location;