Search in sources :

Example 6 with DialogComponent

use of org.knime.core.node.defaultnodesettings.DialogComponent in project knime-core by knime.

the class ColumnAggregatorNodeDialog method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    for (final DialogComponent component : m_components) {
        component.saveSettingsTo(settings);
    }
    // since the table does not loose focus when OK or Apply is pressed.
    try {
        m_aggrMethodsPanel.stopCellEditing();
    } catch (IllegalArgumentException e) {
        System.out.println(e.getMessage());
    }
    m_aggrMethodsPanel.saveSettingsTo(settings.addNodeSettings(ColumnAggregatorNodeModel.CFG_AGGREGATION_METHODS));
    m_version.saveSettingsTo(settings);
}
Also used : DialogComponent(org.knime.core.node.defaultnodesettings.DialogComponent)

Example 7 with DialogComponent

use of org.knime.core.node.defaultnodesettings.DialogComponent in project knime-core by knime.

the class PredictorNodeDialog method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    for (DialogComponent comp : m_dialogComponents) {
        comp.saveSettingsTo(settings);
    }
    m_overridePredModel.setBooleanValue(m_overridePred.isSelected());
    m_overridePredModel.saveSettingsTo(settings);
    m_predictionColModel.setEnabled(m_predColName.isEnabled());
    m_predictionColModel.setStringValue(m_predColName.getText());
    if (m_predColName.isEnabled() && m_predColName.getText().isEmpty()) {
        throw new InvalidSettingsException("Please specify a prediction column name.");
    }
    m_predictionColModel.saveSettingsTo(settings);
    m_addProbsModel.setBooleanValue(m_addProbs.isSelected());
    m_addProbsModel.saveSettingsTo(settings);
    m_suffixModel.setEnabled(m_suffix.isEnabled());
    m_suffixModel.setStringValue(m_suffix.getText());
    m_suffixModel.saveSettingsTo(settings);
}
Also used : InvalidSettingsException(org.knime.core.node.InvalidSettingsException) DialogComponent(org.knime.core.node.defaultnodesettings.DialogComponent)

Aggregations

DialogComponent (org.knime.core.node.defaultnodesettings.DialogComponent)7 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)3 DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)2 DialogComponentNumber (org.knime.core.node.defaultnodesettings.DialogComponentNumber)2 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)2 SettingsModelInteger (org.knime.core.node.defaultnodesettings.SettingsModelInteger)2 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 ActionListener (java.awt.event.ActionListener)1 Box (javax.swing.Box)1 JPanel (javax.swing.JPanel)1 JRadioButton (javax.swing.JRadioButton)1 NotConfigurableException (org.knime.core.node.NotConfigurableException)1 DialogComponentStringSelection (org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)1 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)1