Search in sources :

Example 11 with NodeSettingsWO

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);
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 12 with NodeSettingsWO

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);
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 13 with NodeSettingsWO

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());
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 14 with NodeSettingsWO

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());
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 15 with NodeSettingsWO

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);
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Aggregations

NodeSettingsWO (org.knime.core.node.NodeSettingsWO)111 NodeSettings (org.knime.core.node.NodeSettings)16 Map (java.util.Map)11 File (java.io.File)9 FileOutputStream (java.io.FileOutputStream)9 LinkedHashMap (java.util.LinkedHashMap)9 HashMap (java.util.HashMap)8 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)8 RowKey (org.knime.core.data.RowKey)6 DataCell (org.knime.core.data.DataCell)5 BufferedOutputStream (java.io.BufferedOutputStream)4 NodeSettingsRO (org.knime.core.node.NodeSettingsRO)4 HashSet (java.util.HashSet)3 GZIPOutputStream (java.util.zip.GZIPOutputStream)3 DataRow (org.knime.core.data.DataRow)3 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)3 AbstractQuickFormConfiguration (org.knime.core.quickform.AbstractQuickFormConfiguration)3 AbstractQuickFormValueInConfiguration (org.knime.core.quickform.AbstractQuickFormValueInConfiguration)3 QuickFormInputNode (org.knime.core.quickform.in.QuickFormInputNode)3 MutableInteger (org.knime.core.util.MutableInteger)3