Class ParameterImpl
java.lang.Object
com.biglybt.pifimpl.local.ui.config.ParameterImpl
- All Implemented Interfaces:
ParameterListener
,ConfigParameter
,EnablerParameter
,Parameter
- Direct Known Subclasses:
ActionParameterImpl
,BooleanParameterImpl
,ColorParameterImpl
,DirectoryParameterImpl
,FileParameterImpl
,FloatParameterImpl
,HyperlinkParameterImpl
,InfoParameterImpl
,IntListParameterImpl
,IntParameterImpl
,LabelParameterImpl
,ParameterGroupImpl
,ParameterTabFolderImpl
,PasswordParameterImpl
,StringListParameterImpl
,StringParameterImpl
,UIParameterImpl
,UITextAreaImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]
private List
protected final String
private Boolean
private boolean
private boolean
private List
<ParameterImplListener> private int
private String
private String
private int
private ParameterGroupImpl
private String
private List
<ParameterValidator> private boolean
Fields inherited from interface com.biglybt.pif.ui.config.Parameter
MODE_ADVANCED, MODE_BEGINNER, MODE_INTERMEDIATE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
addDisabledOnSelection
(Parameter parameter) disables parameter when EnablerParameter is selected.void
addDisabledOnSelection
(Parameter... parameters) disables parameter when EnablerParameter is selected.void
addEnabledOnSelection
(Parameter paramToEnable) enables paramToEnable when this EnablerParameter is selected (checked).
paramToEnable is disabled when this EnablerParameter isn't selected (checked).void
addEnabledOnSelection
(Parameter... parameters) enables paramToEnable when this EnablerParameter is selected (checked).
paramToEnable is disabled when this EnablerParameter isn't selected (checked).void
void
Adds a listener triggered when the parameter is changed by the uservoid
addValidator
(ParameterValidator validator) Adds a validator to this parameter.void
destroy()
void
final String
boolean
getGroup()
int
getKey()
Deprecated.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
boolean
Retrieves the visiblility state for the UI object for this parametervoid
parameterChanged
(String key) Called, when a parameter has changed.void
void
void
void
Removes a previously added listenerboolean
Resets the parameter to its default valueboolean
void
setAllowedUiTypes
(String... uiTypes) void
setEnabled
(boolean e) 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
setGroup
(ParameterGroupImpl _group) void
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
setReferenceID
(String refID) void
setVisible
(boolean _visible) Sets whether the UI object for this parameter is visible to the userprivate void
triggerLabelChanged
(String text, boolean isKey)
-
Field Details
-
configKey
-
labelKey
-
label
-
mode
private int mode -
enabled
-
visible
private boolean visible -
generate_intermediate_events
private boolean generate_intermediate_events -
toDisable
-
toEnable
-
change_listeners
-
impl_listeners
-
validator_listeners
-
parameter_group
-
indent
private int indent -
fancyIndent
private boolean fancyIndent -
refID
-
allowedUiTypes
-
-
Constructor Details
-
ParameterImpl
-
-
Method Details
-
getKey
Deprecated.(forRemoval=true) UsegetConfigKeyName()
-
addDisabledOnSelection
Description copied from interface:EnablerParameter
disables parameter when EnablerParameter is selected.- Specified by:
addDisabledOnSelection
in interfaceEnablerParameter
- Parameters:
parameter
- the Parameter to act on
-
addDisabledOnSelection
Description copied from interface:EnablerParameter
disables parameter when EnablerParameter is selected.- Specified by:
addDisabledOnSelection
in interfaceEnablerParameter
- Parameters:
parameters
- the Parameter to act on
-
addEnabledOnSelection
Description copied from interface:EnablerParameter
enables paramToEnable when this EnablerParameter is selected (checked).
paramToEnable is disabled when this EnablerParameter isn't selected (checked). Note: When this EnableParameter is disabled, paramToEnable's state will not be modified. In cases where parameter1 is enabled by its parent, and parameter1 enabled children, you must also parent.addEnabledOnSelection(children) if you want the children to be disabled when parent is unselected (unchecked).- Specified by:
addEnabledOnSelection
in interfaceEnablerParameter
- Parameters:
paramToEnable
- the Parameter to act on
-
addEnabledOnSelection
Description copied from interface:EnablerParameter
enables paramToEnable when this EnablerParameter is selected (checked).
paramToEnable is disabled when this EnablerParameter isn't selected (checked). Note: When this EnableParameter is disabled, parametersToDisable's state will not be modified. In cases where parameter1 is enabled by its parent, and parameter1 enabled children, you must also parent.addEnabledOnSelection(children) if you want the children to be disabled when parent is unselected (unchecked).- Specified by:
addEnabledOnSelection
in interfaceEnablerParameter
- Parameters:
parameters
- the Parameter to act on
-
getDisabledOnSelectionParameters
-
getEnabledOnSelectionParameters
-
parameterChanged
Description copied from interface:ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.- Specified by:
parameterChanged
in interfaceParameterListener
- Parameters:
key
- the name of the parameter that has changed
-
fireParameterChanged
public void fireParameterChanged() -
setEnabled
public void setEnabled(boolean e) Description copied from interface:Parameter
Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)- Specified by:
setEnabled
in interfaceParameter
- Parameters:
e
- The new enabled state
-
isEnabled
public boolean isEnabled()Description copied from interface:Parameter
Retrieves the enabled state for the UI object for this parameter -
getMinimumRequiredUserMode
public int getMinimumRequiredUserMode()Description copied from interface:Parameter
Gets the lowest user mode required for this parameter to be displayed.- Specified by:
getMinimumRequiredUserMode
in interfaceParameter
- Returns:
- MODE_ constants above
-
setMinimumRequiredUserMode
public void setMinimumRequiredUserMode(int _mode) Description copied from interface:Parameter
Sets the lowest user mode required for this parameter to be displayed.- Specified by:
setMinimumRequiredUserMode
in interfaceParameter
- Parameters:
_mode
- see MODE_ constants defined above
-
setVisible
public void setVisible(boolean _visible) Description copied from interface:Parameter
Sets whether the UI object for this parameter is visible to the user- Specified by:
setVisible
in interfaceParameter
- Parameters:
_visible
- The new visibility state
-
isVisible
public boolean isVisible()Description copied from interface:Parameter
Retrieves the visiblility state for the UI object for this parameter -
setGenerateIntermediateEvents
public void setGenerateIntermediateEvents(boolean b) Description copied from interface:Parameter
Controls whether or not 'parameter change' events are fired for each incremental value change- Specified by:
setGenerateIntermediateEvents
in interfaceParameter
- Parameters:
b
-
-
getGenerateIntermediateEvents
public boolean getGenerateIntermediateEvents()- Specified by:
getGenerateIntermediateEvents
in interfaceParameter
- Returns:
-
setGroup
-
getGroup
-
addListener
Description copied from interface:Parameter
Adds a listener triggered when the parameter is changed by the user- Specified by:
addListener
in interfaceParameter
- Parameters:
l
- Listener to add
-
addAndFireListener
- Specified by:
addAndFireListener
in interfaceParameter
-
removeListener
Description copied from interface:Parameter
Removes a previously added listener- Specified by:
removeListener
in interfaceParameter
- Parameters:
l
- Listener to remove.
-
addImplListener
-
removeImplListener
-
addConfigParameterListener
- Specified by:
addConfigParameterListener
in interfaceConfigParameter
-
removeConfigParameterListener
- Specified by:
removeConfigParameterListener
in interfaceConfigParameter
-
addValidator
Description copied from interface:Parameter
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.- Specified by:
addValidator
in interfaceParameter
-
validate
-
getLabelText
Description copied from interface:Parameter
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.- Specified by:
getLabelText
in interfaceParameter
- Returns:
- The label's text
-
setLabelText
Description copied from interface:Parameter
Set the text of the label associated to with this parameter to the literal text supplied.- Specified by:
setLabelText
in interfaceParameter
- Parameters:
sText
- The actual text to assign to the label
-
getLabelKey
Description copied from interface:Parameter
Retrieve the language bundle key for the label associated with this parameter.- Specified by:
getLabelKey
in interfaceParameter
- Returns:
- The language bundle key, or null if the label is using literal text
-
setLabelKey
Description copied from interface:Parameter
Set the label to use the supplied language bundle key for the label associated with this parameter- Specified by:
setLabelKey
in interfaceParameter
- Parameters:
sLabelKey
- The language bundle key to use.
-
getConfigKeyName
- Specified by:
getConfigKeyName
in interfaceParameter
-
hasBeenSet
public boolean hasBeenSet()Description copied from interface:Parameter
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 canParameter.addListener(ParameterListener)
orConfigParameter.addConfigParameterListener(ConfigParameterListener)
, and check if hasBeenSet is false.- Specified by:
hasBeenSet
in interfaceParameter
-
triggerLabelChanged
-
refreshControl
public void refreshControl() -
destroy
public void destroy() -
setIndent
public void setIndent(int indent, boolean fancy) -
getIndent
public int getIndent() -
isIndentFancy
public boolean isIndentFancy() -
setReferenceID
-
getReferenceID
-
setAllowedUiTypes
- Specified by:
setAllowedUiTypes
in interfaceParameter
-
isForUIType
- Specified by:
isForUIType
in interfaceParameter
-
resetToDefault
public boolean resetToDefault()Description copied from interface:Parameter
Resets the parameter to its default value- Specified by:
resetToDefault
in interfaceParameter
- Returns:
- true - value was reset; false - already reset
-
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
-
search
-
getConfigKeyName()