use of org.knime.base.node.preproc.draganddroppanel.droppanes.DropPaneConfig in project knime-core by knime.
the class TypeSelectionConfiguration method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
public void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
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.saveSettingsTo(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 TypeSelectionConfiguration method loadValidatedSettingsFrom.
/**
* {@inheritDoc}
*/
@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 TypeSelectionConfiguration method validateSettings.
/**
* {@inheritDoc}
*/
@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