Package com.biglybt.ui.swt.config
Class SwtConfigParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,VALUETYPE>
java.lang.Object
com.biglybt.ui.swt.config.SwtConfigParameterValueProcessor<PARAMTYPE,VALUETYPE>
- All Implemented Interfaces:
ParameterListener
,SwtParameterValueProcessor<PARAMTYPE,
VALUETYPE>
public class SwtConfigParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,VALUETYPE>
extends Object
implements SwtParameterValueProcessor<PARAMTYPE,VALUETYPE>, ParameterListener
A
SwtParameterValueProcessor
that stores/retrieves one setting from
COConfigurationManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private static final int
private final SwtParameter
private static final Class<?>[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SwtConfigParameterValueProcessor
(SwtParameter owner, String configID, Class<VALUETYPE> valueType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clean up after yourself, yoReturn the default value.Return the value for Parameter pboolean
Whether the Parameter is currently set to the default value.void
parameterChanged
(String parameterName) Called, when a parameter has changed.boolean
Reset key to default valueboolean
New value for Parameter p.
-
Field Details
-
CHANGINGCOUNT_BREAKER
private static final int CHANGINGCOUNT_BREAKER- See Also:
-
valueType
-
owner
-
changingCount
private int changingCount -
changedExternally
private boolean changedExternally -
VALID_CLASSES
-
-
Constructor Details
-
SwtConfigParameterValueProcessor
protected SwtConfigParameterValueProcessor(SwtParameter owner, String configID, Class<VALUETYPE> valueType)
-
-
Method Details
-
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:
parameterName
- the name of the parameter that has changed
-
getValue
Description copied from interface:SwtParameterValueProcessor
Return the value for Parameter p- Specified by:
getValue
in interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,
VALUETYPE>
-
setValue
Description copied from interface:SwtParameterValueProcessor
New value for Parameter p. Handle things like storing value.- Specified by:
setValue
in interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,
VALUETYPE> - Returns:
- Whether the value changed from stored value. Returning true will trigger change listeners, and typically refresh UI controls
-
isDefaultValue
Description copied from interface:SwtParameterValueProcessor
Whether the Parameter is currently set to the default value. This may be used to enable ui related to reseting value- Specified by:
isDefaultValue
in interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,
VALUETYPE>
-
getDefaultValue
Description copied from interface:SwtParameterValueProcessor
Return the default value.
This may be used to enable ui related to reseting value, or to show the default value to the user- Specified by:
getDefaultValue
in interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,
VALUETYPE>
-
resetToDefault
Description copied from interface:SwtParameterValueProcessor
Reset key to default value- Specified by:
resetToDefault
in interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,
VALUETYPE> - Returns:
- Whether the value was reset. Returning true will trigger change listeners, and typically refresh UI controls
-
dispose
Description copied from interface:SwtParameterValueProcessor
Clean up after yourself, yo- Specified by:
dispose
in interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,
VALUETYPE>
-