IntelliJ IDEA 12.1.0 Web Help

8.0+
Some features described here are available in Ultimate edition only.

Move refactorings allow you to move packages and classes between the source roots of a project, class members to other classes and inner classes to upper hierarchy levels. The move refactorings automatically correct all references to the moved packages, classes and members in the source code.

The following move refactorings are available:

Tip

This refactoring is also available fromUML Class diagram.

To perform a move refactoring, follow these general steps:
  1. Select the symbol to be moved and do one of the following:
    • On the Refactor menu, or on the context menu, choose Move.
    • Press F6F6.
    • In the Project tool window, drag the symbol to the new destination.

    The dialog that opens depends on the type of the selected symbol.

  2. Specify the move options according to the type of the item to be moved. See option descriptions in the Move dialog box reference.
  3. Preview and apply the changes.
Moving a package

To move a package:

  1. Select the package in the Project tool window or Commander, and pressF6F6, or just drag the selected package.
  2. In the Select Refactoring dialog box, click one of the options to specify which refactoring should be performed.
    • To move the whole package to another package select the first option, click OK, then specify the move options in the Move dialog box.
    • To move the directory to another source root, select the second option, click OK, and specify the destination source root.
    • To move the directory to another directory, select the third option, click OK, and specify the destination directory.

See Also

Reference:

Getting Started:

Web Resources: