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
public interface Parameter extends ConfigParameter
represents a generic parameter description
-
-
Field Summary
Fields Modifier and Type Field Description static int
MODE_ADVANCED
static int
MODE_BEGINNER
static int
MODE_INTERMEDIATE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(ParameterListener l)
Adds a listener triggered when the parameter is changed by the uservoid
addValidator(ParameterValidator validator)
Adds a validator to this parameter.java.lang.String
getConfigKeyName()
boolean
getGenerateIntermediateEvents()
java.lang.String
getLabelKey()
Retrieve the language bundle key for the label associated with this parameter.java.lang.String
getLabelText()
Retrieve the actual text of the label associated with this parameter.int
getMinimumRequiredUserMode()
Gets the lowest user mode required for this parameter to be displayed.java.lang.Object
getValueObject()
Retrieve the parameter's value as an Object.boolean
hasBeenSet()
Indicates if a value has been set for the parameter.boolean
isEnabled()
Retrieves the enabled state for the UI object for this parameterboolean
isForUIType(java.lang.String uiType)
boolean
isVisible()
Retrieves the visiblility state for the UI object for this parametervoid
removeListener(ParameterListener l)
Removes a previously added listenerboolean
resetToDefault()
Resets the parameter to its default valuevoid
setAllowedUiTypes(java.lang.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(java.lang.String sLabelKey)
Set the label to use the supplied language bundle key for the label associated with this parametervoid
setLabelText(java.lang.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 user-
Methods inherited from interface com.biglybt.pif.config.ConfigParameter
addConfigParameterListener, removeConfigParameterListener
-
-
-
-
Field Detail
-
MODE_BEGINNER
static final int MODE_BEGINNER
- See Also:
- Constant Field Values
-
MODE_INTERMEDIATE
static final int MODE_INTERMEDIATE
- See Also:
- Constant Field Values
-
MODE_ADVANCED
static final int MODE_ADVANCED
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
void addListener(ParameterListener l)
Adds a listener triggered when the parameter is changed by the user- Parameters:
l
- Listener to add- Since:
- 2.1.0.2
-
removeListener
void removeListener(ParameterListener l)
Removes a previously added listener- Parameters:
l
- Listener to remove.- Since:
- 2.1.0.2
-
addValidator
void addValidator(ParameterValidator validator)
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
java.lang.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
void setLabelText(java.lang.String sText)
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
java.lang.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
void setLabelKey(java.lang.String sLabelKey)
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
java.lang.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
void setAllowedUiTypes(java.lang.String... uiTypes)
-
isForUIType
boolean isForUIType(java.lang.String uiType)
-
resetToDefault
boolean resetToDefault()
Resets the parameter to its default value- Returns:
- true - value was reset; false - already reset
-
getValueObject
java.lang.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
-
-