Help with class NodeView

Hello, I need to show a table in the view of my node, but I have no idea how to work in the NodeView display a table. I would like to have some example code or something. regards

Do you want a view of a standard KNIME table, or some other table?

If a KNIME table, then try looking at the source code for any of the KNIME nodes which have a view - e.g. the Interactive Table View node.

If you want a different sort of table, then you need to use either JTable and JTableHeader themselves, or subclass them. The classes in https://community.knime.org/svn/nodes4knime/trunk/com.vernalis/com.vernalis.knime.chem.mmp/src/com/vernalis/knime/mmp/nodes/transform/abstrct/ might provide some inspiration. Several words of caution though with that example:#

  • The view in this case is a bit unusual in that it was to update ‘live’ during node execution (mostly, you want a view that shows nothing during node execution, and then your view when execution is complete!) - the call to setShowNODATALabel(false); handles that - leave that out if you dont want the view to show anything until the node is complete
  • This example also needed a custom renderer for a column of progress bars (yes, really!)

However, it does show a couple of things - communication with the node model, and setting up the view. There are two different views in there for this node, only one of which is a table, but the other is probably a reasonably simple example of the basics of setting up a NodeView, subject to the caveat above about setShowNODATA()

Hope that gives you some pointers,

Steve

2 Likes

Thank you very much, I hope it serves me.
regards

1 Like