digiarnie
digiarnie

Reputation: 23345

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

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.

Upvotes: 30

Views: 43690

Answers (6)

user23488342
user23488342

Reputation: 1

It's under the New Java Class menu.new->java Class-{here select Interface option from dropdown.

Upvotes: 0

shanaka prince
shanaka prince

Reputation: 529

create a package and then select create new class from that select interface and give a name. enter image description here

then; you need to import the references files.

Upvotes: 0

vjaidegavi
vjaidegavi

Reputation: 11

Yes its available in Class menu : New--> Java class --> Interface .

Upvotes: 1

Yekta Özdemir
Yekta Özdemir

Reputation: 83

It's under the New Java Class menu.

Upvotes: 0

Mehraj Malik
Mehraj Malik

Reputation: 15854

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

Upvotes: 1

CrazyCoder
CrazyCoder

Reputation: 401897

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.

Upvotes: 59

Related Questions