Search in sources :

Example 81 with SettingsModelString

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

the class DateTimeShiftNodeModel method createPeriodValueModel.

/**
 * @param periodSelectionModel model for the period selection button group
 * @return the string model, used in both dialog and model.
 */
public static SettingsModelString createPeriodValueModel(final SettingsModelString periodSelectionModel) {
    final SettingsModelString model = new SettingsModelString("period_value", "");
    periodSelectionModel.addChangeListener(l -> model.setEnabled(periodSelectionModel.getStringValue().equals(DurationMode.Value.name()) && periodSelectionModel.isEnabled()));
    model.setEnabled(false);
    return model;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 82 with SettingsModelString

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

the class DateTimeShiftNodeModel method createNumericalSelectionModel.

/**
 * @return the string model, used in both dialog and model.
 */
public static SettingsModelString createNumericalSelectionModel() {
    final SettingsModelString model = new SettingsModelString("numerical_selection", NumericalMode.Column.name());
    model.setEnabled(false);
    return model;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 83 with SettingsModelString

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

the class ModifyTimeNodeModel method createSuffixModel.

/**
 * @param replaceOrAppendModel model for the replace/append button group
 * @return the string model, used in both dialog and model.
 */
static SettingsModelString createSuffixModel(final SettingsModelString replaceOrAppendModel) {
    final SettingsModelString suffixModel = new SettingsModelString("suffix", "(modified time)");
    replaceOrAppendModel.addChangeListener(e -> suffixModel.setEnabled(replaceOrAppendModel.getStringValue().equals(OPTION_APPEND)));
    suffixModel.setEnabled(false);
    return suffixModel;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 84 with SettingsModelString

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

the class ModifyDateNodeModel method createTimeZoneSelectModel.

/**
 * @return the string select model, used in both dialog and model.
 */
static SettingsModelString createTimeZoneSelectModel(final SettingsModelBoolean zoneModelBool) {
    final SettingsModelString zoneSelectModel = new SettingsModelString("time_zone_select", ZoneId.systemDefault().getId());
    zoneSelectModel.setEnabled(false);
    zoneModelBool.addChangeListener(e -> zoneSelectModel.setEnabled(zoneModelBool.getBooleanValue()));
    return zoneSelectModel;
}
Also used : SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 85 with SettingsModelString

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

the class ModifyDateNodeModel method createSuffixModel.

/**
 * @param replaceOrAppendModel model for the replace/append button group
 * @return the string model, used in both dialog and model.
 */
public static SettingsModelString createSuffixModel(final SettingsModelString replaceOrAppendModel) {
    final SettingsModelString suffixModel = new SettingsModelString("suffix", "(modified date)");
    replaceOrAppendModel.addChangeListener(e -> suffixModel.setEnabled(replaceOrAppendModel.getStringValue().equals(OPTION_APPEND)));
    suffixModel.setEnabled(false);
    return suffixModel;
}
Also used : 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