SettingsModelListener

I would like to change the selectable list (String array) in a DialogComponentStringSelection programmatically at run-time. I added a comment in the appropriate page, but I am not sure if that is read as regularly (sorry for the duplication). How would I do that? I don’t see any method that would allow this. A sort code-snippet is very much appreciated.

Thx
B

Hi Bernd,

You have to change the SettingsModel in this case, not the DialogComponent. For sample you can take a look at this method in my project. (Apologies it might be not enough clear, and does a little bit more. The interesting part for you: call to update model. I am also using a special DialogComponent usually to set the a consistent initial state of the other DialogComponents, maybe this is not an ideal solution.)
Bests, gabor

Isn’t DialogComponentStringSelection#replaceListItems(StringIconOption[], String) exactly what you are looking for?
And DefaultStringIconOption#createOptionArray(Collection) could help creating the array of StringIconOptions.

yup replaceListItems works. Thanks also for the very inspiring link to your HTS software. I might be contacting you about this some time in the future about this a bit more if you don’t mind… :wink:

Thanks,

Bernd