Class IntParameterImpl
java.lang.Object
com.biglybt.pifimpl.local.ui.config.ParameterImpl
com.biglybt.pifimpl.local.ui.config.IntParameterImpl
- All Implemented Interfaces:
ParameterListener
,ConfigParameter
,EnablerParameter
,IntParameter
,Parameter
,ParameterWithSuffix
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private int
private boolean
private String
private int
Fields inherited from class com.biglybt.pifimpl.local.ui.config.ParameterImpl
configKey
Fields inherited from interface com.biglybt.pif.ui.config.Parameter
MODE_ADVANCED, MODE_BEGINNER, MODE_INTERMEDIATE
-
Constructor Summary
ConstructorsConstructorDescriptionIntParameterImpl
(String configKey, String labelKey) IntParameterImpl
(String configKey, String labelKey, int min_value, int max_value) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIntegerValidator
(ParameterValidator<Integer> validator) Same asParameter.addValidator(ParameterValidator)
, but casts the "toValue" to Integer.int
int
int
getValue()
Retrieve the parameter's value as an Object.int
boolean
boolean
void
setMaxValue
(int max_value) void
setMinValue
(int min_value) void
setStoredAsString
(boolean storedAsString, int valueWhenBlank) Note: We can't easily propogate this toIntParameter
, becauseBasicPluginConfigModel.addIntParameter2(String, String, int)
sets the default value to int before setStoredAsString can be called.void
setSuffixLabelKey
(String suffixLabelKey) void
setSuffixLabelText
(String text) void
setValue
(int value) Methods inherited from class com.biglybt.pifimpl.local.ui.config.ParameterImpl
addAndFireListener, addConfigParameterListener, addDisabledOnSelection, addDisabledOnSelection, addEnabledOnSelection, addEnabledOnSelection, addImplListener, addListener, addValidator, destroy, fireParameterChanged, getConfigKeyName, getDisabledOnSelectionParameters, getEnabledOnSelectionParameters, getGenerateIntermediateEvents, getGroup, getIndent, getKey, getLabelKey, getLabelText, getMinimumRequiredUserMode, getReferenceID, hasBeenSet, isEnabled, isForUIType, isIndentFancy, isVisible, parameterChanged, refreshControl, removeConfigParameterListener, removeImplListener, removeListener, resetToDefault, search, setAllowedUiTypes, setEnabled, setGenerateIntermediateEvents, setGroup, setIndent, setLabelKey, setLabelText, setMinimumRequiredUserMode, setReferenceID, setVisible, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.pif.config.ConfigParameter
addConfigParameterListener, removeConfigParameterListener
Methods inherited from interface com.biglybt.pif.ui.config.Parameter
addAndFireListener, addListener, addValidator, getConfigKeyName, getGenerateIntermediateEvents, getLabelKey, getLabelText, getMinimumRequiredUserMode, hasBeenSet, isEnabled, isForUIType, isVisible, removeListener, resetToDefault, setAllowedUiTypes, setEnabled, setGenerateIntermediateEvents, setIndent, setLabelKey, setLabelText, setMinimumRequiredUserMode, setVisible
-
Field Details
-
limited
private boolean limited -
min_value
private int min_value -
max_value
private int max_value -
storedAsString
private boolean storedAsString -
valueWhenBlank
private int valueWhenBlank -
suffixLabelKey
-
-
Constructor Details
-
IntParameterImpl
-
IntParameterImpl
-
-
Method Details
-
getValue
public int getValue()- Specified by:
getValue
in interfaceIntParameter
-
getValueObject
Description copied from interface:Parameter
Retrieve the parameter's value as an Object. Subclasses will usually have a getValue() that will return a specific type.- Specified by:
getValueObject
in interfaceParameter
- Overrides:
getValueObject
in classParameterImpl
-
setValue
public void setValue(int value) - Specified by:
setValue
in interfaceIntParameter
-
isLimited
public boolean isLimited()- Specified by:
isLimited
in interfaceIntParameter
- Returns:
- Whether the parameter has a min and max value set
-
getMinValue
public int getMinValue()- Specified by:
getMinValue
in interfaceIntParameter
-
getMaxValue
public int getMaxValue()- Specified by:
getMaxValue
in interfaceIntParameter
-
setMinValue
public void setMinValue(int min_value) - Specified by:
setMinValue
in interfaceIntParameter
-
setMaxValue
public void setMaxValue(int max_value) - Specified by:
setMaxValue
in interfaceIntParameter
-
addIntegerValidator
Description copied from interface:IntParameter
Same asParameter.addValidator(ParameterValidator)
, but casts the "toValue" to Integer.- Specified by:
addIntegerValidator
in interfaceIntParameter
-
isStoredAsString
public boolean isStoredAsString() -
setStoredAsString
public void setStoredAsString(boolean storedAsString, int valueWhenBlank) Note: We can't easily propogate this toIntParameter
, becauseBasicPluginConfigModel.addIntParameter2(String, String, int)
sets the default value to int before setStoredAsString can be called. This introducing a window where retrieving the parameter value may cause a cast error. Plus, we don't want to encourage plugins to store ints as strings. -
getValueWhenBlank
public int getValueWhenBlank() -
getSuffixLabelKey
- Specified by:
getSuffixLabelKey
in interfaceParameterWithSuffix
-
setSuffixLabelKey
- Specified by:
setSuffixLabelKey
in interfaceParameterWithSuffix
-
setSuffixLabelText
- Specified by:
setSuffixLabelText
in interfaceParameterWithSuffix
-