public void resolve(WidgetImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
if (implementation != null) {
// Resolve the resource directory location
Artifact artifact = contributionFactory.createArtifact();
artifact.setURI(implementation.getLocation());
Artifact resolved = resolver.resolveModel(Artifact.class, artifact, context);
if(resolved.getLocation() == null) {
URL resource = null;
URI uri = URI.create(implementation.getLocation());
Artifact parent = context.getArtifact();
if (!uri.isAbsolute()) {
if (parent != null && parent.getURI() != null) {
URI base = URI.create("/" + parent.getURI());
uri = base.resolve(uri);
// Remove the leading / to make artifact resolver happy
if (uri.toString().startsWith("/")) {
uri = URI.create(uri.toString().substring(1));
}
}
}
// The resource can be out of scope of the contribution root
if (parent != null && parent.getLocation() != null) {
try {
resource = new URL(new URL(parent.getLocation()), implementation.getLocation());
implementation.setLocationURL(resource);
} catch (MalformedURLException e) {
ContributionResolveException ce = new ContributionResolveException(e);