|
|
Re: Hyperlinks in Strings/Comments [message #558607 is a reply to message #558342] |
Mon, 13 September 2010 16:08 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
Thanks,
Splitting up the text into fine grained grammar opens up a very large
can of worms, and I was thinking of finding the links in the data type
conversion. I currently use a String for the documentation data, but
could just as well have a type that contains more information.
Or, is there some other place where it is convenient to introduce
"additional parsing" ? I can imagine computing offsets on demand and
storing in an adapter for instance.
Regards
- henrik
On 9/11/10 1:46 PM, Alexander Nittka wrote:
> Hi,
>
> there are a couple of threads in the forum dealing with similar
> problems, an approach is contained in the MWE2 grammar project.
>
> One possibility is changing the grammar, making strings and comments not
> being single terminals but rather composed elements that can contain
> elements of type link. You'd still have to adapt the linking though.
> Also this would make the grammar quite complicated and if you don't want
> to use the comments or strings otherwise (just allow navigation for the
> user), this might be an overkill.
>
> My first suggestion would be to implement your own HyperlinkHelper
> "extending" the createHyperlinkByOffset method. The difficult part will
> be (if you don't change the grammar for comments) "manually" parsing the
> comment node, checking whether there actually is a URL under the current
> cursor position. You can then create your own I/Abstract/XtextHyperlink
> associating whatever you want with the open-method.
>
> Alex
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04264 seconds