Search in sources :

Example 1 with DialogComponentBoolean

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

the class RulesToTableNodeDialog method createScoreDistribution.

/**
 * {@inheritDoc}
 */
@Override
protected void createScoreDistribution(final RulesToTableSettings settings) {
    createNewGroup("Score distribution");
    setHorizontalPlacement(true);
    m_scoreTableRecordCount = settings.getScoreTableRecordCount();
    final SettingsModelString scoreTableRecordCountPrefix = settings.getScoreTableRecordCountPrefix();
    addDialogComponent(new DialogComponentBoolean(m_scoreTableRecordCount, "Provide score distibution record count in table with column name prefix:"));
    addDialogComponent(new DialogComponentString(scoreTableRecordCountPrefix, ""));
    setHorizontalPlacement(false);
    setHorizontalPlacement(true);
    m_scoreTableProbability = settings.getScoreTableProbability();
    final SettingsModelString scoreTableProbabilityPrefix = settings.getScoreTableProbabilityPrefix();
    addDialogComponent(new DialogComponentBoolean(m_scoreTableProbability, "Provide score distibution probability in table with column name prefix:"));
    addDialogComponent(new DialogComponentString(scoreTableProbabilityPrefix, ""));
    m_scoreTableRecordCount.addChangeListener(c -> scoreTableRecordCountPrefix.setEnabled(m_scoreTableRecordCount.isEnabled() && m_scoreTableRecordCount.getBooleanValue()));
    m_scoreTableProbability.addChangeListener(c -> scoreTableProbabilityPrefix.setEnabled(m_scoreTableProbability.isEnabled() && m_scoreTableProbability.getBooleanValue()));
}
Also used : DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 2 with DialogComponentBoolean

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

the class ExtractDurationPeriodFieldsNodeDialog method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    m_dialogCompColSelect.saveSettingsTo(settings);
    for (final DialogComponentBoolean dc : m_dialogCompsDurationFields) {
        dc.saveSettingsTo(settings);
    }
    for (final DialogComponentBoolean dc : m_dialogCompsPeriodFields) {
        dc.saveSettingsTo(settings);
    }
    m_dialogCompSubSecond.saveSettingsTo(settings);
    m_dialogCompSubsecondUnits.saveSettingsTo(settings);
}
Also used : DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 3 with DialogComponentBoolean

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

the class ExtractDateTimeFieldsNodeDialog method loadSettingsFrom.

/**
 * {@inheritDoc}
 */
@Override
protected void loadSettingsFrom(final NodeSettingsRO settings, final DataTableSpec[] specs) throws NotConfigurableException {
    m_dialogCompColSelect.loadSettingsFrom(settings, specs);
    for (final DialogComponentBoolean dc : m_dialogCompDateFields) {
        dc.loadSettingsFrom(settings, specs);
    }
    for (final DialogComponentBoolean dc : m_dialogCompTimeFields) {
        dc.loadSettingsFrom(settings, specs);
    }
    m_dialogCompSubsecondUnits.loadSettingsFrom(settings, specs);
    for (final DialogComponentBoolean dc : m_dialogCompTimeZoneFields) {
        dc.loadSettingsFrom(settings, specs);
    }
    m_dialogCompLocale.loadSettingsFrom(settings, specs);
    refreshFieldsSelectionsEnabled();
}
Also used : DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 4 with DialogComponentBoolean

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

the class ExtractDateTimeFieldsNodeDialog method refreshFieldsSelectionsEnabled.

private void refreshFieldsSelectionsEnabled() {
    if (m_dialogCompColSelect.getSelectedAsSpec() != null) {
        final DataType type = m_dialogCompColSelect.getSelectedAsSpec().getType();
        final boolean isDate = ExtractDateTimeFieldsNodeModel.isDateType(type);
        for (final DialogComponentBoolean dc : m_dialogCompDateFields) {
            dc.getModel().setEnabled(isDate);
        }
        final boolean isTime = ExtractDateTimeFieldsNodeModel.isTimeType(type);
        for (final DialogComponentBoolean dc : m_dialogCompTimeFields) {
            dc.getModel().setEnabled(isTime);
        }
        final boolean isZoned = ExtractDateTimeFieldsNodeModel.isZonedType(type);
        for (final DialogComponentBoolean dc : m_dialogCompTimeZoneFields) {
            dc.getModel().setEnabled(isZoned);
        }
    }
}
Also used : DataType(org.knime.core.data.DataType) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Example 5 with DialogComponentBoolean

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

the class ExtractDateTimeFieldsNodeDialog method saveSettingsTo.

/**
 * {@inheritDoc}
 */
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
    m_dialogCompColSelect.saveSettingsTo(settings);
    for (final DialogComponentBoolean dc : m_dialogCompDateFields) {
        dc.saveSettingsTo(settings);
    }
    for (final DialogComponentBoolean dc : m_dialogCompTimeFields) {
        dc.saveSettingsTo(settings);
    }
    m_dialogCompSubsecondUnits.saveSettingsTo(settings);
    for (final DialogComponentBoolean dc : m_dialogCompTimeZoneFields) {
        dc.saveSettingsTo(settings);
    }
    m_dialogCompLocale.saveSettingsTo(settings);
}
Also used : DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean)

Aggregations

DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)20 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)9 JPanel (javax.swing.JPanel)7 GridBagConstraints (java.awt.GridBagConstraints)5 GridBagLayout (java.awt.GridBagLayout)5 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)5 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)4 Box (javax.swing.Box)3 DialogComponent (org.knime.core.node.defaultnodesettings.DialogComponent)3 DialogComponentNumber (org.knime.core.node.defaultnodesettings.DialogComponentNumber)3 DialogComponentStringSelection (org.knime.core.node.defaultnodesettings.DialogComponentStringSelection)3 BorderLayout (java.awt.BorderLayout)2 ChangeEvent (javax.swing.event.ChangeEvent)2 ChangeListener (javax.swing.event.ChangeListener)2 DialogComponentColumnFilter2 (org.knime.core.node.defaultnodesettings.DialogComponentColumnFilter2)2 SettingsModelInteger (org.knime.core.node.defaultnodesettings.SettingsModelInteger)2 Component (java.awt.Component)1 Dimension (java.awt.Dimension)1 Insets (java.awt.Insets)1 Arrays (java.util.Arrays)1