Package net.sf.freecol.client.gui.option
Class SelectOptionUI
- java.lang.Object
-
- net.sf.freecol.client.gui.option.OptionUI<SelectOption>
-
- net.sf.freecol.client.gui.option.SelectOptionUI
-
- All Implemented Interfaces:
OptionUpdater
public final class SelectOptionUI extends OptionUI<SelectOption>
This class provides visualization for aSelectOption
in 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 SelectOptionUI(SelectOption option, boolean editable)
Creates a newSelectOptionUI
for the givenSelectOption
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JComponent
getComponent()
Get theComponent
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
getJLabel, getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setEnabler, setLabel, setOption
-
-
-
-
Constructor Detail
-
SelectOptionUI
public SelectOptionUI(SelectOption option, boolean editable)
Creates a newSelectOptionUI
for the givenSelectOption
.- Parameters:
option
- TheSelectOption
to make a user interface for.editable
- Whether user can modify the setting.
-
-
Method Detail
-
getComponent
public javax.swing.JComponent getComponent()
Get theComponent
used to set the value of the Option.- Specified by:
getComponent
in classOptionUI<SelectOption>
- Returns:
- a
JComponent
value
-
updateOption
public void updateOption()
Update the value of the Option from the UI's component.- Specified by:
updateOption
in interfaceOptionUpdater
- Specified by:
updateOption
in classOptionUI<SelectOption>
-
reset
public void reset()
Reset the value of the UI's component from the Option.- Specified by:
reset
in interfaceOptionUpdater
- Specified by:
reset
in classOptionUI<SelectOption>
-
-