In that example - notice a dialog node resource type points to a script. This script calls the HtlDataSourceExample.activate():3
<sly data-sly-use.data=
"com.community.aem.dropdown.core.HtlDataSourceExample"
>
</sly>
The result is the Select field in the dialog is populated with a DataSouce object that is created in HtlDataSourceExample.