Package net.sf.freecol.client.gui.option
Class StringOptionUI
- java.lang.Object
-
- net.sf.freecol.client.gui.option.OptionUI<StringOption>
-
- net.sf.freecol.client.gui.option.StringOptionUI
-
- All Implemented Interfaces:
OptionUpdater
public final class StringOptionUI extends OptionUI<StringOption>
This class provides visualization for aStringOptionin order to enable values to be both seen and changed.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JComboBox<java.lang.String>box
-
Constructor Summary
Constructors Constructor Description StringOptionUI(StringOption option, boolean editable)Creates a newStringOptionUIfor the givenStringOption.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JComboBox<java.lang.String>getComponent()Get theComponentused to set the value of the Option.voidreset()Reset the value of the UI's component from the Option.voidupdateOption()Update the value of the Option from the UI's component.-
Methods inherited from class net.sf.freecol.client.gui.option.OptionUI
getJLabel, getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setEnabler, setLabel, setOption
-
-
-
-
Constructor Detail
-
StringOptionUI
public StringOptionUI(StringOption option, boolean editable)
Creates a newStringOptionUIfor the givenStringOption.- Parameters:
option- TheStringOptionto make a user interface for.editable- Whether user can modify the setting.
-
-
Method Detail
-
getComponent
public javax.swing.JComboBox<java.lang.String> getComponent()
Get theComponentused to set the value of the Option.- Specified by:
getComponentin classOptionUI<StringOption>- Returns:
- a
JComponentvalue
-
updateOption
public void updateOption()
Update the value of the Option from the UI's component.- Specified by:
updateOptionin interfaceOptionUpdater- Specified by:
updateOptionin classOptionUI<StringOption>
-
reset
public void reset()
Reset the value of the UI's component from the Option.- Specified by:
resetin interfaceOptionUpdater- Specified by:
resetin classOptionUI<StringOption>
-
-