IntelliJ IDEA 13.1.0 Web Help

The Copy refactoring lets you create a copy of a class in a different package. It can also be used to create a copy of a file, directory or package in a different directory or package.

The purpose of the Clone refactoring is similar. It is used to create a copy of a class, file, directory or package in the same location (directory or package). In this case, obviously, the name of the copy is always different from that of the original.

To perform the Copy refactoring
  1. Select the item of interest in a tool window (e.g. the Project tool window). Alternatively, open the necessary class or file in the editor.
  2. Do one of the following:
    • Choose Refactor | Copy in the main menu or the context menu.
    • Press F5F5F5F5F5F5F5F5F5F5F5F5.
    • Press and hold the Ctrl key, and, in the Project tool window, drag the item to the target location.
  3. In the Copy dialog that opens, specify the name and location for the copy that you are creating, and click OK.
To perform the Clone refactoring
  1. Select the item of interest in a tool window (e.g. the Project tool window). Alternatively, open the necessary class or file in the editor.
  2. Press CloneElementCloneElementCloneElementCloneElementCloneElementCloneElementCloneElementCloneElementCloneElementCloneElementCloneElementCloneElement. .
  3. In the Clone dialog that opens, specify the name of the clone that you are creating, and click OK.

See Also

Reference:

Getting Started:

Web Resources: