How to programmatically create a screen at run time

I am looking at creating a user customization capability to allow users to define and create a screen at runtime and then allowing Cuba to call that new screen ID from menu. The user screen design is stored in the Database and can be edited / changed.

Is there a way to define a new screen and its components (.xml file and controller) in code and register it with the Cuba framework at run time ? Can the controller be coded using Groovy ?