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

java.lang.Object
  extended by com.realtime.crossfire.jxclient.settings.options.Option
      extended by com.realtime.crossfire.jxclient.settings.options.CheckBoxOption
          extended by com.realtime.crossfire.jxclient.settings.options.PickupOption

public class PickupOption
extends CheckBoxOption

A CheckBoxOption that toggles a pickup setting.


Field Summary
private  long option
          The affected pickup mode.
private  Pickup pickup
          The pickup instance for modifying the pickup mode.
 
Constructor Summary
PickupOption(Pickup pickup, long option, java.lang.String tooltipText)
          Creates a new instance.
 
Method Summary
protected  void execute(boolean checked)
          Execute the action associated with this check box option.
 boolean inhibitSave()
          Returns whether the option should not be saved.
 boolean isDefaultChecked()
          Return the default value of CheckBoxOption.isChecked().
 void setPickupMode(long pickupMode)
          Notifies this instance that the pickup mode has changed.
 
Methods inherited from class com.realtime.crossfire.jxclient.settings.options.CheckBoxOption
fireStateChangedEvent, getTooltipText, isChecked, setChecked, toggleChecked
 
Methods inherited from class com.realtime.crossfire.jxclient.settings.options.Option
addOptionListener, removeOptionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

option

private final long option
The affected pickup mode.


pickup

@NotNull
private final Pickup pickup
The pickup instance for modifying the pickup mode.

Constructor Detail

PickupOption

public PickupOption(@NotNull
                    Pickup pickup,
                    long option,
                    @NotNull
                    java.lang.String tooltipText)
Creates a new instance.

Parameters:
pickup - the pickup instance for modifying the pickup mode
option - the affected pickup mode
tooltipText - the tooltip text to explain this option
Method Detail

execute

protected void execute(boolean checked)
Execute the action associated with this check box option. Must be implemented in sub-classes.

Specified by:
execute in class CheckBoxOption
Parameters:
checked - whether the check box option is checked

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.

Overrides:
inhibitSave in class Option
Returns:
whether the option value should not be saved

isDefaultChecked

public boolean isDefaultChecked()
Return the default value of CheckBoxOption.isChecked().

Specified by:
isDefaultChecked in class CheckBoxOption
Returns:
The default value.

setPickupMode

public void setPickupMode(long pickupMode)
Notifies this instance that the pickup mode has changed.

Parameters:
pickupMode - the new pickup mode