Class DateTimeDescriptor

java.lang.Object
com.motivewave.platform.sdk.common.desc.SettingDescriptor<Long>
com.motivewave.platform.sdk.common.desc.DateTimeDescriptor

public class DateTimeDescriptor extends SettingDescriptor<Long>
Describes an input for selecting a date/time. Dates are represented using long values (number of milliseconds since 1970, AKA epoch time)
  • Constructor Details

    • DateTimeDescriptor

      public DateTimeDescriptor(String name, String label, long defaultValue)
      Constructor.
      Parameters:
      name - name of this setting (key)
      label - label displayed to the user
      defaultValue - (epoch time, number of milliseconds since 1970)
    • DateTimeDescriptor

      public DateTimeDescriptor(String name, String label, long defaultValue, boolean dateOnly)
      Constructor.
      Parameters:
      name - name of this setting (key)
      label - label displayed to the user
      defaultValue - (epoch time, number of milliseconds since 1970)
      dateOnly - true if only date values (not time) are accepted
  • Method Details

    • getDefaultValue

      public Long getDefaultValue()
      Gets the default value for this setting.
      Overrides:
      getDefaultValue in class SettingDescriptor<Long>
      Returns:
      default value for the setting
    • setDateOnly

      public void setDateOnly(boolean b)
      Sets the input to only accept date values (not time).
      Parameters:
      b - true if date only input is allowed
    • isDateOnly

      public boolean isDateOnly()
      Returns true if only date values are accepted (not time).
      Returns:
      true if only date values are accepted
    • createInputFX

      public javafx.scene.Node createInputFX(Settings settings, boolean readOnly)
      Description copied from class: SettingDescriptor
      Creates the component that will accept the user input. This is called by the study framework.
      Specified by:
      createInputFX in class SettingDescriptor<Long>
      Parameters:
      settings - settings for the study
      readOnly - true if the component should not accept user input
      Returns:
      component that will accept user input.
    • fromJson

      public Object fromJson(Object json)
      Overrides:
      fromJson in class SettingDescriptor<Long>