use of org.knime.core.quickform.QuickFormConfigurationPanel in project knime-core by knime.
the class MetaNodeDialogPane method loadSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs) throws NotConfigurableException {
// we may have quickform nodes to allow a column selection?)
for (Map.Entry<NodeID, MetaNodeDialogNode> e : m_nodes.entrySet()) {
if (e.getValue() instanceof QuickFormInputNode) {
AbstractQuickFormConfiguration config = ((QuickFormInputNode) e.getValue()).getConfiguration();
AbstractQuickFormValueInConfiguration valueConfig = config.getValueConfiguration();
try {
NodeSettingsRO subSettings = settings.getNodeSettings(Integer.toString(e.getKey().getIndex()));
valueConfig.loadValueInDialog(subSettings);
QuickFormConfigurationPanel panel = m_quickFormInputNodePanels.get(e.getKey());
assert panel != null : "No panel instance for node " + e.getKey();
panel.loadSettings(valueConfig);
} catch (InvalidSettingsException ise) {
// no op
}
} else if (e.getValue() instanceof DialogNode) {
final DialogNode dialogNode = (DialogNode) e.getValue();
final DialogNodeValue nodeValue = dialogNode.createEmptyDialogValue();
final String parameterName = SubNodeContainer.getDialogNodeParameterName(dialogNode, e.getKey());
try {
NodeSettingsRO subSettings = settings.getNodeSettings(parameterName);
nodeValue.loadFromNodeSettingsInDialog(subSettings);
final DialogNodePanel dialogNodePanel = m_dialogNodePanels.get(e.getKey());
dialogNodePanel.loadNodeValue(nodeValue);
} catch (InvalidSettingsException ex) {
// no op
}
}
}
}
use of org.knime.core.quickform.QuickFormConfigurationPanel in project knime-core by knime.
the class MetaNodeDialogPane method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
for (Map.Entry<NodeID, MetaNodeDialogNode> e : m_nodes.entrySet()) {
final NodeID key = e.getKey();
if (e.getValue() instanceof QuickFormInputNode) {
AbstractQuickFormConfiguration config = ((QuickFormInputNode) e.getValue()).getConfiguration();
AbstractQuickFormValueInConfiguration valueConfig = config.createValueConfiguration();
QuickFormConfigurationPanel value = m_quickFormInputNodePanels.get(key);
value.saveSettings(valueConfig);
NodeSettingsWO subSettings = settings.addNodeSettings((Integer.toString(key.getIndex())));
valueConfig.saveValue(subSettings);
} else if (e.getValue() instanceof DialogNode) {
DialogNode dialogNode = (DialogNode) e.getValue();
DialogNodePanel nodePanel = m_dialogNodePanels.get(key);
DialogNodeValue nodeValue = nodePanel.getNodeValue();
final String parameterName = SubNodeContainer.getDialogNodeParameterName(dialogNode, key);
if (nodeValue != null) {
NodeSettingsWO subSettings = settings.addNodeSettings((parameterName));
nodeValue.saveToNodeSettings(subSettings);
}
}
}
}
Aggregations