Choosing columns by column type

Hi everybody,

 

i want to implement a DialogComponent in which the user can choose columns by their type (e.g. all Integer-coumns). Now I have two questions:

1. How do I get the type of a cell (as String)? i know that inSpecs[0].getColumnSpec(i).getType().toString() gives me in type in some cases, but not in the Not-Native cases. In the KNIME GUI a little icon is shown for each column indicating the type and I just want the name of the type as indicated by the icon.

2. How can I pass information about the available column types from the NodeModel to the NodeDialog? I first thought that I can extract the column types within the loadAdditionalSettingsFrom method of the DefaultNodeSettingsPane, but it seems that this method is never called...

I appreciate any help!

thanks!

Jonas

Hi again,

 

i solved the first question on my own. The solution is the .getPreferredValueClass() method of DataType.

 

But the second question is still unsolved: How can i create a DialogComponentStringListSelection in which the possible values are defined in the NodeModel dependent on the inDataSpec.

If you take a look into our Column Filter node, there this selection method is implemented.

For your second question, did you check our our developer documentation. Especially on Default Dialog Components? http://tech.knime.org/default-dialog-components