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, DateTimeParameterImpl, DirectoryParameterImpl, FileParameterImpl, FloatParameterImpl, HyperlinkParameterImpl, InfoParameterImpl, IntListParameterImpl, IntParameterImpl, LabelParameterImpl, LongParameterImpl, ParameterGroupImpl, ParameterTabFolderImpl, PasswordParameterImpl, StringListParameterImpl, StringParameterImpl, UIParameterImpl, UITextAreaImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]private Listprotected final Stringprivate Booleanprivate booleanprivate booleanprivate List<ParameterImplListener> private intprivate Stringprivate Stringprivate intprivate ParameterGroupImplprivate Stringprivate List<ParameterValidator> private booleanFields inherited from interface Parameter
MODE_ADVANCED, MODE_BEGINNER, MODE_INTERMEDIATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddDisabledOnSelection(Parameter parameter) disables parameter when EnablerParameter is selected.voidaddDisabledOnSelection(Parameter... parameters) disables parameter when EnablerParameter is selected.voidaddEnabledOnSelection(Parameter paramToEnable) enables paramToEnable when this EnablerParameter is selected (checked).
paramToEnable is disabled when this EnablerParameter isn't selected (checked).voidaddEnabledOnSelection(Parameter... parameters) enables paramToEnable when this EnablerParameter is selected (checked).
paramToEnable is disabled when this EnablerParameter isn't selected (checked).voidvoidAdds a listener triggered when the parameter is changed by the uservoidaddValidator(ParameterValidator validator) Adds a validator to this parameter.voiddestroy()voidfinal StringbooleangetGroup()intgetKey()Deprecated.Retrieve the language bundle key for the label associated with this parameter.Retrieve the actual text of the label associated with this parameter.intGets the lowest user mode required for this parameter to be displayed.Retrieve the parameter's value as an Object.booleanIndicates if a value has been set for the parameter.booleanRetrieves the enabled state for the UI object for this parameterbooleanisForUIType(String uiType) booleanbooleanRetrieves the visiblility state for the UI object for this parametervoidparameterChanged(String key) Called, when a parameter has changed.voidvoidvoidvoidRemoves a previously added listenerbooleanResets the parameter to its default valuebooleanvoidsetAllowedUiTypes(String... uiTypes) voidsetEnabled(boolean e) Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)voidsetGenerateIntermediateEvents(boolean b) Controls whether or not 'parameter change' events are fired for each incremental value changevoidsetGroup(ParameterGroupImpl _group) voidsetIndent(int indent, boolean fancy) voidsetLabelKey(String sLabelKey) Set the label to use the supplied language bundle key for the label associated with this parametervoidsetLabelText(String sText) Set the text of the label associated to with this parameter to the literal text supplied.voidsetMinimumRequiredUserMode(int _mode) Sets the lowest user mode required for this parameter to be displayed.voidsetReferenceID(String refID) voidsetVisible(boolean _visible) Sets whether the UI object for this parameter is visible to the userprivate voidtriggerLabelChanged(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:EnablerParameterdisables parameter when EnablerParameter is selected.- Specified by:
addDisabledOnSelectionin interfaceEnablerParameter- Parameters:
parameter- the Parameter to act on
-
addDisabledOnSelection
Description copied from interface:EnablerParameterdisables parameter when EnablerParameter is selected.- Specified by:
addDisabledOnSelectionin interfaceEnablerParameter- Parameters:
parameters- the Parameter to act on
-
addEnabledOnSelection
Description copied from interface:EnablerParameterenables 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:
addEnabledOnSelectionin interfaceEnablerParameter- Parameters:
paramToEnable- the Parameter to act on
-
addEnabledOnSelection
Description copied from interface:EnablerParameterenables 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:
addEnabledOnSelectionin interfaceEnablerParameter- Parameters:
parameters- the Parameter to act on
-
getDisabledOnSelectionParameters
-
getEnabledOnSelectionParameters
-
parameterChanged
Description copied from interface:ParameterListenerCalled, 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:
parameterChangedin 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:ParameterSets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)- Specified by:
setEnabledin interfaceParameter- Parameters:
e- The new enabled state
-
isEnabled
-
getMinimumRequiredUserMode
public int getMinimumRequiredUserMode()Description copied from interface:ParameterGets the lowest user mode required for this parameter to be displayed.- Specified by:
getMinimumRequiredUserModein interfaceParameter- Returns:
- MODE_ constants above
-
setMinimumRequiredUserMode
public void setMinimumRequiredUserMode(int _mode) Description copied from interface:ParameterSets the lowest user mode required for this parameter to be displayed.- Specified by:
setMinimumRequiredUserModein interfaceParameter- Parameters:
_mode- see MODE_ constants defined above
-
setVisible
public void setVisible(boolean _visible) Description copied from interface:ParameterSets whether the UI object for this parameter is visible to the user- Specified by:
setVisiblein interfaceParameter- Parameters:
_visible- The new visibility state
-
isVisible
-
setGenerateIntermediateEvents
public void setGenerateIntermediateEvents(boolean b) Description copied from interface:ParameterControls whether or not 'parameter change' events are fired for each incremental value change- Specified by:
setGenerateIntermediateEventsin interfaceParameter- Parameters:
b-
-
getGenerateIntermediateEvents
public boolean getGenerateIntermediateEvents()- Specified by:
getGenerateIntermediateEventsin interfaceParameter- Returns:
-
setGroup
-
getGroup
-
addListener
Description copied from interface:ParameterAdds a listener triggered when the parameter is changed by the user- Specified by:
addListenerin interfaceParameter- Parameters:
l- Listener to add
-
addAndFireListener
- Specified by:
addAndFireListenerin interfaceParameter
-
removeListener
Description copied from interface:ParameterRemoves a previously added listener- Specified by:
removeListenerin interfaceParameter- Parameters:
l- Listener to remove.
-
addImplListener
-
removeImplListener
-
addConfigParameterListener
- Specified by:
addConfigParameterListenerin interfaceConfigParameter
-
removeConfigParameterListener
- Specified by:
removeConfigParameterListenerin interfaceConfigParameter
-
addValidator
Description copied from interface:ParameterAdds 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:
addValidatorin interfaceParameter
-
validate
-
getLabelText
Description copied from interface:ParameterRetrieve 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:
getLabelTextin interfaceParameter- Returns:
- The label's text
-
setLabelText
Description copied from interface:ParameterSet the text of the label associated to with this parameter to the literal text supplied.- Specified by:
setLabelTextin interfaceParameter- Parameters:
sText- The actual text to assign to the label
-
getLabelKey
Description copied from interface:ParameterRetrieve the language bundle key for the label associated with this parameter.- Specified by:
getLabelKeyin interfaceParameter- Returns:
- The language bundle key, or null if the label is using literal text
-
setLabelKey
Description copied from interface:ParameterSet the label to use the supplied language bundle key for the label associated with this parameter- Specified by:
setLabelKeyin interfaceParameter- Parameters:
sLabelKey- The language bundle key to use.
-
getConfigKeyName
- Specified by:
getConfigKeyNamein interfaceParameter
-
hasBeenSet
public boolean hasBeenSet()Description copied from interface:ParameterIndicates 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:
hasBeenSetin interfaceParameter
-
triggerLabelChanged
-
refreshControl
public void refreshControl() -
destroy
public void destroy() -
setIndent
-
getIndent
public int getIndent() -
isIndentFancy
public boolean isIndentFancy() -
setReferenceID
-
getReferenceID
-
setAllowedUiTypes
- Specified by:
setAllowedUiTypesin interfaceParameter
-
isForUIType
- Specified by:
isForUITypein interfaceParameter
-
resetToDefault
public boolean resetToDefault()Description copied from interface:ParameterResets the parameter to its default value- Specified by:
resetToDefaultin interfaceParameter- Returns:
- true - value was reset; false - already reset
-
getValueObject
Description copied from interface:ParameterRetrieve the parameter's value as an Object. Subclasses will usually have a getValue() that will return a specific type.- Specified by:
getValueObjectin interfaceParameter
-
search
-
getConfigKeyName()