Intellij:添加“接口”到项目窗格中的上下文菜单
目前在 IntelliJ 中,如果我右键单击“项目”窗格中的包,我可以看到以下内容:
new > Java class
new > File
new > Package
我想在“新”上下文菜单中添加一些新菜单项,例如 Interface 和 Enum。有谁知道该怎么做?
我一直在设置>中进行操作菜单和工具栏没有任何运气。
编辑:有趣的是,如果我右键单击一个包并选择新建> >编辑文件模板...,我可以看到界面的模板,在描述中它实际上说:
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 >接口如上述描述所建议。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
新 | Java 类,出现创建新类对话框,在此对话框中您可以选择以下选项之一种类:
(使用 IDEA 9.0.3 测试)
如果您想要界面直接在新建列表中,那么您必须在设置 | 中添加新模板文件模板,将其命名为 Java Interface 之类的名称,并将 Interface 模板的内容复制到此模板中。
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.
您还可以创建快捷方式以节省一些时间。
Alt+Ctr+S
->键盘映射
->在搜索框中输入“创建新的
”并选择Java 类
,然后指定任何快捷键,例如Ctrl+N
。Also you can create a shortcut to save some secs.
Alt+Ctr+S
->Keymap
-> in search box type 'create new
' and selectJava class
and then assign any shortcut likeCtrl+N
.它位于“新建 Java 类”菜单下。
It's under the New Java Class menu.
是的,它在班级菜单中可用:新建--> Java类-->界面 。
Yes its available in Class menu : New--> Java class --> Interface .
创建一个包,然后从该选择界面中选择创建新类并给出名称。
在此处输入图片描述
;您需要导入参考文件。
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.
它位于 New Java Class 菜单下。new->java Class-{此处从下拉列表中选择 Interface 选项。
It's under the New Java Class menu.new->java Class-{here select Interface option from dropdown.