use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class PivotNodeDialogPane method createSettingsAggregationMethod.
/**
* @return a settings model string as aggregation method
*/
static final SettingsModelString createSettingsAggregationMethod() {
SettingsModelString model = new SettingsModelString("aggregation_method", "SUM");
model.setEnabled(false);
return model;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project GenericKnimeNodes by genericworkflownodes.
the class MimeFileImporterNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
SettingsModelString tmp_filename = m_filename.createCloneWithValidatedValue(settings);
if (tmp_filename.getStringValue().isEmpty()) {
throw new InvalidSettingsException("No File selected.");
}
convertToURL(tmp_filename);
SettingsModelOptionalString tmp_file_extension = m_file_extension.createCloneWithValidatedValue(settings);
if (tmp_file_extension.isActive()) {
if (tmp_file_extension.getStringValue().equals("")) {
throw new InvalidSettingsException("No File extension (override) provided.");
} else if (MIMETypeHelper.getMIMEtypeByExtension(tmp_file_extension.getStringValue()) == null) {
throw new InvalidSettingsException("No MIME type registered for file extension: " + tmp_file_extension.getStringValue());
}
} else if (MIMETypeHelper.getMIMEtype(tmp_filename.getStringValue()) == null) {
throw new InvalidSettingsException("File of unknown MIME type selected: " + tmp_filename.getStringValue());
}
}
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());
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class CreateBitVectorNodeModel method createMSCSetMatchingModel.
/**
*@return the multi string column set matching model
*/
static SettingsModelString createMSCSetMatchingModel() {
final SettingsModelString m = new SettingsModelString("multiStringColumnSetMatching", SetMatching.MATCHING.getActionCommand());
m.setEnabled(false);
return m;
}
Aggregations