Class Option
java.lang.Object
com.realtime.crossfire.jxclient.settings.options.Option
- Direct Known Subclasses:
CheckBoxOption
The base class for all options. It manages a set of
OptionListeners.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOptionListener(@NotNull OptionListener listener) Adds a listener for state changes.protected voidNotifies all listeners that the state has changed.booleanReturns whether the option should not be saved.voidremoveOptionListener(@NotNull OptionListener listener) Removes a listener for state changes.
-
Constructor Details
-
Option
public Option()
-
-
Method Details
-
fireStateChangedEvent
protected void fireStateChangedEvent()Notifies all listeners that the state has changed. -
addOptionListener
Adds a listener for state changes.- Parameters:
listener- the listener to add
-
removeOptionListener
Removes a listener for state changes.- Parameters:
listener- the listener to remove
-
inhibitSave
public boolean inhibitSave()Returns whether the option should not be saved. This function can be overridden for options that are otherwise saved, or for options that should not be saved at all.- Returns:
- whether the option value should not be saved
-