Search in sources :

Example 1 with DropPaneConfig

use of org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig in project knime-core by knime.

the class ManualSelectionConfiguration method saveSettings.

@Override
public void saveSettings(final NodeSettingsWO settings) {
    settings.addInt("numberOfPanels", m_panelList.size());
    List<DropPaneConfig> values = Arrays.asList(m_panelList.values().toArray(new DropPaneConfig[m_panelList.size()]));
    Collections.sort(values);
    for (int i = 0; i < values.size(); i++) {
        DropPaneConfig dpc = values.get(i);
        PaneConfigurationDialog p = dpc.getDialog();
        NodeSettings n = new NodeSettings("dialogSettings_" + i);
        p.saveSettings(n);
        settings.addNodeSettings(n);
        settings.addString("panelIndex_" + i, dpc.getSelectionAsString());
    // settings.addInt("panelIndex" + i, p.getIndex());
    }
}
Also used : NodeSettings(org.knime.core.node.NodeSettings) DropPaneConfig(org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig)

Example 2 with DropPaneConfig

use of org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig in project knime-core by knime.

the class ManualSelectionConfiguration method drop.

@Override
public int drop(final String s) {
    PaneConfigurationDialog dp = m_fac.getNewInstance();
    DropPaneConfig dpc = new DropPaneConfig();
    dpc.setPosition(m_index++);
    dpc.getSelection().addAll(Arrays.asList(s.split("\n")));
    dpc.setDialog(dp);
    m_panelList.put(dpc.getPosition(), dpc);
    return m_index - 1;
}
Also used : DropPaneConfig(org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig)

Example 3 with DropPaneConfig

use of org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig in project knime-core by knime.

the class TypeSelectionConfiguration method saveSettings.

/**
 * {@inheritDoc}
 */
@Override
public void saveSettings(final NodeSettingsWO settings) {
    settings.addInt("numberOfPanels", m_panelList.size());
    List<DropPaneConfig> values = Arrays.asList(m_panelList.values().toArray(new DropPaneConfig[m_panelList.size()]));
    Collections.sort(values);
    for (int i = 0; i < values.size(); i++) {
        DropPaneConfig dpc = values.get(i);
        PaneConfigurationDialog p = dpc.getDialog();
        NodeSettings n = new NodeSettings("dialogSettings_" + i);
        p.saveSettings(n);
        settings.addNodeSettings(n);
        settings.addString("panelIndex_" + i, dpc.getSelectionAsString());
    // settings.addInt("panelIndex" + i, p.getIndex());
    }
}
Also used : NodeSettings(org.knime.core.node.NodeSettings) DropPaneConfig(org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig)

Example 4 with DropPaneConfig

use of org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig in project knime-core by knime.

the class ManualSelectionConfiguration method loadValidatedSettingsFrom.

/**
 * @param settings asdf
 * @throws InvalidSettingsException asdf
 */
@Override
public void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
    int size = settings.getInt("numberOfPanels");
    for (int i = 0; i < size; i++) {
        DropPaneConfig dpc = new DropPaneConfig();
        dpc.getSelection().addAll(Arrays.asList(settings.getString("panelIndex_" + i).split("\n")));
        PaneConfigurationDialog dp = m_fac.getNewInstance();
        NodeSettingsRO n = settings.getNodeSettings("dialogSettings_" + i);
        dp.loadValidatedSettings(n);
        dpc.setDialog(dp);
        dpc.setPosition(i);
        m_panelList.put(dpc.getPosition(), dpc);
    }
}
Also used : DropPaneConfig(org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig) NodeSettingsRO(org.knime.core.node.NodeSettingsRO)

Example 5 with DropPaneConfig

use of org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig in project knime-core by knime.

the class ManualSelectionConfiguration method validateSettings.

@Override
public void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    int size = settings.getInt("numberOfPanels");
    for (int i = 0; i < size; i++) {
        DropPaneConfig dpc = new DropPaneConfig();
        dpc.getSelection().addAll(Arrays.asList(settings.getString("panelIndex_" + i).split("\n")));
        PaneConfigurationDialog dp = m_fac.getNewInstance();
        NodeSettingsRO n = settings.getNodeSettings("dialogSettings_" + i);
        dp.validateSettings(n);
        dpc.setDialog(dp);
        dpc.setPosition(i);
    }
}
Also used : DropPaneConfig(org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig) NodeSettingsRO(org.knime.core.node.NodeSettingsRO)

Aggregations

DropPaneConfig (org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig)13 NodeSettingsRO (org.knime.core.node.NodeSettingsRO)6 NodeSettings (org.knime.core.node.NodeSettings)4 ArrayList (java.util.ArrayList)3 DataColumnSpec (org.knime.core.data.DataColumnSpec)2 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)2 DataColumnSpecCreator (org.knime.core.data.DataColumnSpecCreator)1 DataType (org.knime.core.data.DataType)1 Pair (org.knime.core.util.Pair)1