Intellij Idea - Extract Class

Is it possible to do something like Eclipse: Refactor: Extract Class in Intellij Idea 14? Or should I do it manually?

The correct option was not found in the menu, and I was struck by the option unavailable.

+7
intellij-idea
source share
3 answers

Everything that is worth doing in eclipse can be done faster and easier in IntelliJ, but if you are used to eclipse, you will have to work a bit to understand the way IntelliJ does things.

If you place the cursor somewhere in the corresponding java code (or in the class name in the project window), the Extract option will be in the Refactor menu. Extracting Delegate , Interface and Superclass are three options that are directly related to classes. These menu options are not available if the cursor is not in the java class code.

The Interface parameter retrieves the interface, renames your class, and implements the interface. The Superclass option retrieves the superclass and modifies references to it, and not to your derived class. The Delegate option simply retrieves the methods and properties that you select in the new class.

+10
source share

The refactoring you are looking for is likely to extract the delegate .

+5
source share

Place the cursor on the name of your inner class and press F6 .

+5
source share

All Articles