use of org.knime.core.node.defaultnodesettings.SettingsModelInteger in project knime-core by knime.
the class DateTimeShiftNodeModel method createNumericalValueModel.
/**
* @param numericalSelectionModel model for the numerical selection button group
* @return the string model, used in both dialog and model.
*/
public static SettingsModelInteger createNumericalValueModel(final SettingsModelString numericalSelectionModel) {
final SettingsModelInteger model = new SettingsModelInteger("numerical_value", 1);
numericalSelectionModel.addChangeListener(l -> model.setEnabled(numericalSelectionModel.getStringValue().equals(NumericalMode.Value.name()) && numericalSelectionModel.isEnabled()));
model.setEnabled(false);
return model;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelInteger in project knime-core by knime.
the class AbstractHistogramNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
final SettingsModelBoolean model = m_allRows.createCloneWithValidatedValue(settings);
if (!model.getBooleanValue()) {
// read the spinner value only if the user hasn't selected to
// retrieve all values
m_noOfRows.validateSettings(settings);
final SettingsModelInteger copy = m_noOfRows.createCloneWithValidatedValue(settings);
if (copy.getIntValue() <= 0) {
throw new InvalidSettingsException("No of rows must be greater zero");
}
}
try {
m_xColName.validateSettings(settings);
} catch (final Throwable e) {
// It's an older node which hasn't stored the aggregation column
final String xCol = settings.getString("xColumn");
if (xCol == null || xCol.length() < 1) {
throw new InvalidSettingsException("Invalid binning column");
}
}
try {
m_aggrColName.validateSettings(settings);
} catch (final Throwable e) {
// It's an older node which hasn't stored the aggregation column
LOGGER.debug("Exception while validating settings: " + e.getMessage());
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelInteger in project knime-core by knime.
the class ReadTableNodeModel method createLimitSpinnerModel.
/**
* @param limitCheckerModel to register for enable/disable.
* @return
*/
static final SettingsModelInteger createLimitSpinnerModel(final SettingsModelBoolean limitCheckerModel) {
final SettingsModelInteger result = new SettingsModelInteger("limitRowsCount", 100000);
limitCheckerModel.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(final ChangeEvent e) {
result.setEnabled(limitCheckerModel.getBooleanValue());
}
});
result.setEnabled(limitCheckerModel.getBooleanValue());
return result;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelInteger in project knime-core by knime.
the class TableToVariableNodeDialog method getReplaceInteger.
/**
* @param policyModel The policy model.
* @return the SM for the new integer value.
*/
static final SettingsModelInteger getReplaceInteger(final SettingsModelString policyModel) {
SettingsModelInteger model = new SettingsModelInteger("CFG_Integer", 0);
ChangeListener listener = new PolicyChangeListener(policyModel, model);
policyModel.addChangeListener(listener);
listener.stateChanged(null);
return model;
}
Aggregations