/**
* Create a resource location as an anchor in the parent element.
*/
private void renderResourceLocation(Element parent, final JsSymbol jsSymbol) {
final Anchor anchor = new Anchor(new DefaultContainerImpl(parent));
String resourceLocation = jsSymbol.getResourceUrl().getLastPathComponent();
if (!jsSymbol.isNativeSymbol()) {
resourceLocation = "".equals(resourceLocation) ? "" : resourceLocation
+ ":" + jsSymbol.getLineNumber();
anchor.setHref("javascript:;");
listenerManager.manageEventListener(anchor.addClickListener(new ClickListener() {
public void onClick(ClickEvent event) {
String resourceUrl = jsSymbol.getResourceUrl().getUrl();
if (ClientConfig.isDebugMode()) {
Logging.getLogger().logText(
"opening resource " + resourceUrl + " line: "
+ jsSymbol.getLineNumber());
}
sourceClickCallback.onSymbolClicked(resourceUrl, null,
jsSymbol.getLineNumber(), 0, null);
}
}));
} else {
resourceLocation = "native " + resourceLocation;
}
anchor.setText(resourceLocation);
}