How to automatically deploy empty packages in Eclipse with hierarchical presentation?

I often worked on projects with huge namespaces on Eclipse. Since I believe that representing a hierarchical package seems to be more visually useful, I have the problem of selecting each package before the main classes, for example:

-br -br.com -br.com.company -br.com.company.server.core -br.com.company.server.core.web.common -br.com.company.server.core.web.common.Utils.java (yay!) 

Is there a way to automatically and recursively expand empty packages when using the hierarchical package view?

So when I click

 +br 

It will expand to:

 -br -com -company -server -core -web -common +Utils.java 
+4
source share
2 answers

For me, a hierarchical view aligns several empty directories (for example, com.company.project) into one expandable and collapsible entry. The only trick I discovered that this is NOT true (on OSX anyway) is that the .DS_Store files will make Eclipse see the directory as "not empty". Then he will not compress them into one record. Removing these files (and any other hidden but existing files in the directory) resolves this issue.

Thus, I can have com.company.project with the option of expanding with one click, and all packages are displayed hierarchically below it. This is a pleasant combination of two types!

+2
source

Use the Project Explorer view and change the Presentation Package from Flat to Hierarchical. You will find this option in the browse menu.

+1
source

Source: https://habr.com/ru/post/1383689/


All Articles