net.sf.freecol.client.gui.option
Class StringOptionUI

java.lang.Object
  extended by net.sf.freecol.client.gui.option.OptionUI<StringOption>
      extended by net.sf.freecol.client.gui.option.StringOptionUI
All Implemented Interfaces:
OptionUpdater

public final class StringOptionUI
extends OptionUI<StringOption>

This class provides visualization for an StringOption. In order to enable values to be both seen and changed.


Nested Class Summary
private  class StringOptionUI.ChoiceRenderer
           
 
Field Summary
private  javax.swing.JComboBox box
           
 
Fields inherited from class net.sf.freecol.client.gui.option.OptionUI
gui
 
Constructor Summary
StringOptionUI(GUI gui, StringOption option, boolean editable)
          Creates a new StringOptionUI for the given StringOption.
 
Method Summary
 javax.swing.JComboBox getComponent()
          Get the Component used to set the value of the Option.
 void reset()
          Reset the value of the UI's component from the Option.
 void updateOption()
          Update the value of the Option from the UI's component.
 
Methods inherited from class net.sf.freecol.client.gui.option.OptionUI
getLabel, getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setLabel, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

box

private javax.swing.JComboBox box
Constructor Detail

StringOptionUI

public StringOptionUI(GUI gui,
                      StringOption option,
                      boolean editable)
Creates a new StringOptionUI for the given StringOption.

Parameters:
option - The StringOption to make a user interface for
editable - boolean whether user can modify the setting
Method Detail

getComponent

public javax.swing.JComboBox getComponent()
Get the Component used to set the value of the Option.

Specified by:
getComponent in class OptionUI<StringOption>
Returns:
a JComponent value

updateOption

public void updateOption()
Update the value of the Option from the UI's component.

Specified by:
updateOption in interface OptionUpdater
Specified by:
updateOption in class OptionUI<StringOption>

reset

public void reset()
Reset the value of the UI's component from the Option.

Specified by:
reset in interface OptionUpdater
Specified by:
reset in class OptionUI<StringOption>