Moving Components to an Interface
Use
If required, attributes, methods and events of all visibility sections of a class can be moved to an interface implemented by the class. However, the components may no longer be visible after that because interfaces have only PUBLIC components.
Procedure
- Select the class.
- Make sure you are in Change mode.
- Choose Utilities → Refactoring → Refactoring Assistant.
- Select the class component to be moved and move it to the name of the interface using Drag & Drop.
- Choose Save.
Result
The moved class components are created in the interface. All PRIVATE and PROTECTED components are automatically assigned PUBLIC visibility. If methods with existing implementation were moved, the implementation is retained.