Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Clickable link in LabelProvider
Clickable link in LabelProvider [message #1781663] Sun, 11 February 2018 14:21 Go to next message
Ritika Rawat is currently offline Ritika RawatFriend
Messages: 5
Registered: February 2018
Junior Member
Hello,

I am using customized labels for my Xtext grammar . I want to add clickable labels(references to already defined elements) to some other elements so that I can navigate to my declared definitions. Is this possible with xtext? I have searched LabelProvider but it only take String as parameter.

eg.

Class A;

Class B extends A;

When I hover on class B , I can see "A" in the label. However,I want to make this label as a link(cross reference) to my declaration.

Thanks in advance.
Re: Clickable link in LabelProvider [message #1781836 is a reply to message #1781663] Tue, 13 February 2018 19:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Why do you want to click in hover and not use the default open declaration mechanism
(F3 or crtl+Click)

Beside this , the Same is currently asked at
https://www.eclipse.org/forums/index.php/t/1091374/


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Clickable link in LabelProvider [message #1781877 is a reply to message #1781836] Wed, 14 February 2018 08:41 Go to previous messageGo to next message
Ritika Rawat is currently offline Ritika RawatFriend
Messages: 5
Registered: February 2018
Junior Member
I am using the customized labels and want to make them clickable. Is there any alternative(any region) where I can show my list of referenced elements to the user, where they can click on them and navigate to the element declaration. I have the requirement similar to the forum https://www.eclipse.org/forums/index.php/t/1091374/

Any help will be appreciated.

Thanks in advance.

[Updated on: Wed, 14 February 2018 08:45]

Report message to a moderator

Re: Clickable link in LabelProvider [message #1781881 is a reply to message #1781877] Wed, 14 February 2018 09:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
as i have said i recommend you or the other guy in the platform or rcp forum if these guys have an idea. the problem is not really xtext specific

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Clickable link in LabelProvider [message #1781882 is a reply to message #1781881] Wed, 14 February 2018 09:48 Go to previous messageGo to next message
Ritika Rawat is currently offline Ritika RawatFriend
Messages: 5
Registered: February 2018
Junior Member
Yeah, I understand you but I have one question. I can get the names for the element using the element's name feature or name attribute. This element reference(which also contains the name feature) comes from Xtext. I need to know if there exists a library in Xtext which can pass these value to other module say rcp.
Re: Clickable link in LabelProvider [message #1781886 is a reply to message #1781882] Wed, 14 February 2018 10:25 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i dont understand the hover is html.
you can get elements names, references, eresources, uris (and thus ifliles)
if you want to do this via label in hover and not via open declaration you need to find out:

"how do i make my hover open a link/editor inside eclipse"

=> if you are able to open myproject/a.txt then you can open b.mydsl as well


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 14 February 2018 10:26]

Report message to a moderator

Previous Topic:Serialization: how to choose which optionnal rule is used
Next Topic:Trying to write a DSL with Xtext to specify an XML-like language
Goto Forum:
  


Current Time: Thu Apr 18 12:42:33 GMT 2024

Powered by FUDForum. Page generated in 0.04012 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top