Intellij新Java类打开了与平常不同的对话框 [英] Intellij new Java Class opening a different dialog than usual

查看:146
本文介绍了Intellij新Java类打开了与平常不同的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 IntelliJ IDE 时通过 new-> Java类创建新的Java类时,随机对话框开始出现,我找不到如何禁用它的方法.

这是开始显示的奇怪对话框,有点像向导.单击帮助按钮会收到我There is no help for this dialog"消息.

如何在Intellij IDEA中禁用此窗口?

解决方案

我也遇到了相同的问题,即完全相同的对话框.以我为例,它实际上不是bug,而是IJ正常运行(有点).

TL; DR:用于创建类"对象的模板代码在IJ更新后自动更改,以便在创建新的类文件时提示编码器提供答案.在设置/文件和代码模板"中将其更改回默认模板代码可以解决此问题,因为默认模板代码不使用创建类对象时提示的任何变量(例如:$ {IMPORT_BLOCK}). /p>

长版...

打开IJ的设置"对话框,并在搜索字段中键入模板",然后选择文件和代码模板"选项.您将在对话框的右侧看到编辑器>文件和代码模板"区域.如果您从模板类型列表中选择类",则在该模板类型列表的右侧,您会看到创建类时使用的模板...

现在我不知道为什么,但是几个月前通过其工具箱应用程序对特定的IJ更新后,默认的模板文本/代码有所不同,因此看起来像这样...

...,并且后面的模板代码/文本导致您看到的第二个对话框出现.

要解决此问题,请突出显示列表中的类"模板,然后单击文件/包含/代码/其他"选项卡下方的重置为默认值"按钮(看起来像一张纸,带有180度弯曲箭头),以便模板文字返回到我在第一个屏幕截图中显示的内容,然后选择确定"按钮.

假设类"模板的默认"模板没有损坏/损坏,那么您应该不再看到所询问的对话框.

When creating a new java class via new -> Java Class while using IntelliJ IDE, a random Dialog started appearing, and I can't find how to disable it.

This is the strange dialog that started showing, a sort of a wizard. Clicking the help button get's me There is no help for this dialog message.

How can I disable this window in the Intellij IDEA?

解决方案

I too had the same problem, the exact same dialog. In my case, it actually ended up not being a bug, but IJ acting properly (kinda).

TL;DR: The template code for creating a "Class" object got automagically changed after an IJ update so that it would prompt for answers from the coder when creating a new class file. Changing it back in "Settings/File and Code Templates" to the default template code removes the problem, as the default template code does not use any variables that are prompted for upon class object creation (ex.: ${IMPORT_BLOCK}).

Long version ...

Bring up the Settings dialog for IJ, and in the search field type "template", and then select the "File and Code Templates" option. You'll see on the right side of the dialog the "Editor > File and Code Templates" area. If you select "Class" from the list of template types, to the right of that list of template types you'll see the template used when you create a class ...

Now I don't know why, but after a particular IJ update some months back, via their Toolbox app, the default template text/code was different, so that it looked like this ...

... and that latter template code/text caused the second dialog to appear that you see.

To fix the problem, highlight the "Class" template from the list, then click on the "Reset to Default" button that appears below the Files/Includes/Code/Other tabs (looks like a piece of paper with a 180 degree curving arrow on top of it), so that the template text goes back to what I have showing in the first screenshot, and then select the OK button.

Assuming your "default" template for the Class template is not corrupted/bad, you should no longer see the dialog that you asked about.

这篇关于Intellij新Java类打开了与平常不同的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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