use of org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink in project ow by vtst.
the class LessHyperlinkHelper method createHyperlinksTo.
/**
* Create an hyper-link to the resource designated by an URI.
* @param from The source resource.
* @param uri The target URI.
* @param acceptor An acceptor for the hyper-link.
*/
public void createHyperlinksTo(XtextResource from, URI uri, IHyperlinkAcceptor acceptor) {
final URIConverter uriConverter = from.getResourceSet().getURIConverter();
final String hyperlinkText = uri.toString();
final URI normalized = uriConverter.normalize(uri).resolve(from.getURI());
XtextHyperlink result = getHyperlinkProvider().get();
result.setHyperlinkRegion(new Region(1, 1));
result.setURI(normalized);
result.setHyperlinkText(hyperlinkText);
acceptor.accept(result);
}
Aggregations