Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Checkbox or the like in the editor
Checkbox or the like in the editor [message #1005284] Thu, 24 January 2013 19:27 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hello,

I´ve got 2 Questions:
1.Is it possbile to implement a checkbox or something like this inside the editor, so that I could use it while modeling. For example I want to define a parameter and the checkbox display a boolean:

param a []
^
checkbox (Boolean=false)

param a [x]
^
checkbox (Boolean=true)


I know that I could use a keyword, but something like a checkbox would be pretty cool. Has Xtext some kind of this feature?

2. Furthermore I want to change the text formatting, depending on a variable value:

param a []
^
checkbox (Boolean=false)

param a [x]
^
checkbox (Boolean=true)

Are there any classes which are able to change the text formatting during modeling?
Re: Checkbox or the like in the editor [message #1005333 is a reply to message #1005284] Thu, 24 January 2013 22:13 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 658
Registered: July 2009
Senior Member
The short answer to both questions is: No, not out of the box.
If you know Xtext a bit better, you will know that you can customize
almost everything by binding your own comonents or hooking into the
Eclipse services.

Am 24.01.13 20:27, schrieb Phil H:
> Hello,
>
> I´ve got 2 Questions:
> 1.Is it possbile to implement a checkbox or something like this inside
> the editor, so that I could use it while modeling. For example I want to
> define a parameter and the checkbox display a boolean:
>
> param a []
> ^
> checkbox (Boolean=false)
>
> param a [x]
> ^
> checkbox (Boolean=true)
>
>
> I know that I could use a keyword, but something like a checkbox would
> be pretty cool. Has Xtext some kind of this feature?
>
> 2. Furthermore I want to change the text formatting, depending on a
> variable value:
>
> param a []
> ^
> checkbox (Boolean=false)
>
> param a [x]
> ^
> checkbox (Boolean=true)
>
> Are there any classes which are able to change the text formatting
> during modeling?


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Checkbox or the like in the editor [message #1059042 is a reply to message #1005333] Thu, 16 May 2013 12:08 Go to previous message
Ian McDevitt is currently offline Ian McDevittFriend
Messages: 65
Registered: December 2012
Location: Belfast
Member
For the second one you can do it with SemanticHighlighting. The highlighter can look at the properties of your element and change the text style or colour dynamically. Look in the UI modules and create your own custom subclasses for ConfigurationHighlighter and SemanticHighligther to to define the styles and decide when to apply them. You will then be able to alter the styles at runtime in the Preferences/Syntax colouring dialog.

The first one would be great but I have no idea about that.
Previous Topic:Dependencies Injection configuration for XtextDocumentProvider
Next Topic:xtext migration : JvmReferenceTypeArgument
Goto Forum:
  


Current Time: Sun Dec 21 21:02:10 GMT 2014

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

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