简体   繁体   English

如何在 Intellij 中将目录标记为资源包目录

[英]how to mark a directory as resource bundle directory in Intellij

I am trying IntelliJ to see how it compares with Eclipse in Java development.我正在尝试IntelliJ ,看看它与Java开发中的 Eclipse 相比如何。 I have imported code formatter from Eclipse and figured out most of the new things in Intellij.我从 Eclipse 导入了代码格式化程序,并找出了 Intellij 中的大部分新东西。 But more things need to be learned:但是还需要学习更多的东西:

Question 1:问题一:

I have a resources folder and then an i18n folder under it.我有一个资源文件夹,然后在它下面有一个i18n文件夹。 All my resource bundle files are inside the i18n folder.我所有的资源包文件都在i18n文件夹中。 How can I tell Intellij to treat these files as the resource bundle file and associate them with a resource bundle editor?如何告诉 Intellij 将这些文件视为资源包文件并将它们与资源包编辑器相关联?

Question 2:问题2:

Why Intellij gives me the * for the java.awt and javax.swing packages?为什么 Intellij 给我 java.awt 和 javax.swing 包的 *?

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;

How to make them down to class name?如何将它们归结为 class 名称?

For question 1, you can mark the folder as a Resource file in Project Structure对于问题1,您可以将文件夹标记为项目结构中的资源文件在此处输入图像描述

Check this for more information.检查以获取更多信息。

For question 2, this is about Disable wildcard imports对于问题 2,这是关于Disable wildcard imports

  1. In the Settings/Preferences dialog ⌘,, select Code Style |在设置/首选项对话框中 ⌘,, select 代码样式 | Java | Java | Imports.进口。
  2. Make sure that the Use single class import option is enabled.确保启用了使用单个 class 导入选项。
  3. In the Class count to use import with ' ' and Names count to use static import with ' ' fields, specify values that definitely exceed the number of classes in a package and the number of names in a class (for example, 999). In the Class count to use import with ' ' and Names count to use static import with ' ' fields, specify values that definitely exceed the number of classes in a package and the number of names in a class (for example, 999).

check this for more information检查以获取更多信息

Hope it helps希望能帮助到你

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

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