Modify the (ok) configuration of a developing node

How to program the OK button of configuration of a node (in development), to validate some components that I need to validate before it is executed.

When you click on OK (or Apply), the #configure() method of the NodeModel is called, so you can almost certainly (without knowing the details of what you want to do!) do what you want there.



You can also override the saveAdditionalSettings() method in the NodeDialog, if you want to perform your validation before the settings are saved to the node. By throwing an exception in that method, you can prevent a user from configuring a node with an illegal value.



Thank you very much, I tried it and I think it is the best option.

Hello, when programming the method saveAdditionalSettings (), I can validate using Execptions and I show a JOptionPane to inform the user of the error, but in doing so the dialog window closes.

  • I would like to know if in some way you can keep the dialog window open until the user fixes the incorrect parameters?
  • I already try creating the dialog window again but it does not work for me, what can I do?

If you throw InvalidSettingsException in the saveAdditionalSettings(), does that prevent the settings dialog from closing?