Disable intentions/Blockstatement question Follow
Q1:
I have a concept where I use BinaryOperation as a child. This has some intentions with it, but I don't want to have for instance the FlipBinaryOperation. Is there a way to disable specific intentions from a concept?
Q2:
I have several statements I want to print in a java method.
E.g.
Float setup = new Float(1)
setup.compareTo(1)
Where I LOOP over both, and COPY_SRCL all setup and COPY_SRCL all methods (compareTo) from concepts I created. To LOOP I use a BlockStatement, but if I look at the output the method looks like this
public void test(){
{
Float setup = new Float(1)
setup.compareTo(1)
}
}
If I look at the example in this case the calculator example, it is used quite similiar, but without the braces in the code output.
$LOOP${
->$inputField.getDocument().addDocumentListener(this.listener);
add(new JLabel("$Title"));
add(->$inputField);
}
I solved it in another way, with a Template Switch, where I have for the
"Float setup = new Float(1)" part a template fragment and also for the
"setup.compareTo(1)" part a template fragment and I then Loop over the switch. It works this way, but I would prefer the block statement method, but it doesn't work.
Thanks in advance for any help.
I have a concept where I use BinaryOperation as a child. This has some intentions with it, but I don't want to have for instance the FlipBinaryOperation. Is there a way to disable specific intentions from a concept?
Q2:
I have several statements I want to print in a java method.
E.g.
Float setup = new Float(1)
setup.compareTo(1)
Where I LOOP over both, and COPY_SRCL all setup and COPY_SRCL all methods (compareTo) from concepts I created. To LOOP I use a BlockStatement, but if I look at the output the method looks like this
public void test(){
{
Float setup = new Float(1)
setup.compareTo(1)
}
}
If I look at the example in this case the calculator example, it is used quite similiar, but without the braces in the code output.
$LOOP${
->$inputField.getDocument().addDocumentListener(this.listener);
add(new JLabel("$Title"));
add(->$inputField);
}
I solved it in another way, with a Template Switch, where I have for the
"Float setup = new Float(1)" part a template fragment and also for the
"setup.compareTo(1)" part a template fragment and I then Loop over the switch. It works this way, but I would prefer the block statement method, but it doesn't work.
Thanks in advance for any help.
Please sign in to leave a comment.
About your Q1, the easiest way I know to disable an intention is through: File->Settings->Intentions.
There you have a list of intentions per language and you can disable the ones you want.
Regards,
Q2: BlockStatement's TextGen flattens BlockStatements, which are nested inside StatementLists and which do not contain variable declarations. (Granted, the detection could be made more sophisticated)
Your BlockStatements contain variable declarations, thus will not be flattened automatically.