Class SettingDescriptor<T>

java.lang.Object
com.motivewave.platform.sdk.common.desc.SettingDescriptor<T>
Direct Known Subclasses:
BarDescriptor, BarSizeDesc, BarSizeDescriptor, BooleanDescriptor, ColorDescriptor, DateTimeDescriptor, DiscreteDesc, DiscreteDescriptor, DoubleDescriptor, ExitPointDescriptor, FileDesc, FileDescriptor, FontDescriptor, GuideDescriptor, IndicatorDescriptor, InputDesc, InputDescriptor, InstrDesc, InstrumentDescriptor, IntegerDescriptor, LabelDescriptor, MAMethodDesc, MAMethodDescriptor, MarkerDescriptor, OrderTypeDescriptor, PathDescriptor, PercentSliderDescriptor, PriceBarDescriptor, QuantityDescriptor, ShadeDescriptor, SliderDescriptor, SpacerDescriptor, StringDescriptor, TifDescriptor, TimeFrameDescriptor

public abstract class SettingDescriptor<T> extends Object
Base class for all setting descriptors. Instances of this class are used to describe settings that may be configured at runtime by the user.
  • Constructor Details

    • SettingDescriptor

      protected SettingDescriptor(String id, String label, T defaultValue)
      Constructor. Creates a setting descriptor with a name, label and default value.
      Parameters:
      id - setting input id
      label - label displayed to the user
      defaultValue - default value for this setting
    • SettingDescriptor

      protected SettingDescriptor(String id, String label, T defaultValue, boolean showLabel)
      Constructor. Creates a setting descriptor with a name, label, default value and a boolean value that indicates if the label should be shown.
      Parameters:
      id - setting input id
      label - label displayed to the user
      defaultValue - default value for this setting
      showLabel - true if the label should be shown
    • SettingDescriptor

      protected SettingDescriptor(String id, String label, T defaultValue, boolean showLabel, boolean enabled, boolean supportsDisable)
      Constructor.
      Parameters:
      id - setting input id
      label - label displayed to the user
      defaultValue - default value for this setting
      showLabel - true if the label should be shown
      enabled - true if this setting is enabled
      supportsDisable - true if the user can disable this setting
  • Method Details

    • getLabel

      public String getLabel()
      Gets the label for this setting (displayed to the user).
      Returns:
      label for this setting
    • getId

      public String getId()
      Gets the id of this setting. This is used as the key to retrieve the setting from the settings.
      Returns:
      id of this setting
    • getName

      @Deprecated public String getName()
      Deprecated.
      use getId instead.
      Gets the name of this setting. This is used as the key to retrieve the setting from the settings.
      Returns:
      name of this setting
    • getDefaultValue

      public T getDefaultValue()
      Gets the default value for this setting.
      Returns:
      default value for the setting
    • setDefaultValue

      protected void setDefaultValue(T value)
      Sets the default value for this setting.
      Parameters:
      value - default value for this setting
    • isShowLabel

      public boolean isShowLabel()
      If true, the label for this setting will be displayed to the user.
      Returns:
      true if the label is shown to the user
    • setShowLabel

      public void setShowLabel(boolean b)
      Sets the show label attribute for the setting.
      Parameters:
      b - true if the label should be shown for the label
    • isSupportsDisable

      public boolean isSupportsDisable()
      If true, this setting can be disabled by the user.
      Returns:
      true if this setting can be disabled by the user
    • setSupportsDisable

      public void setSupportsDisable(boolean b)
      If true, this setting can be disabled by the user.
      Parameters:
      b - true if this descriptor supports being disabled by the user.
    • isEnabled

      public boolean isEnabled()
      Indicates if the setting is enabled.
      Returns:
      true if the setting is enabled
    • setEnabled

      protected void setEnabled(boolean b)
      Sets the enabled attribute.
      Parameters:
      b - true if this setting is enabled
    • isDisplaySetting

      public boolean isDisplaySetting()
      Indicates if this setting is used to affect the appearance of the of the study/strategy
      Returns:
      true if this setting affects the appearance of the study/strategy
    • getGridWidth

      public int getGridWidth()
      Gets the number of columns occupied by the input component.
      Returns:
      the number of columns occupied by the input component.
    • setGridWidth

      public void setGridWidth(int width)
      Sets the number of columns occupied by the input component.
      Parameters:
      width - number of columns occupied by the input component
    • createInput

      @Deprecated public JComponent createInput(Settings settings, boolean readOnly)
      Deprecated.
      Creates the component that will accept the user input. This is called by the study framework.
      Parameters:
      settings - settings for the study
      readOnly - true if the component should not accept user input
      Returns:
      component that will accept user input.
    • createInputFX

      public abstract javafx.scene.Node createInputFX(Settings settings, boolean readOnly)
      Creates the component that will accept the user input. This is called by the study framework.
      Parameters:
      settings - settings for the study
      readOnly - true if the component should not accept user input
      Returns:
      component that will accept user input.
    • createTBInput

      public javafx.scene.Node createTBInput(Settings settings)
      Creates a version of the input that can be displayed in a tool bar.
      Parameters:
      settings - settings for the study
      Returns:
      component that will accept user input.
    • setIconFactory

      public SettingDescriptor setIconFactory(IconFactory fact)
      Sets the icon factory for associating an icon with the input in the tool bar
      Parameters:
      fact - factory for creating the icon
    • getIconFactory

      public IconFactory getIconFactory()
      Gets the icon factory for associating an icon with the input in the tool bar/quick editor
      Returns:
      icon factory
    • isAllowUserDefaults

      public boolean isAllowUserDefaults()
      Indicates if user "Save As Defaults" operations apply to this setting.
      Returns:
      true if user "Save As Defaults" operations affect this setting
    • setAllowUserDefaults

      public void setAllowUserDefaults(boolean allowUserDefaults)
      Sets the ability of the user to override defaults for this setting
      Parameters:
      allowUserDefaults -
    • getDescription

      public String getDescription()
    • setDescription

      public SettingDescriptor setDescription(String description)
    • getHelpLink

      public String getHelpLink()
    • setHelpLink

      public SettingDescriptor setHelpLink(String helpLink)
    • fromJson

      public Object fromJson(Object json)