IntelliJ IDEA 2016.3 Help

Move Class Dialog

Refactor | Move
F6


The Move Class refactoring dialog box is invoked for the classes selected in the Project view, or opened in the editor.

ItemDescription
To package Specify the destination package. Click the ellipsis button, and select the target package in the Choose Destination Package dialog that shows a tree view of all packages within the project.
Make inner class ofIf you want to make your class inner, specify the target class. Click the ellipsis button and select the target class in the Choose Class dialog.

This option is not available for ActionScript.

Search in comments and stringsSelect this option to apply the changes to comments and strings.
Search for text occurrencesSelect this option to apply the changes to documentation, HTML, JSP and other files included in your project.
Search for referencesSelect this check box to have the changes applied to the references to the file in question. This option is available only for Move File or Move Package refactorings.
Move to another source folderIf this option is selected, you can select the target root, where the destination package will be located. If the option is not selected, only the current root is used.

This option is disabled for the modules that contain a single source root.

Target destination directory When the dialog box opens, the field shows the path to the folder where the file that implements the class to move is currently stored.

The path is displayed in the format ...\<project root folder>\<path to the current namespace folder relative to the project root>. The path is updated automatically as you specify the namespace to move the class to. However, if you are going to move a class to a non-existing namespace under another parent namespace, IntelliJ IDEA will not suggest the proper folder unless you appoint a root folder for your namespace structure by marking the relevant folder as Sources on the Directories page of the Settings dialog box, see Directories for details.

Do one of the following:

  • Accept the preselected path displayed in the field.
  • Choose another path from the list. All of them are evaluated from the namespace root or from the current directory, so it is safe to choose any of them.
  • Click /help/img/idea/2016.3/browseButton.png and select a folder in the dialog box that opens.
  • Press F2 and edit the preselected path. Keep in mind that this may cause problems with automatic loading in the future.

Open moved in editorSelect this check box to open the moved class in the editor.

See Also

```
Last modified: 21 March 2017