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 booleanprivate intprivate static final intprivate final SwtParameterprivate static final Class<?>[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSwtConfigParameterValueProcessor(SwtParameter owner, String configID, Class<VALUETYPE> valueType) -
Method Summary
Modifier and TypeMethodDescriptionvoidClean up after yourself, yoReturn the default value.Return the value for Parameter pbooleanWhether the Parameter is currently set to the default value.voidparameterChanged(String parameterName) Called, when a parameter has changed.booleanReset key to default valuebooleanNew 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: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:
parameterName- the name of the parameter that has changed
-
getValue
Description copied from interface:SwtParameterValueProcessorReturn the value for Parameter p- Specified by:
getValuein interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>, VALUETYPE>
-
setValue
Description copied from interface:SwtParameterValueProcessorNew value for Parameter p. Handle things like storing value.- Specified by:
setValuein 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:SwtParameterValueProcessorWhether the Parameter is currently set to the default value. This may be used to enable ui related to reseting value- Specified by:
isDefaultValuein interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>, VALUETYPE>
-
getDefaultValue
Description copied from interface:SwtParameterValueProcessorReturn 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:
getDefaultValuein interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>, VALUETYPE>
-
resetToDefault
Description copied from interface:SwtParameterValueProcessorReset key to default value- Specified by:
resetToDefaultin 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:SwtParameterValueProcessorClean up after yourself, yo- Specified by:
disposein interfaceSwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>, VALUETYPE>
-