org.crosswire.common.config.swing
Class MappedOptionsField

java.lang.Object
  extended by org.crosswire.common.config.swing.MappedOptionsField
All Implemented Interfaces:
Field

public class MappedOptionsField
extends Object
implements Field

Allow the user to choose from a combo box.

Author:
DM Smith
See Also:
The GNU General Public License for details.

Field Summary
private  JComboBox combo
          The component that we are wrapping in a field
private static org.slf4j.Logger log
          The log stream
 
Constructor Summary
MappedOptionsField()
          Create an empty MappedOptionsField
 
Method Summary
 JComponent getComponent()
          Get the actual component that we can add to a Panel.
 String getValue()
          Return a string for use in the properties file
 void setChoice(org.crosswire.common.config.Choice param)
          Some fields will need some extra info to display properly like the options in an options field.
 void setValue(String value)
          Set the current value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

combo

private JComboBox combo
The component that we are wrapping in a field


log

private static final org.slf4j.Logger log
The log stream

Constructor Detail

MappedOptionsField

public MappedOptionsField()
Create an empty MappedOptionsField

Method Detail

setChoice

public void setChoice(org.crosswire.common.config.Choice param)
Some fields will need some extra info to display properly like the options in an options field. FieldMap calls this method with options provided by the choice.

Specified by:
setChoice in interface Field
Parameters:
param - The options provided by the Choice

getValue

public String getValue()
Return a string for use in the properties file

Specified by:
getValue in interface Field
Returns:
The current value

setValue

public void setValue(String value)
Set the current value

Specified by:
setValue in interface Field
Parameters:
value - The new text

getComponent

public JComponent getComponent()
Get the actual component that we can add to a Panel. (This can well be this in an implementation).

Specified by:
getComponent in interface Field

Copyright ยจ 2003-2015