use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class JavaSnippetTemplate method saveSettings.
/**
* Saves current parameters to settings object.
* @param settings To save to.
*/
@Override
public void saveSettings(final NodeSettingsWO settings) {
settings.addString(META_CATEGORY, m_metaCategory.getName());
settings.addString(CATEGORY, m_category);
settings.addString(NAME, m_name);
settings.addString(DESCRIPTION, m_description);
settings.addString(VERSION, m_version);
NodeSettingsWO snippet = settings.addNodeSettings(SNIPPET);
m_snippetSettings.saveSettings(snippet);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class TimeMissingValueHandlingColSetting method saveMetaColSettings.
/**
* Saves the meta settings to a config object.
*
* @param colSettings the settings to write, may include individual settings (ignored)
* @param settings to write to
*/
static void saveMetaColSettings(final TimeMissingValueHandlingColSetting[] colSettings, final NodeSettingsWO settings) {
NodeSettingsWO defaults = settings.addNodeSettings(CFG_META);
for (int i = 0; i < colSettings.length; i++) {
if (!colSettings[i].isMetaConfig()) {
continue;
}
ConfigType type = colSettings[i].getType();
String id;
switch(type) {
case NON_NUMERICAL:
id = CFG_META_NUMERICAL;
break;
case NUMERICAL:
id = CFG_META_NON_NUMERICAL;
break;
default:
assert false;
id = CFG_META_NUMERICAL;
}
NodeSettingsWO subConfig = defaults.addNodeSettings(id);
colSettings[i].saveSettings(subConfig);
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class AppendVariableToTableSettings method saveSettingsTo.
/**
* @param settings to save to.
*/
public void saveSettingsTo(final NodeSettingsWO settings) {
settings.addBoolean("all", m_includeAll);
NodeSettingsWO sub = settings.addNodeSettings("variables");
for (Pair<String, FlowVariable.Type> v : m_variablesOfInterest) {
NodeSettingsWO sub2 = sub.addNodeSettings(v.getFirst());
sub2.addString("name", v.getFirst());
sub2.addString("type", v.getSecond().name());
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class VariableToTableSettings method saveSettingsTo.
/**
* @param settings to save to.
*/
public void saveSettingsTo(final NodeSettingsWO settings) {
settings.addBoolean("all", m_includeAll);
NodeSettingsWO sub = settings.addNodeSettings("variables");
for (Pair<String, FlowVariable.Type> v : m_variablesOfInterest) {
NodeSettingsWO sub2 = sub.addNodeSettings(v.getFirst());
sub2.addString("name", v.getFirst());
sub2.addString("type", v.getSecond().name());
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class MissingValueHandling2ColSetting method saveMetaColSettings.
/**
* Saves the meta settings to a config object.
*
* @param colSettings the settings to write, may include individual settings
* (ignored)
* @param settings to write to
*/
protected static void saveMetaColSettings(final MissingValueHandling2ColSetting[] colSettings, final NodeSettingsWO settings) {
NodeSettingsWO defaults = settings.addNodeSettings(CFG_META);
for (int i = 0; i < colSettings.length; i++) {
if (!colSettings[i].isMetaConfig()) {
continue;
}
int type = colSettings[i].getType();
String id;
switch(type) {
case TYPE_STRING:
id = CFG_META_STRING;
break;
case TYPE_INT:
id = CFG_META_INT;
break;
case TYPE_DOUBLE:
id = CFG_META_DOUBLE;
break;
case TYPE_UNKNOWN:
id = CFG_META_OTHER;
break;
default:
assert false;
id = CFG_META_OTHER;
}
NodeSettingsWO subConfig = defaults.addNodeSettings(id);
colSettings[i].saveSettings(subConfig);
}
}
Aggregations