Currently in IntelliJ, if I right-click a package in the Project pane, I can see things such as:
new > Java class new > File new > Package
I want to add some new menu items in the 'new' context menu such as Interface and Enum. Does anyone know how to do this?
I've been playing around in the Settings > Menus and Toolbars without any luck.
Edit: The funny thing is if I right click a package and choose New > Edit File Templates..., I can see the template for an Interface and in the description it actually says:
This is a built-in template used by IDEA each time you create a new Java interface, by selecting New | Interface from the popup menu in one of the project views.
Unless I need to look at a different pane other than Project, I can't seem to find any context menu that lets me choose New > Interface as suggested by the above description.
On the main menu or from the context menu of the selection, choose Refactor | Extract | Interface. The Extract Interface dialog appears. To extract a new interface, select the Extract Interface option and specify the name for the new interface.
To change settings of a module that hosts the file you are currently editing, just press Alt+F1, 7 or open the View menu, select Select In and click Project Structure. IntelliJ IDEA will open the Project Structure dialog and jump to the required module.
To open the tool window again (and restore the associated features), use the main menu: View | Tool Windows | <Window Name> or press Alt+1 . Hide the tool window. This command opens the description of the Project tool window in the IntelliJ IDEA online help.
In IntelliJ IDEA, the Project tool window is usually located on the left. You can open it by pressing ⌘+1 on macOS or Alt+1 on Windows and Linux, or by selecting View | Tool Windows | Project from the main menu.
New | Java Class, Create New Class dialog appears, in this dialog you can choose Kind between one of the following:
(tested with IDEA 9.0.3)
If you want Interface directly in the New list, then you have to add new template in Settings | File Templates, name it something like Java Interface and copy the contents of the Interface template into this one.
Also you can create a shortcut to save some secs.
Alt+Ctr+S
-> Keymap
-> in search box type 'create new
' and select Java class
and then assign any shortcut like Ctrl+N
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With