use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class RowKeyNodeModel2 method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
assert (settings != null);
final SettingsModelBoolean replaceRowKeyModel = m_replaceKey.createCloneWithValidatedValue(settings);
final SettingsModelBoolean appendRowKeyModel = m_appendRowKey.createCloneWithValidatedValue(settings);
final SettingsModelString newRowKeyModel = m_newRowKeyColumn.createCloneWithValidatedValue(settings);
final SettingsModelString newColNameModel = m_newColumnName.createCloneWithValidatedValue(settings);
validateInput(null, appendRowKeyModel.getBooleanValue(), newColNameModel.getStringValue(), replaceRowKeyModel.getBooleanValue(), newRowKeyModel.getStringValue(), appendRowKeyModel.getBooleanValue());
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class NumericRowSplitterNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
m_columnSelection.validateSettings(settings);
m_lowerBound.validateSettings(settings);
m_lowerBoundCheck.validateSettings(settings);
m_lowerBoundValue.validateSettings(settings);
m_upperBound.validateSettings(settings);
m_upperBoundCheck.validateSettings(settings);
m_upperBoundValue.validateSettings(settings);
SettingsModelBoolean lowerBoundCheck = m_lowerBoundCheck.createCloneWithValidatedValue(settings);
SettingsModelBoolean upperBoundCheck = m_upperBoundCheck.createCloneWithValidatedValue(settings);
if (lowerBoundCheck.getBooleanValue() && upperBoundCheck.getBooleanValue()) {
SettingsModelDouble lowerBoundValue = m_lowerBoundValue.createCloneWithValidatedValue(settings);
double low = lowerBoundValue.getDoubleValue();
SettingsModelDouble upperBoundValue = m_upperBoundValue.createCloneWithValidatedValue(settings);
double upp = upperBoundValue.getDoubleValue();
if (low > upp) {
throw new InvalidSettingsException("Check lower and upper " + "bound values: " + low + " > " + upp);
}
if (low == upp) {
SettingsModelString lowerBound = m_lowerBound.createCloneWithValidatedValue(settings);
boolean inclLow = NumericRowSplitterNodeDialogPane.includeLowerBound(lowerBound);
SettingsModelString upperBound = m_upperBound.createCloneWithValidatedValue(settings);
boolean inclUpp = NumericRowSplitterNodeDialogPane.includeUpperBound(upperBound);
if ((inclLow ^ inclUpp) || (!inclLow & !inclUpp)) {
throw new InvalidSettingsException("Lower and upper bounds " + "are inconsistent with borders!");
}
}
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class SQLInjectNodeDialog method loadAdditionalSettingsFrom.
/**
* List of available string flow variables must be updated since it could
* have changed.
*
* {@inheritDoc}
*/
@Override
public void loadAdditionalSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
super.loadAdditionalSettingsFrom(settings, specs);
Map<String, FlowVariable> flowVars = getAvailableFlowVariables();
// check for selected value
String flowVar = "";
try {
flowVar = ((SettingsModelString) m_flowVarSettingsModel.createCloneWithValidatedValue(settings)).getStringValue();
} catch (InvalidSettingsException e) {
LOGGER.debug("Settings model could not be cloned with given settings!");
} finally {
m_flowVarSelection.replaceListItems(flowVars.values(), flowVar);
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class DBDropTableNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
final String tableName = ((SettingsModelString) m_tableName.createCloneWithValidatedValue(settings)).getStringValue();
if (tableName == null || tableName.isEmpty()) {
throw new InvalidSettingsException("Please provide the table name to drop");
}
m_cascade.validateSettings(settings);
m_failIfNotExists.validateSettings(settings);
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class SleepNodeModel method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) {
settings.addInt(CFGKEY_WAITOPTION, m_selection);
settings.addInt(CFGKEY_FORHOURS, m_forHours);
settings.addInt(CFGKEY_FORMINUTES, m_forMin);
settings.addInt(CFGKEY_FORSECONDS, m_forSec);
settings.addInt(CFGKEY_TOHOURS, m_toHours);
settings.addInt(CFGKEY_TOMINUTES, m_toMin);
settings.addInt(CFGKEY_TOSECONDS, m_toSec);
settings.addString(CFGKEY_FILEPATH, m_filePath);
SettingsModelString sms = new SettingsModelString(CFGKEY_FILESTATUS, "Modification");
sms.setStringValue(m_fileStatus);
sms.saveSettingsTo(settings);
}
Aggregations