Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view hierarchical package structure in Eclipse package explorer

OK here's what I would like: in the Eclipse package explorer, I see the following: (dot represents a clickable arrow that I can use to expand the folder)

  • PROJECT
    • Source Folder
      • Package
          Class
      • Package.SubPackage
          Foo
          Bar
      • Package.OtherSubPackage
      • Package.OtherSubPackage.VerySubPackage
      • OtherPackage
          Foobar
      • OtherPackage.SubPackage
          Baz

Long story short, I want to have many packages, each with many subpackages, in a source folder (and several source folders, so making more won't solve the problem)--so on the order of a couple hundred packages per source folder--ten to twenty packages each with fifteen subpackages. Therefore, I want the hierarchy to look like this:

  • PROJECT
    • Source Folder
      • Package
          Class
        • Package.SubPackage
            Foo
            Bar
        • Package.OtherSubPackage
          • Package.OtherSubPackage.VerySubPackage
      • OtherPackage
          Foobar
        • OtherPackage.SubPackage
            Baz

so I can open or close a package and see a list of subpackages instead of having package and subpackage all at the same level in the hierarchy--which again makes far too many packages simultaneously displayed. Note this is not a question about filesystem; the file system works fine as far as I can tell--it is only a question about the visual display in the Eclipse package explorer.

So: is there a way to add levels to the hierarchy? Thanks!! (Eclipse Helios on OS X 10.6)

like image 966
Philip Avatar asked Oct 12 '10 14:10

Philip


People also ask

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 all 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 sort package explorer in Eclipse?

Package Explorer > View menu (the triangle) > Configure Working Sets... There you can configure the ordering or choose auto-sorting.

How do I create a hierarchy in Eclipse?

Press Ctrl+Shift+H -or- from the Menu Bar go to Navigate | Open Type in Hierarchy.


1 Answers

Package Explorer / View Menu / Package Presentation... / Hierarchical

The "View Menu" can be opened with Ctrl + F10, or the small arrow-down icon in the top-right corner of the Package Explorer.

like image 176
Eugene Kuleshov Avatar answered Oct 10 '22 12:10

Eugene Kuleshov