I'm using eclipse 3.8 indigo and I don't know why, when I'm creating a new package the destination of the new package goes outside. I want to create new packages within a package: package in package. I tried to copy / paste the newly created package or to move, but it just copies.
For example, I want to create different packages: dialogs, views, tables, etc. in my main source package. For example:
com.new.application // this is the the main package created by wizard com.new.application.view // package that contains all views.
There is no concept of package with in package. Each package is separate namespace.
The package java has subpackages awt , applet , io , lang , net , and util , but no compilation units. The package java. awt has a subpackage named image , as well as a number of compilation units containing declarations of class and interface types.
In reality there is no such thing as a sub-package in Java - each package is a completely separate entity, with the names being seemingly hierarchical only for convenience. For example, items with default visibility are not visible in sub-packages, despite what one might expect.
If your problem has more to do with presentation and aesthetics than substance, then perhaps what you are looking for is the hierarchical package presentation setting in the Eclipse Package Explorer: click on the little downward triangle/arrow at the top right of the package explorer and select "Hierarchical" in the "Package presentation" submenu:
This is a global setting and will affect all your opened/un-opened projects.
There is no concept of package with in package. Each package is separate namespace. I think if you go to folder view instead of package view, there you may see one under another.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With