views:

21

answers:

2

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.

A: 

Eclipse has these items but I found out I barely use them. I create a class and change class to enum or interface - it isn't that much of a headache.

Bozho
+1  A: 

New | Java Class, Create New Class dialog appears, in this dialog you can choose Kind between one of the following:

  • Class
  • Interface
  • Enum
  • Annotation

(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.

CrazyCoder
Thanks! The second part of the response was exactly what I wanted. After adding a NEW interface template to the 'file templates' section, it immediately appeared in my context menu.
digiarnie