Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving packages eclipse

Tags:

eclipse

Maybe a stupid question but I have two packages in eclipse and now I would like to move the one package into the other for better structure.

Now I tried move but that generates a copy into the same package.

And with refactoring -> move I even can't select the packages

Can anyone help me....

thx all

like image 553
Darth Blue Ray Avatar asked May 28 '11 18:05

Darth Blue Ray


People also ask

How do I move a package to another package in Eclipse?

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.

How do I move files from one package to another?

To move items, hold the SHIFT key and drag the items from the source package to the destination package. You can also use the Cut and Paste commands to move items between packages. To copy items, drag the items (or hold the CTRL key and drag the items) from the source package to the destination package.


1 Answers

If you have com.company.foo and com.company.bar, and want to move foo into bar, then just rename com.company.foo to com.company.bar.foo.

If you package happens to have subpackages, tick Rename subpackages to move the subpackages as well.

like image 63
Bozho Avatar answered Sep 25 '22 06:09

Bozho