Trouble with the side transform action Follow
Hello.
I'm trying to reproduce something like VariableDeclaration and its Initializer, that appears when I press the '=' button.
I have one rootable concept Parameter, that implements INamedConcept and has a string property 'value'. Its editor looks like this:
where '=' is a constant cell and the show condition for inner group is
Also it has TransformMenuItem like this:
Than I create a new Parameter in the solution, specify some name like 'Param' and press the '=' button. I expect to see something like this:
but nothing happens, the '=' char just added to the parameter name.
What I'm missing?
Thanks,
Alexey
I'm trying to reproduce something like VariableDeclaration and its Initializer, that appears when I press the '=' button.
I have one rootable concept Parameter, that implements INamedConcept and has a string property 'value'. Its editor looks like this:
editor for concept Parameter node cell layout: [> {name} ?[> = {value} <] <]
where '=' is a constant cell and the show condition for inner group is
node.value.isNotEmpty
Also it has TransformMenuItem like this:
side transform actions AddInitializer right transformed node: Parameter tag: default_ //<no description> condition : (operationContext, scope, model, sourceNode)->boolean { sourceNode.value.isEmpty; } common initializer : <no common variables> .................................... <no common initializer> actions : add custom items (output concept: Parameter) simple item matching text = description text <default> icon <default> type <default> do transform (operationContext, scope, model, sourceNode, pattern)->node<> { sourceNode.value.set("zero"); return sourceNode; }
Than I create a new Parameter in the solution, specify some name like 'Param' and press the '=' button. I expect to see something like this:
Param = zero
but nothing happens, the '=' char just added to the parameter name.
What I'm missing?
Thanks,
Alexey
Please sign in to leave a comment.
MPS doesn't restrict the label content by default. All positions in your editor belong to the label, so there is no way to "exit" from the label. Adding any punctuation can help. Almost always when you have a property without quotes, brackets or other delimiters around it you should somehow constraint its content to get rid of the possible ambiguity in the language.