Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » RuleName as Link
RuleName as Link [message #1731589] Sat, 07 May 2016 10:41 Go to next message
Parisa Moosavi is currently offline Parisa MoosaviFriend
Messages: 81
Registered: June 2015
Member
Hi,

I have defined a Rule as follows for defining rgbcolor
RGBColor returns RGBColor:
	{RGBColor}
	'RGBColor'
	name=EString
		'('	( red=EInt)? ',' ( green=EInt)? ',' ( blue=EInt)? ')'
	;

and its dsl looks like this
			fontColor BLACK backColor WHITE rgbColors {
				RGBColor BLACK ( ,, ),
				RGBColor LIGHTBLUE ( 255,51,153 ),
				RGBColor WHITE ( 255,255,255 )
			}


now I want the name of the color for example LIGHTBLUE to be a link and when I click on it a color panel get open for choosing a color. How can I do it ? I will be appreciated for any link to any refedrence to help me.

Re: RuleName as Link [message #1731593 is a reply to message #1731589] Sat, 07 May 2016 11:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13223
Registered: July 2009
Senior Member
You Could use HyperlinkHelper to create a Special Hyperlink. Hohe to
implement that - no idea


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: RuleName as Link [message #1731595 is a reply to message #1731593] Sat, 07 May 2016 11:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13223
Registered: July 2009
Senior Member
Ps Maybe it's way more easy to do this as quickfix

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: RuleName as Link [message #1731844 is a reply to message #1731595] Tue, 10 May 2016 12:53 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
So setting it to white will make the name unreadable? Is that a good idea?

---
Get professional support from the Xtext committers at www.typefox.io
Re: RuleName as Link [message #1732243 is a reply to message #1731844] Fri, 13 May 2016 18:29 Go to previous messageGo to next message
Parisa Moosavi is currently offline Parisa MoosaviFriend
Messages: 81
Registered: June 2015
Member
Hi Jan,

do you have a idea for opening the color palet instead of link?

thanks
Re: RuleName as Link [message #1732579 is a reply to message #1732243] Wed, 18 May 2016 11:00 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I've implemented that for the generic graph view. Have a look at https://github.com/JanKoehnlein/Generic-Graph-View/tree/master/org.eclipse.xtext.graphview.style.ui/src/org/eclipse/xtext/graphview/style/ui/hyperlink

---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Resolving variables from an external source
Next Topic:How to integrate xtext plugin inside custom project
Goto Forum:
  


Current Time: Fri Nov 22 13:10:56 GMT 2019

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

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

Back to the top