How to use the window that's used to selected fields when creating getters/setters?

When you create getters and setters for your bean you can use the generate action - ctrl + insert.
A window is show where you can select the fields from your bean to create your getters and setters.

I need the same functionality for a plugin genereate toString() action.
- So how do I create the same window with the fields being shown?
- And when you click OK, I return to my action with a list of the selected fields?

( see attached image for the window I'm talking about )


Well I found the code myself in IDEA's .jar file

The code belows displays a dialog to chosse some members of the class. Use the code as inspiration. This code is used in my plugin, so you can get all the code from my plugin at:


Ohh yeah the package for the dialog is