use of org.knime.core.util.tokenizer.Delimiter in project knime-core by knime.
the class IgnoreDelimsPanel method overrideSettings.
/**
* Transfers the current settings from the panel in the passed object.
* Overwriting the corresponding values in the object.
*
* @param settings the settings object to fill in the currently set values
* @return true if the new settings are different from the one passed in.
*/
boolean overrideSettings(final FileReaderNodeSettings settings) {
boolean ignoreEm = m_ignoreThem.isSelected();
if (ignoreEm != settings.ignoreDelimsAtEORUserValue()) {
// set the user set value - only if he changed it.
settings.setIgnoreDelimsAtEndOfRowUserValue(ignoreEm);
// (!)
for (Delimiter delim : settings.getAllDelimiters()) {
String delStr = delim.getDelimiter();
if (!settings.isRowDelimiter(delStr, false)) {
if (delStr.equals(" ") || delStr.equals("\t")) {
settings.setIgnoreEmptyTokensAtEndOfRow(ignoreEm);
break;
}
}
}
// also fix the delimiter settings
// I guess that is what they would expect...?
settings.setDelimiterUserSet(true);
// need to re-analyze file with settings changed
return true;
}
// no need to re-analyze, no settings changed here.
return false;
}
Aggregations