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());
}
}
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;
}
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());
}
}
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);
}
}
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);
}
}
Aggregations