简体   繁体   English

Eclipse中的分层包结构

[英]Hierarchical package structure in Eclipse

I am working with eclipse on an android project. 我在Eclipse项目上使用eclipse。 I want to have packages inside of packages inside of packages and so on... 我想将包装内的包装放在包装内,以此类推...

The problem is i can only have 1 type of subpackage. 问题是我只能有一种子包类型。 (I want more depth) At the moment my project looks like this: (我想更深入地了解)目前我的项目如下:

- com.company.main
  - subpackone
    + class1
    + class2
    + class3
  - subpacktwo
    + class4
  - subpackthree
    + class5

But what i want is something like this: 但是我想要的是这样的:

- com.company.main
  - subpackone
    + class1
    + class2
    + class3
    - subpacktwo
      + class4
      - subpackthree
        + class5

When i try to create more packages inside of subpackages it just changes the name of the already existing subpackage. 当我尝试在子包中创建更多包时,它只是更改了已经存在的子包的名称。 I already set the Package Presentation to Hierarchical in eclipse. 我已经在Eclipse中将Package Presentation设置为Hierarchical。

flafoux gave me the right answer flafoux给了我正确的答案

My problem was, i tried to create new packages inside of packages that have no classes (to test it). 我的问题是,我试图在没有类的软件包中创建新软件包(以对其进行测试)。 But if I create a class inside the package first I then can create new subpackages. 但是,如果我先在包内创建一个类,则可以创建新的子包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM