Suggest feature only if another feature exists [message #934153] |
Fri, 05 October 2012 14:02  |
Eclipse User |
|
|
|
Hi folks,
I have a particular situation, where I'd like to suggest/add to autocomplete/successfully validate/ a particular dependent feature only if another feature already exists. For example:
Grammer:
Model:
('datatype' ':' datatype = DataType)? &
('maxValue' ':' maxValue = INT)? &
('minValue' ':' minValue = INT)? &
('stringLength' ':' stringLength = INT)? &
('binary' ':' binary = Bool)? &
;
enum DataType:
INT = 'Integer' | STRING = 'String'
;
enum Bool:
TRUE = '1' | FALSE = '0'
;
So,
1. I'd like to let user use random order for all this features (therefore &)
2. Until no datatype added, suggest/autocomplete only binary feature.
3. If suggest/autocomplete only stringLength feature, if suggest/autocomplete only minValue and maxValue features.
Any help appreciated!
|
|
|
Re: Suggest feature only if another feature exists [message #934174 is a reply to message #934153] |
Fri, 05 October 2012 14:24  |
Eclipse User |
|
|
|
I had some trouble in the past using & - maybe my fault, but I am not using it anymore. I would introduce an enum covering all your features min, max, etc, then introduce a list of subnodes in your model (KeyEnum, Value) - one for each feature and then I'd implement the behaviour you've described using the completion assistant and checks.
Opinions?
Micha
|
|
|
Powered by
FUDForum. Page generated in 0.32196 seconds