use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class ModifyTimeNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
m_spec = specs[0];
m_dialogCompReplaceOrAppend.loadSettingsFrom(settings, specs);
m_dialogCompSuffix.loadSettingsFrom(settings, specs);
m_dialogCompModifySelect.loadSettingsFrom(settings, specs);
m_dialogCompTime.loadSettingsFrom(settings, specs);
m_dialogCompTimeZone.loadSettingsFrom(settings, specs);
m_filterOnlyLocalDate = ((SettingsModelString) m_dialogCompModifySelect.getModel()).getStringValue().equals(ModifyTimeNodeModel.MODIFY_OPTION_APPEND);
final DataColumnSpecFilterConfiguration filterConfiguration = ModifyTimeNodeModel.createDCFilterConfiguration(m_filterOnlyLocalDate ? ModifyTimeNodeModel.LOCAL_DATE_FILTER : ModifyTimeNodeModel.DATE_TIME_FILTER);
filterConfiguration.loadConfigurationInDialog(settings, specs[0]);
m_dialogCompColFilter.loadConfiguration(filterConfiguration, specs[0]);
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class ModifyTimeZoneNodeDialog method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
m_spec = specs[0];
m_dialogCompReplaceOrAppend.loadSettingsFrom(settings, specs);
m_dialogCompSuffix.loadSettingsFrom(settings, specs);
m_dialogCompTimeZone.loadSettingsFrom(settings, specs);
m_dialogCompModifySelect.loadSettingsFrom(settings, specs);
m_includeLocalDateTime = ((SettingsModelString) m_dialogCompModifySelect.getModel()).getStringValue().equals(ModifyTimeZoneNodeModel.MODIFY_OPTION_SET);
final DataColumnSpecFilterConfiguration filterConfiguration = ModifyTimeZoneNodeModel.createDCFilterConfiguration(m_includeLocalDateTime ? ModifyTimeZoneNodeModel.ZONED_AND_LOCAL_FILTER : ModifyTimeZoneNodeModel.ZONED_FILTER);
filterConfiguration.loadConfigurationInDialog(settings, specs[0]);
m_dialogCompColFilter.loadConfiguration(filterConfiguration, specs[0]);
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class ModifyTimeZoneNodeModel 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", "(modified time zone)");
replaceOrAppendModel.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(final ChangeEvent e) {
if (replaceOrAppendModel.getStringValue().equals(OPTION_APPEND)) {
suffixModel.setEnabled(true);
} else {
suffixModel.setEnabled(false);
}
}
});
suffixModel.setEnabled(false);
return suffixModel;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class DateShiftConfigure method createNewColNameModel.
/**
* @param replaceColumnModel TODO
* @return settings model for the new column name
*/
public static SettingsModelString createNewColNameModel(final SettingsModelBoolean replaceColumnModel) {
final SettingsModelString result = new SettingsModelString(CFG_NEW_COL_NAME, "ShiftDate");
replaceColumnModel.addChangeListener((e) -> result.setEnabled(!replaceColumnModel.getBooleanValue()));
result.setEnabled(!replaceColumnModel.getBooleanValue());
return result;
}
use of org.knime.core.node.defaultnodesettings.SettingsModelString in project knime-core by knime.
the class AbstractFieldExtractorNodeDialog method createUIComponentFor.
/**
* Creates the necessary {@link SettingsModel}s, adds the listener to the
* checkbox and creates the UI component with a horizontally oriented group
* containing the checkbox and text field. Then closes the group.
* @param timeField name of the time field for which the ui component
* should be created
*/
protected void createUIComponentFor(final String timeField) {
// create the settings models and add listener
SettingsModelBoolean checkBoxModel = createUseTimeFieldModel(timeField);
SettingsModelString colNameModel = createTimeFieldColumnNameModel(timeField);
addListener(checkBoxModel, colNameModel);
createNewGroup("");
setHorizontalPlacement(true);
addDialogComponent(new DialogComponentBoolean(checkBoxModel, timeField));
addDialogComponent(new DialogComponentString(colNameModel, "Column name:", true, 20));
closeCurrentGroup();
setHorizontalPlacement(false);
}
Aggregations