Intellij:在“项目"窗格的上下文菜单中添加“接口" [英] Intellij: Adding 'Interface' to my context menu in the Project Pane

查看:137
本文介绍了Intellij:在“项目"窗格的上下文菜单中添加“接口"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前在IntelliJ中,如果我在项目"窗格中右键单击一个包,则可以看到诸如以下内容:

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?

我一直在设置>菜单和工具栏中玩耍,

有趣的是,如果我右键单击一个软件包并选择新建">编辑文件模板...",,我可以看到接口的模板,并在说明中实际说:/p>

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.

除非我需要查看除 Project 以外的其他窗格,否则我似乎找不到任何上下文菜单可以让我选择 New> Interface 以上说明.

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.

推荐答案

新增|出现"Java类,创建新类"对话框,在此对话框中,您可以在以下选项之一中选择种类:

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

  • 班级
  • 接口
  • 枚举
  • 注释

(已通过IDEA 9.0.3测试)

(tested with IDEA 9.0.3)

如果要直接在新建"列表中显示接口",则必须在设置" |添加"中添加新模板.文件模板,将其命名为 Java接口,然后将 Interface 模板的内容复制到此模板中.

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.

这篇关于Intellij:在“项目"窗格的上下文菜单中添加“接口"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆