The Set Operator node contains code to return a different icon according to which operation was selected. All the code is there and it looks just fine, but I don’t see it having any effect. The icon displayed on the workflow is always the same Venn diagram. And I can’t find any callers for that code.
Is this perhaps a new feature not yet implemented? Is there in fact a way to change the displayed icon for a node in a workflow?
I can’t speak to how the icons are implemented in the code, but maybe @tobias.koetter can comment on that.
For components, at least, you can can change both colors and icons that are displayed as of KNIME 4.1. This is done by editing the appropriate fields in the Description pane when the component is open for editing:
Looking at the code, there seem to be indeed different icons for the operations. However, these icons actually seem to be used nowhere – to me this looks like dead code. (I would have assumed, that they probably show in the drop down menu of the node’s configuration, but that’s not the case either).
If you look at the corresponding factory XML, it uses a pre-defined icon.
I cannot speak officially for KNIME, but to my knowledge, dynamically changing the icon based on the node’s config is not possible. At the end, the factory which supplies the icon gets called way before in the lifecycle, before any configured node instances exist yet.
Hi,
the icons where supposed to be used in the drop down box of the node dialog but where never used.
Changing the icon in the workflow editor depending on node settings is not supported as of now. But I will open a feature request for this interesting idea.
Thanks
Tobias
The standard string selection dropdown supports icons well enough.
But it would be really neat to be able to modify both the displayed icon and the text under it programmatically, depending on the configuration. I think the effect on workflow readability would be dramatic. Certainly I’d use it for my Relational Algebra node set.