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
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 Summary
ModifierConstructorDescriptionprotected
SettingDescriptor
(String id, String label, T defaultValue) Constructor.protected
SettingDescriptor
(String id, String label, T defaultValue, boolean showLabel) Constructor.protected
SettingDescriptor
(String id, String label, T defaultValue, boolean showLabel, boolean enabled, boolean supportsDisable) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateInput
(Settings settings, boolean readOnly) Deprecated.abstract javafx.scene.Node
createInputFX
(Settings settings, boolean readOnly) Creates the component that will accept the user input.javafx.scene.Node
createTBInput
(Settings settings) Creates a version of the input that can be displayed in a tool bar.Gets the default value for this setting.int
Gets the number of columns occupied by the input component.Gets the icon factory for associating an icon with the input in the tool bar/quick editorgetId()
Gets the id of this setting.getLabel()
Gets the label for this setting (displayed to the user).getName()
Deprecated.use getId instead.boolean
Indicates if user "Save As Defaults" operations apply to this setting.boolean
Indicates if this setting is used to affect the appearance of the of the study/strategyboolean
Indicates if the setting is enabled.boolean
If true, the label for this setting will be displayed to the user.boolean
If true, this setting can be disabled by the user.void
setAllowUserDefaults
(boolean allowUserDefaults) Sets the ability of the user to override defaults for this settingprotected void
setDefaultValue
(T value) Sets the default value for this setting.setDescription
(String description) protected void
setEnabled
(boolean b) Sets the enabled attribute.void
setGridWidth
(int width) Sets the number of columns occupied by the input component.setHelpLink
(String helpLink) setIconFactory
(IconFactory fact) Sets the icon factory for associating an icon with the input in the tool barvoid
setShowLabel
(boolean b) Sets the show label attribute for the setting.void
setSupportsDisable
(boolean b) If true, this setting can be disabled by the user.
-
Constructor Details
-
SettingDescriptor
Constructor. Creates a setting descriptor with a name, label and default value.- Parameters:
id
- setting input idlabel
- label displayed to the userdefaultValue
- default value for this setting
-
SettingDescriptor
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 idlabel
- label displayed to the userdefaultValue
- default value for this settingshowLabel
- 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 idlabel
- label displayed to the userdefaultValue
- default value for this settingshowLabel
- true if the label should be shownenabled
- true if this setting is enabledsupportsDisable
- true if the user can disable this setting
-
-
Method Details
-
getLabel
Gets the label for this setting (displayed to the user).- Returns:
- label for this setting
-
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.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
Gets the default value for this setting.- Returns:
- default value for the setting
-
setDefaultValue
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.Creates the component that will accept the user input. This is called by the study framework.- Parameters:
settings
- settings for the studyreadOnly
- true if the component should not accept user input- Returns:
- component that will accept user input.
-
createInputFX
Creates the component that will accept the user input. This is called by the study framework.- Parameters:
settings
- settings for the studyreadOnly
- true if the component should not accept user input- Returns:
- component that will accept user input.
-
createTBInput
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
Sets the icon factory for associating an icon with the input in the tool bar- Parameters:
fact
- factory for creating the icon
-
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
-
setDescription
-
getHelpLink
-
setHelpLink
-
fromJson
-