Extending NodeDialogPane

Hi.

I have been working with knime to generate a few custom nodes. I built them by extending the DefaultNodeSettingsPane. This makes it very easy to add DialogComponent elements. But, the DefaultNodeSettingsPane adds everything vertically centered - that is, there is not much layout control. I was hoping to extend the DefaultNodeSettingsPane to introduce a bit more layout control, but still make use of the DialogComponent types that are available. I have run in to quite a bit of trouble with this because many of the member functions involved (like addDialogComponent) invoke functions (like diaC.getPanel()) that are not publically available.

In looking through existing dialogs (like FileReaderNodeDialog), a very different approach is taken. No use is made of the DialogComponent types, or anything related to that. Is that done to achieve more control of the layout? The SettingsModel and DialogComponent elements are almost everything needed to build very nice dialogs with very minimal work. Can anyone provide thoughts on the best way to build custom dialogs still taking advantage of the DialogComponents available in knime? Or should those only be used on very simple vertical layouts that can use DefaultNodeSettingsPane as is?

Thanks,
Greg

Hi Greg,

the idea behind these DefaultDialogComponents is indeed to provide a simple way for generating dialogs for only a few basic settings. As soon as you need a more complex dialog you need to use the Swing components (like in the FileReaderDialog - you picked one of the most complex dialogs there, I guess).

But there is no reason why these components shouldn't be used in custom dialogs, except for those methods with too restrictive scope - and with the next release we are going to change this. The current implementation of these DefaultComponents is kind of a first shot, that's also why we didn't really advertise them a lot.

So, for a more complex or neater dialog you are currently stuck with Swing. You need to derive from NodeDialogPane, layout Swing components and implement the loadSettingsFrom and saveSettingsTo methods. Let me know if that's not documented good enough.