如何在不使用鼠标的情况下在IntelliJ中创建新类? [英] How do I create a new class in IntelliJ without using the mouse?

查看:57
本文介绍了如何在不使用鼠标的情况下在IntelliJ中创建新类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在不使用IntelliJ的鼠标的情况下在所需位置创建新类?

Is there a way to create a new class in a desired location without using the mouse in IntelliJ?

我了解默认键盘映射中没有键盘绑定.

I understand there is no keyboard binding in the default keymap.

推荐答案

如果您已经在项目视图中,请按 Alt + Insert ( New )| 课程.可以通过 Alt + 1 激活项目视图.

If you are already in the Project View, press Alt+Insert (New) | Class. Project View can be activated via Alt+1.

要在与当前目录相同的目录中创建一个新类,请使用 Ctrl + Alt + Insert (新... ).

To create a new class in the same directory as the current one use Ctrl+Alt+Insert (New...).

您也可以从导航栏中执行此操作,按 Alt + Home ,然后选择带有箭头键的程序包,然后按 Alt + 插入.

You can also do it from the Navigation Bar, press Alt+Home, then choose package with arrow keys, then press Alt+Insert.

另一个有用的快捷方式是View |选择( Alt + F1 ),项目( 1 ),然后选择 Alt + 插入可以在现有的类附近创建一个类,或使用箭头键浏览这些包.

Another useful shortcut is View | Select In (Alt+F1), Project (1), then Alt+Insert to create a class near the existing one or use arrow keys to navigate through the packages.

还有另一种方法是,在要使用它的现有代码中键入类名称,IDEA会以红色突出显示该类名称,因为它尚不存在,然后按 Alt +在意图操作"弹出窗口中,输入输入,选择创建课程.

And yet another way is to just type the class name in the existing code where you want to use it, IDEA will highlight it in red as it doesn't exist yet, then press Alt+Enter for the Intention Actions pop-up, choose Create Class.

这篇关于如何在不使用鼠标的情况下在IntelliJ中创建新类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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