use of org.knime.core.node.defaultnodesettings.SettingsModelColumnFilter2 in project knime-core by knime.
the class CollectionCreate2NodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
SettingsModelColumnFilter2 includeModel = m_includeModel == null ? createSettingsModel() : m_includeModel;
includeModel.validateSettings(settings);
m_createSet.validateSettings(settings);
m_removeCols.validateSettings(settings);
m_newColName.validateSettings(settings);
try {
m_ignoreMissing.validateSettings(settings);
} catch (InvalidSettingsException e) {
// just catch for the sake of downwards compatibility
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelColumnFilter2 in project knime-core by knime.
the class Unpivot2NodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
// ugly, admitted. we use null assignment to indicate whether node has settings
final SettingsModelColumnFilter2 retainedColumns = m_retainedColumns == null ? Unpivot2NodeDialogPane.createColumnFilterRetainedColumns() : m_retainedColumns;
retainedColumns.validateSettings(settings);
final SettingsModelColumnFilter2 valueColumns = m_valueColumns == null ? Unpivot2NodeDialogPane.createColumnFilterValueColumns() : m_valueColumns;
valueColumns.validateSettings(settings);
m_enableHilite.validateSettings(settings);
}
use of org.knime.core.node.defaultnodesettings.SettingsModelColumnFilter2 in project knime-core by knime.
the class StringToDateTimeNodeDialog method updatePreview.
/**
* @param colSelectModel settings model of the column filter
*/
private void updatePreview(final SettingsModelColumnFilter2 colSelectModel) {
final String[] includes = colSelectModel.applyTo(m_spec).getIncludes();
Arrays.stream(colSelectModel.applyTo(m_spec).getIncludes()).mapToInt(s -> m_spec.findColumnIndex(s)).toArray();
m_preview = "";
if (m_dataTable != null) {
if (!(includes.length == 0 || m_dataTable.size() == 0)) {
for (final DataRow row : m_dataTable) {
final DataCell cell = row.getCell(m_spec.findColumnIndex(includes[0]));
if (cell.isMissing()) {
continue;
} else {
m_preview = ((StringValue) cell).getStringValue();
break;
}
}
}
}
m_previewLabel.setText("Content of the first cell: " + m_preview);
}
Aggregations