How to modify file template for new Groovy class?

I can change the file template for new Java classes/interfaces/enums/etc... Can I do the same for new Groovy classes? Thanks.

0
9 comments
Avatar
Permanently deleted user

Currently we use the same template for Groovy and Java. Do you see the case when you want them diffferent?

0
Avatar
Permanently deleted user

Thanks for your response.

Currently we use the same template for Groovy and Java.


That's not the behavior I'm seeing. I changed the class file template, and indeed I see those changes when I create a new Java class. But my changes to the class file template don't seem to have any affect on newly created Groovy classes. (I'm using 7.0M2, build #7126, with JetGroovy v 0.1 installed via the plugin manager.)

Do you see the case when you want them diffferent?


Using the same template for Java and Groovy seems sufficient to me. Ideally, I suppose it would be nice to have the option of them being separately customizable. But don't count that as an expert opinion -- I'm just learning this stuff.

0
Avatar
Permanently deleted user

Actually it would be nice to have separate templates for creating a Groovy script vs. a Groovy class. So you might as well have a separate one for Groovy and Java classes too but they can default to the same template text.

0
Avatar
Permanently deleted user

Of course they are different. One contains class declaration and the other does not. My fault,sorry. The template for the script is just including 'Fie Header' template.

0
Avatar
Permanently deleted user

I could not figure out from the responses to this posting, how to modify the file template for my Groovy classes. Changing the template for Java classes has no effect!

0
Avatar
Permanently deleted user

You may use special template for Groovy classes placed in "J2EE" section in IDEA's file template settings. In the same place you may change template for your GSP pages.
I admit, it's not the most appropriate place for these templates, so, we'll move them soon to other section.

0
Avatar
Permanently deleted user

May be I'm stupid, but I can't find a J2EE section in the file template settings?

0
Avatar
Permanently deleted user

JavaEE tab in File Templates?

0
Avatar
Permanently deleted user

Thanks a lot. I did not realize that there are more tabs accessible via the arrow button. I'm a IntelliJ newbie ...

0

Please sign in to leave a comment.