Intellij: Adding 'Interface' to my context menu in the Project Pane

32,046

Solution 1

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.

Solution 2

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.

enter image description here

Share:
32,046
digiarnie
Author by

digiarnie

Updated on January 07, 2022

Comments

  • digiarnie
    digiarnie over 2 years

    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.