com.realtime.crossfire.jxclient.settings.options
Class Option

java.lang.Object
  extended by com.realtime.crossfire.jxclient.settings.options.Option
Direct Known Subclasses:
CheckBoxOption

public abstract class Option
extends java.lang.Object

The base class for all options. It manages a set of OptionListeners.


Field Summary
private  javax.swing.event.EventListenerList listeners
          The listeners to be notified.
 
Constructor Summary
Option()
           
 
Method Summary
 void addOptionListener(OptionListener listener)
          Adds a listener for state changes.
protected  void fireStateChangedEvent()
          Notifies all listeners that the state has changed.
 boolean inhibitSave()
          Returns whether the option should not be saved.
 void removeOptionListener(OptionListener listener)
          Removes a listener for state changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

@NotNull
private final javax.swing.event.EventListenerList listeners
The listeners to be notified.

Constructor Detail

Option

public Option()
Method Detail

addOptionListener

public void addOptionListener(@NotNull
                              OptionListener listener)
Adds a listener for state changes.

Parameters:
listener - the listener to add

fireStateChangedEvent

protected void fireStateChangedEvent()
Notifies all listeners that the state has changed.


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

removeOptionListener

public void removeOptionListener(@NotNull
                                 OptionListener listener)
Removes a listener for state changes.

Parameters:
listener - the listener to remove