try {
URI textURI=new URIImpl(text);
values.addContent(new Element("a")
.setAttribute("href", text)
.setText(text));
String uriEncoded=URLEncoder.encode(textURI.stringValue(), "UTF-8");
values.addContent(new Element("a")
.setAttribute("onclick", "setHrefs()")
.setAttribute("href", "?resource="+uriEncoded)
.setAttribute("class", "tooltip")
.setAttribute("title","Lens: DEFAULT :: Resource: "+textURI)