Yes, basically, you could do that in a custom node, too.
Uibuilder is an example of how it could be done.