|
Re: Show or hide logic in FeatureCaptionProvider [message #1694880 is a reply to message #1694794] |
Fri, 08 May 2015 16:03 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
On 08/05/2015 01:23, John Conlon wrote:
> In the DSL is it possible to hide or show features based on a user
> preference like below?
>
>
> featureCaptionProvider{
> val store = PerspectivePlugin.getDefault().getPreferenceStore();
> val hideGeoLocations =
> store.getBoolean(PreferenceConstants.P_HIDE_GEO_LOCATION);
>
> text {
> Location : name -> 'Location Name:'
> Location : tag -> 'Primary Tag ID:'
> Location : alternateId -> 'Alternate ID:'
> Location : ^type -> 'Type of Location:'
> Location : description -> 'Description:'
>
> // Hide or show these values based on hideGeoLocations val
> Location : boundary -> 'Perimeter boundary as Geo Polygon
> Coordinates:'
> Location : latitude -> 'Latitude:'
> Location : longitude-> 'Longitude:'
> Location : altitude-> 'Altitude:'
> Location : altitudeMode -> 'Altitude Mode:'
>
Hi John
if you need to completely hide the features, you should customize the
featuresProvider: the featureCaptionProvider only specifies the labels
for form and dialog fields.
However, currently, there's no way to specify features in the
featuresProvider in a conditional way in the DSL: you can only return
the features for a given EClass, but not based on a condition; you could
however implement a custom FeaturesProvider directly in Java, see the
"Features Provider" section in the documentation (and bind it either in
the Java Guice module, or in the DSL using the 'bindings' section).
Does that help?
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
Powered by
FUDForum. Page generated in 0.04320 seconds