use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class ExtractDurationPeriodFieldsNodeModel method createSubsecondUnitsModel.
/**
* @return the string model, used in both dialog and model.
*/
static SettingsModelString createSubsecondUnitsModel(final SettingsModelBoolean boolModel) {
final SettingsModelString settingsModelString = new SettingsModelString("subsecond_units", Granularity.MILLISECOND.toString());
settingsModelString.setEnabled(false);
boolModel.addChangeListener(l -> settingsModelString.setEnabled(boolModel.getBooleanValue()));
return settingsModelString;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class DateTimeDifferenceNodeModel method validateSettings.
/**
* {@inheritDoc}
*/
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
m_col1stSelectModel.validateSettings(settings);
m_col2ndSelectModel.validateSettings(settings);
m_modusSelectModel.validateSettings(settings);
SettingsModelString temp = createModusSelection();
temp.loadSettingsFrom(settings);
try {
ModusOptions.valueOf(temp.getStringValue());
} catch (IllegalArgumentException ex) {
throw new InvalidSettingsException("Unknown difference modus '" + temp.getStringValue() + "'");
}
m_fixedDateTimeModel.validateSettings(settings);
m_calculationSelectModel.validateSettings(settings);
m_granularityModel.validateSettings(settings);
m_newColNameModel.validateSettings(settings);
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class DateTimeDifferenceNodeModel method createGranularityModel.
/**
* @return the string model, used in both dialog and model.
*/
static SettingsModelString createGranularityModel(final SettingsModelString calcSelectionModel) {
final SettingsModelString granularityModel = new SettingsModelString("granularity", Granularity.DAY.toString());
calcSelectionModel.addChangeListener(l -> granularityModel.setEnabled(calcSelectionModel.getStringValue().equals(OutputMode.Granularity.name())));
return granularityModel;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class DurationPeriodToStringNodeModel method createSuffixModel.
/**
* @param replaceOrAppendModel model for the replace/append button group
* @return the string model, used in both dialog and model.
*/
public static SettingsModelString createSuffixModel(final SettingsModelString replaceOrAppendModel) {
final SettingsModelString suffixModel = new SettingsModelString("suffix", "(String)");
replaceOrAppendModel.addChangeListener(e -> suffixModel.setEnabled(replaceOrAppendModel.getStringValue().equals(OPTION_APPEND)));
suffixModel.setEnabled(false);
return suffixModel;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class OldToNewTimeNodeModel method createSuffixModel.
/**
* @param replaceOrAppendModel model for the replace/append button group
* @return the string model, used in both dialog and model.
*/
public static SettingsModelString createSuffixModel(final SettingsModelString replaceOrAppendModel) {
final SettingsModelString suffixModel = new SettingsModelString("suffix", "(new Date&Time)");
replaceOrAppendModel.addChangeListener(e -> suffixModel.setEnabled(replaceOrAppendModel.getStringValue().equals(OPTION_APPEND)));
suffixModel.setEnabled(false);
return suffixModel;
}
Aggregations