Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I view packages as folder structure in eclipse

In eclipse, I would like to see packages as a folder structure rather than the flattened look provided by the Package Explorer default settings, is there a way to do this?

like image 811
CaptainForge Avatar asked Apr 04 '13 01:04

CaptainForge


People also ask

How do I view packages in Eclipse?

Upon running Eclipse you should see a pane labeled 'Package Explorer', probably on the left. If you do not see one, you can open it up by going to the Window menu, selecting Show View and Package Explorer. If it doesn't show up under Show View, select Other, then 'Java', then 'Package Explorer'.

How do I show project structure in Eclipse?

In Eclipse, if the Project Explorer pane is not already open, click the Show View icon in the lower left corner of Eclipse, then click Project Explorer. In the Project Explorer pane, right-click your project name, then click Properties.

How do I show folders in Eclipse?

To view the project explorer, click on Window menu then, click on Show View and select Project Explorer. There is simpler way to open project explorer, when you are in the editor press alt + shift + w and select project explorer.


2 Answers

Eclipse offers the Navigator view which will display your project in the way you are asking. To open this view select Window > Show View > Navigator.

like image 131
Tim Bender Avatar answered Oct 14 '22 05:10

Tim Bender


Select the first package in the package explorer. Press Alt-Shift-N to open the new item context menu. Click "Package."

Make sure that the new package name is a sub-package of the original package. For example, if your original package is com.example, the new package might be com.example.gui.


EDIT: If you want to see the nested packages, Eugene says that you can do this:

Package Explorer / View Menu (Ctrl-F10) / Package Presentation... / Hierarchical

like image 34
wchargin Avatar answered Oct 14 '22 07:10

wchargin