use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class RulesToTableNodeDialog method createScoreDistribution.
/**
* {@inheritDoc}
*/
@Override
protected void createScoreDistribution(final RulesToTableSettings settings) {
createNewGroup("Score distribution");
setHorizontalPlacement(true);
m_scoreTableRecordCount = settings.getScoreTableRecordCount();
final SettingsModelString scoreTableRecordCountPrefix = settings.getScoreTableRecordCountPrefix();
addDialogComponent(new DialogComponentBoolean(m_scoreTableRecordCount, "Provide score distibution record count in table with column name prefix:"));
addDialogComponent(new DialogComponentString(scoreTableRecordCountPrefix, ""));
setHorizontalPlacement(false);
setHorizontalPlacement(true);
m_scoreTableProbability = settings.getScoreTableProbability();
final SettingsModelString scoreTableProbabilityPrefix = settings.getScoreTableProbabilityPrefix();
addDialogComponent(new DialogComponentBoolean(m_scoreTableProbability, "Provide score distibution probability in table with column name prefix:"));
addDialogComponent(new DialogComponentString(scoreTableProbabilityPrefix, ""));
m_scoreTableRecordCount.addChangeListener(c -> scoreTableRecordCountPrefix.setEnabled(m_scoreTableRecordCount.isEnabled() && m_scoreTableRecordCount.getBooleanValue()));
m_scoreTableProbability.addChangeListener(c -> scoreTableProbabilityPrefix.setEnabled(m_scoreTableProbability.isEnabled() && m_scoreTableProbability.getBooleanValue()));
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class ExtractDurationPeriodFieldsNodeDialog method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
m_dialogCompColSelect.saveSettingsTo(settings);
for (final DialogComponentBoolean dc : m_dialogCompsDurationFields) {
dc.saveSettingsTo(settings);
}
for (final DialogComponentBoolean dc : m_dialogCompsPeriodFields) {
dc.saveSettingsTo(settings);
}
m_dialogCompSubSecond.saveSettingsTo(settings);
m_dialogCompSubsecondUnits.saveSettingsTo(settings);
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class ExtractDateTimeFieldsNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
m_dialogCompColSelect.loadSettingsFrom(settings, specs);
for (final DialogComponentBoolean dc : m_dialogCompDateFields) {
dc.loadSettingsFrom(settings, specs);
}
for (final DialogComponentBoolean dc : m_dialogCompTimeFields) {
dc.loadSettingsFrom(settings, specs);
}
m_dialogCompSubsecondUnits.loadSettingsFrom(settings, specs);
for (final DialogComponentBoolean dc : m_dialogCompTimeZoneFields) {
dc.loadSettingsFrom(settings, specs);
}
m_dialogCompLocale.loadSettingsFrom(settings, specs);
refreshFieldsSelectionsEnabled();
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class ExtractDateTimeFieldsNodeDialog method refreshFieldsSelectionsEnabled.
private void refreshFieldsSelectionsEnabled() {
if (m_dialogCompColSelect.getSelectedAsSpec() != null) {
final DataType type = m_dialogCompColSelect.getSelectedAsSpec().getType();
final boolean isDate = ExtractDateTimeFieldsNodeModel.isDateType(type);
for (final DialogComponentBoolean dc : m_dialogCompDateFields) {
dc.getModel().setEnabled(isDate);
}
final boolean isTime = ExtractDateTimeFieldsNodeModel.isTimeType(type);
for (final DialogComponentBoolean dc : m_dialogCompTimeFields) {
dc.getModel().setEnabled(isTime);
}
final boolean isZoned = ExtractDateTimeFieldsNodeModel.isZonedType(type);
for (final DialogComponentBoolean dc : m_dialogCompTimeZoneFields) {
dc.getModel().setEnabled(isZoned);
}
}
}
use of org.knime.core.node.defaultnodesettings.DialogComponentBoolean in project knime-core by knime.
the class ExtractDateTimeFieldsNodeDialog method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
m_dialogCompColSelect.saveSettingsTo(settings);
for (final DialogComponentBoolean dc : m_dialogCompDateFields) {
dc.saveSettingsTo(settings);
}
for (final DialogComponentBoolean dc : m_dialogCompTimeFields) {
dc.saveSettingsTo(settings);
}
m_dialogCompSubsecondUnits.saveSettingsTo(settings);
for (final DialogComponentBoolean dc : m_dialogCompTimeZoneFields) {
dc.saveSettingsTo(settings);
}
m_dialogCompLocale.saveSettingsTo(settings);
}
Aggregations