Class Option
- java.lang.Object
-
- com.realtime.crossfire.jxclient.settings.options.Option
-
- Direct Known Subclasses:
CheckBoxOption
public abstract class Option extends java.lang.ObjectThe base class for all options. It manages a set ofOptionListeners.
-
-
Constructor Summary
Constructors Constructor Description Option()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOptionListener(@NotNull OptionListener listener)Adds a listener for state changes.protected voidfireStateChangedEvent()Notifies all listeners that the state has changed.booleaninhibitSave()Returns whether the option should not be saved.voidremoveOptionListener(@NotNull OptionListener listener)Removes a listener for state changes.
-
-
-
Method Detail
-
fireStateChangedEvent
protected void fireStateChangedEvent()
Notifies all listeners that the state has changed.
-
addOptionListener
public void addOptionListener(@NotNull @NotNull OptionListener listener)Adds a listener for state changes.- Parameters:
listener- the listener to add
-
removeOptionListener
public void removeOptionListener(@NotNull @NotNull OptionListener listener)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
-
-