|
|
Re: F3 linking [message #644772 is a reply to message #644759] |
Tue, 14 December 2010 08:27 |
Eisfeld Andrej Messages: 3 Registered: December 2010 |
Junior Member |
|
|
Hi Sebastian,
Thank you for your quick answer. I also tried this but ran into two problems.
Is there a node for the file in the parseTree and if yes how can I get the URI of this file ( do I need the URI for a hyperlink?? ).
The other thing is how can I get the importURI attribute from the IncludeDirective.
I have the EObject but can't call the getter-method of this attribute directly ( do I need the attribute to find the file?? )
public void createHyperlinksByOffset(XtextResource resource, int offset, IHyperlinkAcceptor acceptor) {
TextLocation textLocation = new TextLocation();
EObject eObject = EObjectAtOffsetHelper.resolveElementAt(resource, offset, textLocation);
if ( eObject instanceof IncludeDirective ) {
// get the importURI
// navigate through the parseTree
if (eObject != null /*&& !eObject.eIsProxy()*/) {
Region region = new Region(textLocation.getOffset(), textLocation.getLength());
createHyperlinksTo(resource, region, eObject, acceptor);
}
}
}
[Updated on: Tue, 14 December 2010 09:18] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds