In Eclipse's "Package Explorer", let's say I have a list of packages like this:
If I want to refactor this package structure so that the final package structure looks like
So essentially removing the parent package & attaching the child packages to its grandparent. I have many child packages in "com.animal" package & I would like to avoid if possible doing this manually & then also changing the package imports everywhere.
Refactoring using EclipseRight clicking on a Java element in the Package Explorer view and selecting Refactor menu item. Right clicking on a Java element in the Java editor and selecting Refactor menu item. Selecting a Java element in either the Package Explorer view or Java Editor and clicking Shift + Alt + T.
Right-click the package you want to move, and select " Refactor/Rename..." -- NOT " Move "! Modify the name of the package to reflect its desired new position in the package hierarchy, e.g. Prepend any new parent package name(s) if you are moving the package to downwards in the package hierarchy.
You could try holding down Ctrl + F7 to see a list of all views, then up/down arrow to the View. If Package Explorer is in the list it has been minimised or something. If you select it and still can't see it, try Window → Reset Perspective... to restore all views to their defaults.
If you switch your package representation to hierarchical
(from arrow on the top-right), you can right-click the com.animal
package and rename it to com
.
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