You should pass the element instead of the widget. If there is not widget associated with the element, the user will receive null and will not be able to read some info on the element directly.

If you need the widget to provide the content, you can use $(element).widget() in the implementation of the getContent method