Intellij项目视图:不在同一个文件中显示多个类 [英] Intellij project view: not show multiple classes in same file

查看:1090
本文介绍了Intellij项目视图:不在同一个文件中显示多个类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Intellij的项目视图中,我发现一个令人沮丧的事情是,它显示文件中的所有类,而不仅仅是文件命名的类。



问题是,要打开一个文件,我必须双击两次:一次展开文件并显示该文件中的类,然后第二次实际打开该文件。



在大多数情况下,我不想看到文件中的类。我只想在项目视图中看到该文件,当我双击文件时,我想打开该文件,而不是向下钻取其结构。





更新:进一步说明



img src =https://i.stack.imgur.com/w0A47.pngalt =输入图片说明here>



显然,人们有问题的理解这个问题。请参阅Intellij项目导航窗格的上图。注意,一些类(蓝色圆圈)有+号,其他类没有。带有加号的那些是在其中有多个类的文件。



问题是,如果你双击一个只有一个类的文件)它打开(GOOD),但如果你双击一个文件包含多个类(有加号),那么该文件不会打开,它只是展开加号,以显示文件中的各个类作为BoxArray。例如,如果我在上面的视图中双击文件Coastline.java,它将不会打开该文件,它会展开(例如(BAD)。)加号。我希望它打开Coastline.java,当我双击Coastline.java,不扩展它。我不想看到类文件中的类,我只想一次双击打开它。



我知道我可以使用热键F4做这个。我不想达到F4键。

解决方案

当您启用自动滚动到源文件在项目工具窗口(视图>工具窗口>项目)的小菜单中,单击一个集合(关闭和打开)直接到代码以及折叠/展开它。 >

这适用于IntelliJ 13.1和14(在OSX和Linux中)




One frustrating thing I find in Intellij's project view is that it shows all the classes in a file instead of just the class for which the file is named.

The problem with this is that to open a file I have to double click twice: once to expand the file and show the classes in the file, and then a second time to actually open the file.

In most cases I don't want to see the classes inside of a file. I just want to see the file in the project view and when I double click on the file I want to open the file, not drill down into its structure.

Is it possible to configure my UI this way?

UPDATE: further explanation

Apparently people are having problems understanding this question. See the above picture of the Intellij Project navigation pane. Notice that some classes (the blue circles) have a + sign and others do not. The ones with a plus sign are files that have multiple classes inside of them.

The problem is that if you double click on a file with only one class (no plus sign) it opens (GOOD), but if you double click on a file with multiple classes in it (has plus sign) then the file does NOT open, it just expands the plus sign to show you the individual classes in the file as BoxArray.java, for example (BAD).

For example, if I double click on the file Coastline.java in the view above it will NOT open the file, it will expand the plus sign. I want it to open Coastline.java when I double click on Coastline.java, not expand it. I do not care about seeing the classes inside of a class file, I just want to open it in one double click.

I know that I can use the hotkey F4 to do this. I do not want to reach for the F4 key. I want to double click on the file and have it open.

解决方案

When you enable Autoscroll to Source in the little menu of your Project tool window (View > Tool Windows > Project), single clicking a collection (closed and opened) goes straight to the code as well as folding / unfolding it.

This works in IntelliJ 13.1 and 14 (in OSX and Linux)

这篇关于Intellij项目视图:不在同一个文件中显示多个类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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