Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij Extract Inner Class

How does one who is using IntelliJ or Android Studio extract a public static inner class to create a new top level class?

Thank you.

like image 951
helsont Avatar asked Jul 22 '15 16:07

helsont


People also ask

How do I extract a class in IntelliJ?

Select a code fragment that you want to extract into a class. Depending on what you want to extract, from the main menu, select one of the following: Refactor | Extract | Delegate. Refactor | Extract | Method Object.

How do I extract files in IntelliJ?

To extract method:Press Ctrl+Alt+M or from the main menu, select Refactor | Extract | Method. In the dialog that opens, configure a method options, such as visibility, parameters, and so on. You can also change a name of the method if you need. Click OK.

How can we make a class extract?

Press Ctrl+Shift+R and then choose Extract Class.


1 Answers

Select the class name.

Refactor > Move or press F6

Select "Move inner class Foo to upper level"

like image 174
Carl Manaster Avatar answered Sep 20 '22 16:09

Carl Manaster