Package com.biglybt.pif.ui.config
Interface Parameter
- All Superinterfaces:
ConfigParameter
- All Known Subinterfaces:
ActionParameter
,BooleanParameter
,ColorParameter
,DirectoryParameter
,EnablerParameter
,FileParameter
,FloatParameter
,HyperlinkParameter
,InfoParameter
,IntListParameter
,IntParameter
,LabelParameter
,ParameterGroup
,ParameterTabFolder
,ParameterWithSuffix
,PasswordParameter
,StringListParameter
,StringParameter
,UIParameter
- All Known Implementing Classes:
ActionParameterImpl
,BooleanParameterImpl
,ColorParameterImpl
,DirectoryParameterImpl
,FileParameterImpl
,FloatParameterImpl
,HyperlinkParameterImpl
,InfoParameterImpl
,IntListParameterImpl
,IntParameterImpl
,LabelParameterImpl
,ParameterGroupImpl
,ParameterImpl
,ParameterTabFolderImpl
,PasswordParameterImpl
,StringListParameterImpl
,StringParameterImpl
,UIParameterImpl
,UITextAreaImpl
represents a generic parameter description
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Adds a listener triggered when the parameter is changed by the uservoid
addValidator
(ParameterValidator validator) Adds a validator to this parameter.boolean
Retrieve the language bundle key for the label associated with this parameter.Retrieve the actual text of the label associated with this parameter.int
Gets the lowest user mode required for this parameter to be displayed.Retrieve the parameter's value as an Object.boolean
Indicates if a value has been set for the parameter.boolean
Retrieves the enabled state for the UI object for this parameterboolean
isForUIType
(String uiType) boolean
Retrieves the visiblility state for the UI object for this parametervoid
Removes a previously added listenerboolean
Resets the parameter to its default valuevoid
setAllowedUiTypes
(String... uiTypes) void
setEnabled
(boolean enabled) Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)void
setGenerateIntermediateEvents
(boolean b) Controls whether or not 'parameter change' events are fired for each incremental value changevoid
setIndent
(int indent, boolean fancy) void
setLabelKey
(String sLabelKey) Set the label to use the supplied language bundle key for the label associated with this parametervoid
setLabelText
(String sText) Set the text of the label associated to with this parameter to the literal text supplied.void
setMinimumRequiredUserMode
(int mode) Sets the lowest user mode required for this parameter to be displayed.void
setVisible
(boolean visible) Sets whether the UI object for this parameter is visible to the userMethods inherited from interface com.biglybt.pif.config.ConfigParameter
addConfigParameterListener, removeConfigParameterListener
-
Field Details
-
MODE_BEGINNER
static final int MODE_BEGINNER- See Also:
-
MODE_INTERMEDIATE
static final int MODE_INTERMEDIATE- See Also:
-
MODE_ADVANCED
static final int MODE_ADVANCED- See Also:
-
-
Method Details
-
setEnabled
void setEnabled(boolean enabled) Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)- Parameters:
enabled
- The new enabled state- Since:
- 2.3.0.0
-
isEnabled
boolean isEnabled()Retrieves the enabled state for the UI object for this parameter- Returns:
- The enabled state
- Since:
- 2.3.0.0
-
getMinimumRequiredUserMode
int getMinimumRequiredUserMode()Gets the lowest user mode required for this parameter to be displayed.- Returns:
- MODE_ constants above
- Since:
- 3.0.5.3
-
setMinimumRequiredUserMode
void setMinimumRequiredUserMode(int mode) Sets the lowest user mode required for this parameter to be displayed.- Parameters:
mode
- see MODE_ constants defined above- Since:
- 3.0.5.3
-
setVisible
void setVisible(boolean visible) Sets whether the UI object for this parameter is visible to the user- Parameters:
visible
- The new visibility state- Since:
- 2.3.0.4
-
isVisible
boolean isVisible()Retrieves the visiblility state for the UI object for this parameter- Returns:
- The visibility state
- Since:
- 2.3.0.4
-
setGenerateIntermediateEvents
void setGenerateIntermediateEvents(boolean b) Controls whether or not 'parameter change' events are fired for each incremental value change- Parameters:
b
-- Since:
- 3.0.5.1
-
getGenerateIntermediateEvents
boolean getGenerateIntermediateEvents()- Returns:
- Since:
- 3.0.5.1
-
addListener
Adds a listener triggered when the parameter is changed by the user- Parameters:
l
- Listener to add- Since:
- 2.1.0.2
-
addAndFireListener
-
removeListener
Removes a previously added listener- Parameters:
l
- Listener to remove.- Since:
- 2.1.0.2
-
addValidator
Adds a validator to this parameter. The Validator will be called when the user tries to change the value. For parameters that have a text field, the validator will be called on each edit of the field. This allows you to notify the user of a potential error while they type. Subclasses may have helper functions that cast the "toValue" for you.- Since:
- BiglyBT 1.9.0.1
-
getLabelText
String getLabelText()Retrieve the actual text of the label associated with this parameter. This is the text after it has been looked up in the language bundle.- Returns:
- The label's text
- Since:
- 2.3.0.6
-
setLabelText
Set the text of the label associated to with this parameter to the literal text supplied.- Parameters:
sText
- The actual text to assign to the label- Since:
- 2.3.0.6
-
getLabelKey
String getLabelKey()Retrieve the language bundle key for the label associated with this parameter.- Returns:
- The language bundle key, or null if the label is using literal text
- Since:
- 2.3.0.6
-
setLabelKey
Set the label to use the supplied language bundle key for the label associated with this parameter- Parameters:
sLabelKey
- The language bundle key to use.- Since:
- 2.3.0.6
-
getConfigKeyName
String getConfigKeyName() -
hasBeenSet
boolean hasBeenSet()Indicates if a value has been set for the parameter. If no value has been set, the default value will be used. To capture a "reset to default" event, you canaddListener(ParameterListener)
orConfigParameter.addConfigParameterListener(ConfigParameterListener)
, and check if hasBeenSet is false. -
setIndent
void setIndent(int indent, boolean fancy) - Since:
- BiglyBT 1.9.0.1
-
setAllowedUiTypes
-
isForUIType
-
resetToDefault
boolean resetToDefault()Resets the parameter to its default value- Returns:
- true - value was reset; false - already reset
-
getValueObject
Object getValueObject()Retrieve the parameter's value as an Object. Subclasses will usually have a getValue() that will return a specific type.- Since:
- BiglyBT 1.9.0.1
-