If I understood correctly you are in need of the attribute type = enumeration
I can imagine something like a context entity object wrapping your widget has an attribute of type enum which you can choose as your widget attribute.
Hope I understood the question well. Let me know otherwise.