use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class SingleNodeContainer method areDialogAndNodeSettingsEqual.
// //////////////////////////////////
// Credentials handling
// //////////////////////////////////
/**
* {@inheritDoc}
*/
@Override
public boolean areDialogAndNodeSettingsEqual() {
final String key = "snc_settings";
NodeSettingsWO nodeSettings = new NodeSettings(key);
saveSettings(nodeSettings, true);
NodeSettingsWO dlgSettings = new NodeSettings(key);
NodeContext.pushContext(this);
try {
getDialogPane().finishEditingAndSaveSettingsTo(dlgSettings);
} catch (InvalidSettingsException e) {
return false;
} finally {
NodeContext.removeLastContext();
}
return dlgSettings.equals(nodeSettings);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class SettingsModelColumnName method saveSettingsForDialog.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsForDialog(final NodeSettingsWO settings) throws InvalidSettingsException {
final NodeSettingsWO subSettings = settings.addNodeSettings(m_configName);
subSettings.addBoolean(CFG_ROWID, m_useRowID);
super.saveSettingsForDialog(subSettings);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class PortObjectIDSettings method saveSettings.
/**
* Saves the current settings to a NodeSettings object.
* @param settings To write to.
*/
public void saveSettings(final NodeSettingsWO settings) {
if (m_id != null) {
settings.addInt("portobject_ID", m_id);
}
settings.addBoolean("copyData", m_copyData);
NodeSettingsWO sub = settings.addNodeSettings("flowVariables");
int index = 0;
for (FlowVariable fv : getFlowVariables()) {
NodeSettingsWO child = sub.addNodeSettings("flowVar_" + (index++));
// copied from (package scope) save method in FlowVariable
child.addString("name", fv.getName());
child.addString("class", fv.getType().name());
switch(fv.getType()) {
case INTEGER:
child.addInt("value", fv.getIntValue());
break;
case DOUBLE:
child.addDouble("value", fv.getDoubleValue());
break;
case STRING:
child.addString("value", fv.getStringValue());
break;
case CREDENTIALS:
child.addString("value", fv.getName());
break;
default:
assert false : "Unknown variable type: " + fv.getType();
}
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class NameFilterConfiguration method saveConfiguration.
/**
* Save current config to argument.
*
* <p>Subclasses should not define another method with similar signature and then
* call that new method to read from the passed NodeSettings object but instead overwrite
* {@link #loadConfigurationInDialogChild(NodeSettingsRO, String[])}.
*
* @param settings The settings to save into
*/
public final void saveConfiguration(final NodeSettingsWO settings) {
NodeSettingsWO subSettings = settings.addNodeSettings(m_configRootName);
subSettings.addString(KEY_FILTER_TYPE, m_type);
// Only add removed list for selected enforce option
String[] includes = m_enforceOption == EnforceOption.EnforceInclusion ? (String[]) ArrayUtils.addAll(m_includeList, m_removedFromIncludeList) : m_includeList;
subSettings.addStringArray(KEY_INCLUDED_NAMES, includes);
String[] excludes = m_enforceOption == EnforceOption.EnforceExclusion ? (String[]) ArrayUtils.addAll(m_excludeList, m_removedFromExcludeList) : m_excludeList;
subSettings.addStringArray(KEY_EXCLUDED_NAMES, excludes);
subSettings.addString(KEY_ENFORCE_OPTION, m_enforceOption.name());
NodeSettingsWO configSettings = subSettings.addNodeSettings(PatternFilterConfiguration.TYPE);
m_patternConfig.saveConfiguration(configSettings);
saveConfigurationChild(subSettings);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class DataColumnSpecFilterConfiguration method saveConfigurationChild.
/**
* {@inheritDoc}
*/
@Override
protected void saveConfigurationChild(final NodeSettingsWO settings) {
super.saveConfigurationChild(settings);
NodeSettingsWO configSettings = settings.addNodeSettings(TypeFilterConfigurationImpl.TYPE);
m_typeConfig.saveConfiguration(configSettings);
}
Aggregations