Search in sources :

Example 56 with SettingsModelString

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

the class CreateBitVectorNodeModel method createMSCSetMatchingModel.

/**
 *@return the multi string column set matching model
 */
static SettingsModelString createMSCSetMatchingModel() {
    final SettingsModelString m = new SettingsModelString("multiStringColumnSetMatching", SetMatching.MATCHING.getActionCommand());
    m.setEnabled(false);
    return m;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 57 with SettingsModelString

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

the class CreateBitVectorNodeModel method createMSCPattern.

/**
 *@return the multi string pattern.
 */
static SettingsModelString createMSCPattern() {
    final SettingsModelString m = new SettingsModelString("multiStringColumnPatter", null);
    m.setEnabled(false);
    return m;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 58 with SettingsModelString

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

the class CreateBitVectorNodeModel method createSingleStringColumnTypeModel.

/**
 * @return the single string column type model.
 */
static SettingsModelString createSingleStringColumnTypeModel() {
    final SettingsModelString model = new SettingsModelString("singleStringType", StringType.BIT.getActionCommand());
    model.setEnabled(ColumnType.getDefault().equals(ColumnType.SINGLE_STRING));
    return model;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 59 with SettingsModelString

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

the class CellReplacerNodeModel method validateSettings.

/**
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    m_targetColModel.validateSettings(settings);
    SettingsModelString clone = m_noMatchPolicyModel.createCloneWithValidatedValue(settings);
    try {
        NoMatchPolicy.valueOf(clone.getStringValue());
    } catch (Exception e) {
        throw new InvalidSettingsException("Invalid policy: " + clone.getStringValue());
    }
    m_dictInputColModel.validateSettings(settings);
    m_dictOutputColModel.validateSettings(settings);
    m_appendColumnModel.validateSettings(settings);
    m_appendColumnNameModel.validateSettings(settings);
}
Also used : InvalidSettingsException(org.knime.core.node.InvalidSettingsException) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) InvalidSettingsException(org.knime.core.node.InvalidSettingsException) CanceledExecutionException(org.knime.core.node.CanceledExecutionException) IOException(java.io.IOException)

Example 60 with SettingsModelString

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

the class CellReplacerNodeModel method createAppendColumnNameModel.

/**
 * @param appendColumnModel flag model (enable/disable)
 * @return New settings model for append column name.
 */
static final SettingsModelString createAppendColumnNameModel(final SettingsModelBoolean appendColumnModel) {
    final SettingsModelString result = new SettingsModelString("appendColumnName", "Replacement");
    appendColumnModel.addChangeListener(new ChangeListener() {

        /**
         * {@inheritDoc}
         */
        @Override
        public void stateChanged(final ChangeEvent e) {
            result.setEnabled(appendColumnModel.getBooleanValue());
        }
    });
    result.setEnabled(appendColumnModel.getBooleanValue());
    return result;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)96 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)36 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)15 ChangeListener (javax.swing.event.ChangeListener)13 ChangeEvent (javax.swing.event.ChangeEvent)12 IOException (java.io.IOException)7 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)7 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)7 Duration (java.time.Duration)5 Period (java.time.Period)5 DateTimeParseException (java.time.format.DateTimeParseException)5 SettingsModelDateTime (org.knime.time.util.SettingsModelDateTime)5 LocalDate (java.time.LocalDate)4 LocalDateTime (java.time.LocalDateTime)4 ZonedDateTime (java.time.ZonedDateTime)4 Temporal (java.time.temporal.Temporal)4 TemporalAmount (java.time.temporal.TemporalAmount)4 DateTimeType (org.knime.time.util.DateTimeType)4 File (java.io.File)3 DateTimeException (java.time.DateTimeException)3