如何在 Eclipse 包资源管理器中查看分层包结构

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3915961/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:40:17  来源:igfitidea点击:

How to view hierarchical package structure in Eclipse package explorer

eclipsepackagespackagehierarchypackage-explorer

提问by Philip

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)

好的,这就是我想要的:在 Eclipse 包资源管理器中,我看到以下内容:(点表示可用于展开文件夹的可点击箭头)

  • PROJECT
    • Source Folder
      • Package
          Class
      • Package.SubPackage
          Foo
          Bar
      • Package.OtherSubPackage
      • Package.OtherSubPackage.VerySubPackage
      • OtherPackage
          Foobar
      • OtherPackage.SubPackage
          Baz
  • 项目
    • 源文件夹
      • 包裹
          班级
      • 包.子包
          酒吧
      • 包.其他子包
      • Package.OtherSubPackage.VerySubPackage
      • 其他包
          食品吧
      • 其他包.子包
          巴兹

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
  • 项目
    • 源文件夹
      • 包裹
          班级
        • 包.子包
            酒吧
        • 包.其他子包
          • Package.OtherSubPackage.VerySubPackage
      • 其他包
          食品吧
        • 其他包.子包
            巴兹

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 nota question about filesystem; the file system works fine as far as I can tell--it is only a question about the visual displayin the Eclipse package explorer.

所以我可以打开或关闭一个包并查看子包列表,而不是让包和子包都在层次结构中的同一级别——这再次使同时显示太多包。请注意,这不是关于文件系统的问题;据我所知,文件系统工作正常——这只是一个关于Eclipse 包浏览中的可视化显示的问题。

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

那么:有没有办法向层次结构添加级别?谢谢!!(OS X 10.6 上的 Eclipse Helios)

回答by Eugene Kuleshov

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.

“查看菜单”可以使用Ctrl+F10或 Package Explorer 右上角的小箭头向下图标打开。

回答by java.nazif

Here is representation of screen eclipse to make hierarachical.

这是屏幕日食的表示以进行分层。

enter image description here

在此处输入图片说明