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?
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?
Ian McDevitt Messages: 27 Registered: December 2012
Junior 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.