if (value instanceof ExternalResource) {
addAttribute(name, ((ExternalResource) value).getURL());
} else if (value instanceof ApplicationResource) {
final ApplicationResource r = (ApplicationResource) value;
final Application a = r.getApplication();
if (a == null) {
throw new PaintException(
"Application not specified for resorce "
+ value.getClass().getName());
}
String uri;
if (a.getURL() != null) {
uri = a.getURL().getPath();
} else {
uri = "";
}
if (uri.length() > 0 && uri.charAt(uri.length() - 1) != '/') {
uri += "/";
}
uri += a.getRelativeLocation(r);
addAttribute(name, uri);
} else if (value instanceof ThemeResource) {
final String uri = "theme://"
+ ((ThemeResource) value).getResourceId();