Hello,
I am using Kepler and have been trying to modify the default template for "for - iterate over array" at Window > Preferences > Java > Editor > Templates. The default is:
for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
${line_selection}${cursor}
}
and I simply want to indent the closing brace so that we have:
for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
${line_selection}${cursor}
}
The change is being saved (I can return and see the indented brace) but when I try to use this in a .java file by typing "for<Ctrl><Space>" the popup list shows "for - iterate over array" with the original non-indented brace and when I select that I get the default/non-indented brace as:
for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
${line_selection}${cursor}
}
If I make some other change to the template such as:
for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
${line_selection}${cursor}
THIS IS JUST A TEST
}
I get:
for (int i = 0; i < bBPMN2.length; i++) {
THIS IS JUST A TEST
}
The new text is used (although I don't know why I get the blank line) so that suggests to me that the template is being activated. So it seems that I just can't get an indented closing brace. I am wondering if there is some other "format" setting that is overriding the indentation on my closing brace but I can't find anything. Not that I can see why it would make a difference but I have tried this with "Use code formatter" turned off and it makes no difference.
How can I get an indented closing brace?
Thank you.
Al