简体   繁体   English

Netbeans - 修复整个项目的导入

[英]Netbeans - fix imports on entire project

I'm using netbeans IDE 8.0. 我正在使用netbeans IDE 8.0。 When I hit right click inside the editor, one option is Fix imports (CTRL + SHIFT + I). 当我在编辑器中右键单击时,一个选项是修复导入 (CTRL + SHIFT + I)。 This option adds useful imports and removes unused imports. 此选项添加有用的导入并删除未使用的导入。 But How can I use Fix Imports on entire project(not single file) ? 但是如何在整个项目中使用Fix Imports(而不是单个文件) Is there any way for doing that? 这样做有什么办法吗?

Right click on the project (or a package if you want), then choose "Inspect and Transform". 右键单击项目(或者如果需要,可以选择包),然后选择“检查和转换”。

In the dialog box, choose "Organize Imports" , from browse choose imports --> then --> organize imports: 在对话框中,选择“组织导入”,从浏览选择导入 - >然后 - >组织导入:

在此输入图像描述

There is also an inspection named "Unused Imports" 还有一个名为“未使用的进口”的检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM