Search in sources :

Example 36 with SettingsModelString

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

the class TableToVariableNodeDialog method getReplaceString.

/**
 * @param policyModel The policy model.
 * @return the SM for the new String value.
 */
static final SettingsModelString getReplaceString(final SettingsModelString policyModel) {
    SettingsModelString model = new SettingsModelString("CFG_String", "missing");
    ChangeListener listener = new PolicyChangeListener(policyModel, model);
    policyModel.addChangeListener(listener);
    listener.stateChanged(null);
    return model;
}
Also used : ChangeListener(javax.swing.event.ChangeListener) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 37 with SettingsModelString

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

the class DBConnectionWriterNodeModel method validateSettings.

/**
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    SettingsModelString tableName = m_tableName.createCloneWithValidatedValue(settings);
    String tableString = tableName.getStringValue();
    if (tableString == null || tableString.trim().isEmpty()) {
        throw new InvalidSettingsException("Configure node and enter a valid table name.");
    }
}
Also used : InvalidSettingsException(org.knime.core.node.InvalidSettingsException) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 38 with SettingsModelString

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

the class DBQueryNodeModel method validateSettings.

/**
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
    super.validateSettings(settings);
    SettingsModelString query = m_query.createCloneWithValidatedValue(settings);
    String queryString = query.getStringValue();
    if (queryString != null && !queryString.contains(TABLE_PLACE_HOLDER)) {
        throw new InvalidSettingsException("Database view place holder (" + TABLE_PLACE_HOLDER + ") must not be replaced.");
    }
}
Also used : InvalidSettingsException(org.knime.core.node.InvalidSettingsException) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 39 with SettingsModelString

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

the class CorrelationOperator method getDialogComponent.

private DialogComponentButtonGroup getDialogComponent() {
    if (m_correlationComponent == null) {
        final SettingsModelString correlationModel = m_settings.getCorrelationMethodModel();
        m_correlationComponent = new DialogComponentButtonGroup(correlationModel, "Correlation method", false, CorrelationMethods.values());
    }
    return m_correlationComponent;
}
Also used : DialogComponentButtonGroup(org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 40 with SettingsModelString

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

the class PivotNodeDialogPane method createSettingsAggregation.

/**
 * @return a settings model string as pivot column
 */
static final SettingsModelString createSettingsAggregation() {
    SettingsModelString model = new SettingsModelString("aggregation_column", null);
    model.setEnabled(false);
    return model;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)99 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)39 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)15 ChangeListener (javax.swing.event.ChangeListener)13 ChangeEvent (javax.swing.event.ChangeEvent)12 IOException (java.io.IOException)8 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)8 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 File (java.io.File)4 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 DateTimeException (java.time.DateTimeException)3