Pull members up, push members down
Refactor | Pull Members Up
Refactor | Push Members Down
The Pull Members Up refactoring allows you to move class members to a base class.
The Push Members Down refactoring helps you clean up the class hierarchy by moving class members to a subclass. The members are then relocated into the direct subclasses only.
Select the members to be moved to a superclass.
From the main or context menu, call Refactor | Pull Members Up.
In the Pull members up dialog, specify the following:
Select the superclass.
In the Member section, select the members to be moved.
CLion will highlight the dependent members:
Click Preview to check the changes before proceeding. CLion will notify you in case of problems:
Click Pull when ready.
Before | After |
---|---|
|
|
Before | After |
---|---|
|
|
Before | After |
---|---|
|
|
Select the members to be moved to a subclass.
From the main or context menu, call Refactor | Push Members Down.
In the Push Members Down dialog, specify the following:
In the Inheritor section, select the subclass.
In the Member section, select the members to be moved.
Click Preview to check the changes before proceeding.
Click Push when ready.
Before | After |
---|---|
|
|
Before | After |
---|---|
|
|
Before | After |
---|---|
|
|
Thanks for your feedback!