Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to generate multiple files/classes with intellij code/file templates? [duplicate]

I like intellij's code/file templates, they are working really well for me for single files but it would be great to be able to create multiple files/classes at once.

I did find this question but since it has been a few years since I was hoping that things might have changed.

We are using the mvp pattern in our application so every time we want to create a new view, it requires two classes and two interfaces, which are always in the same pattern. It would be awesome if we could generate all of the infrastructure for this and link up the classes.

Any suggestions or new information would be appreciated? Maybe it is time to log a feature request with JetBrains?

like image 804
Trevor Gowing Avatar asked Aug 08 '13 12:08

Trevor Gowing


People also ask

How do I make multiple files in IntelliJ?

To use the new template, right-click a directory in the Project tool window or press Alt+Insert and select the Java MVC template. Specify a name for the model class and IntelliJ IDEA will create all three files.

How do I run multiple classes in IntelliJ?

Click 'Compound' In the right-hand pane, enter a meaningful name for your group, then click the green '+' icon (the one in the right-hand pane, not the top-left of the window) Select one of the run configurations. Repeat 5 and 6 for all the configurations you want to run in a single click.

Where are IntelliJ templates stored?

IntelliJ IDEA stores global templates in the IDE configuration directory under fileTemplates.


1 Answers

This feature seems to be available in ReSharper (another JetBrains IDE). It still does not seem possible in IDEA yet.

like image 127
leeor Avatar answered Sep 21 '22 18:09

leeor