use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class DecisionTreeLearnerNodeDialog2 method createSettingsFirstSplitColumn.
/**
* @return name of column to perform first split on
*/
static SettingsModelString createSettingsFirstSplitColumn(final SettingsModelBoolean useFirstSplitCol) {
SettingsModelString firstSplitCol = new SettingsModelString(DecisionTreeLearnerNodeModel2.KEY_FIRST_SPLIT_COL, null);
useFirstSplitCol.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(final ChangeEvent e) {
firstSplitCol.setEnabled(((SettingsModelBoolean) e.getSource()).getBooleanValue());
}
});
firstSplitCol.setEnabled(useFirstSplitCol.getBooleanValue());
return firstSplitCol;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class EntropyNodeDialogPane method createFlowPrefixModel.
/**
* @param useNamePrefixModel TODO
* @return A new {@link SettingsModelString} for the flow variable prefix
* @since 3.2 Creates the settings model for the flow variable prefix
*/
public static SettingsModelString createFlowPrefixModel(final SettingsModelBoolean useNamePrefixModel) {
final SettingsModelString result = new SettingsModelString("name prefix for flowvars", "");
useNamePrefixModel.addChangeListener(new ChangeListener() {
/**
* {@inheritDoc}
*/
@Override
public void stateChanged(final ChangeEvent e) {
result.setEnabled(useNamePrefixModel.getBooleanValue());
}
});
result.setEnabled(useNamePrefixModel.getBooleanValue());
return result;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class SotaPredictorNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
// Since 2.10
try {
SettingsModelString s = PredictorHelper.getInstance().createPredictionColumn();
s.loadSettingsFrom(settings);
if (s.getStringValue().isEmpty()) {
throw new InvalidSettingsException("The prediction column name cannot be empty.");
}
} catch (InvalidSettingsException ex) {
// Ignore
}
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class CreateBitVectorNodeModel method createSingleColumnModel.
/**
* @return the settings model holding the selected string column name
*/
static SettingsModelString createSingleColumnModel() {
final SettingsModelString model = new SettingsModelString("singleColumnName", null);
model.setEnabled(!ColumnType.getDefault().isMultiColumn());
return model;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class CreateBitVectorNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
final ColumnType columnType = ColumnType.getType(((SettingsModelString) m_columnType.createCloneWithValidatedValue(settings)).getStringValue());
final DataColumnSpecFilterConfiguration tmpMultiColumnConfig = createMultiColumnConfig(null);
tmpMultiColumnConfig.loadConfigurationInModel(settings);
m_mscPattern.validateSettings(settings);
m_mscHasWildcards.validateSettings(settings);
m_mscCaseSensitiv.validateSettings(settings);
m_mscRegex.validateSettings(settings);
SetMatching.get(((SettingsModelString) m_mscSetMatching.createCloneWithValidatedValue(settings)).getStringValue());
m_threshold.validateSettings(settings);
m_useMean.validateSettings(settings);
m_meanPercentage.validateSettings(settings);
final String singleCol = ((SettingsModelString) m_singleColumn.createCloneWithValidatedValue(settings)).getStringValue();
if (!columnType.isMultiColumn() && singleCol == null) {
throw new InvalidSettingsException("Please select the single column to process");
}
m_singleStringColumnType.validateSettings(settings);
m_remove.validateSettings(settings);
final String outCol = ((SettingsModelString) m_outputColumn.createCloneWithValidatedValue(settings)).getStringValue();
if (outCol == null || outCol.trim().isEmpty()) {
throw new InvalidSettingsException("Please specify the name of the output column");
}
m_failOnError.validateSettings(settings);
BitVectorType.getType(((SettingsModelString) m_vectorType.createCloneWithValidatedValue(settings)).getStringValue());
}
Aggregations