use of org.knime.base.node.jsnippet.util.JavaSnippetSettings in project knime-core by knime.
the class JavaSnippetNodeDialog method saveSettingsTo.
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
ViewUtils.invokeAndWaitInEDT(() -> {
// pressed.
if (null != m_inFieldsTable.getTable().getCellEditor()) {
m_inFieldsTable.getTable().getCellEditor().stopCellEditing();
}
if (null != m_outFieldsTable.getTable().getCellEditor()) {
m_outFieldsTable.getTable().getCellEditor().stopCellEditing();
}
});
final JavaSnippetSettings s = m_snippet.getSettings();
// if settings have less fields than defined in the table it means
// that the tables contain errors
final FieldsTableModel inFieldsModel = (FieldsTableModel) m_inFieldsTable.getTable().getModel();
if (!inFieldsModel.validateValues()) {
throw new IllegalArgumentException("The input fields table has errors.");
}
final FieldsTableModel outFieldsModel = (FieldsTableModel) m_outFieldsTable.getTable().getModel();
if (!outFieldsModel.validateValues()) {
throw new IllegalArgumentException("The output fields table has errors.");
}
s.setBundles(m_bundleListPanel.getBundles());
// give subclasses the chance to modify settings
preSaveSettings(s);
s.saveSettings(settings);
}
use of org.knime.base.node.jsnippet.util.JavaSnippetSettings in project knime-core by knime.
the class JavaSnippetNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
JavaSnippetSettings s = new JavaSnippetSettings();
s.loadSettings(settings);
}
Aggregations