org.crosswire.common.config
Class IntOptionsChoice

java.lang.Object
  extended by org.crosswire.common.config.AbstractReflectedChoice
      extended by org.crosswire.common.config.IntOptionsChoice
All Implemented Interfaces:
Choice, MultipleChoice

public class IntOptionsChoice
extends AbstractReflectedChoice
implements MultipleChoice

A class to convert between strings and objects of a type.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: IntOptionsChoice.java,v 1.7 2005/03/19 18:45:07 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private  String[] options
           
 
Fields inherited from interface org.crosswire.common.config.Choice
PRIORITY_ACCESSOR, PRIORITY_CTOR, PRIORITY_EXTENDER, PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_NORMAL, PRIORITY_SYSTEM
 
Constructor Summary
IntOptionsChoice()
           
 
Method Summary
 Object convertToObject(String orig)
          Convert from a stored string to an object to use with relfection
 String convertToString(Object orig)
          Convert from a reflection return value to a String for storage
 Class getConvertionClass()
          The class that this Choice works on.
 String[] getOptions()
          The available alternative values to be presented as options to the user where the user interface allows presentation of alternatives.
 void init(org.jdom.Element option, ResourceBundle configResources)
          String value to associate with the name (key)
 
Methods inherited from class org.crosswire.common.config.AbstractReflectedChoice
getFullPath, getHelpText, getPriority, getString, getType, isSaveable, requiresRestart, setFullPath, setHelpText, setPriority, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.crosswire.common.config.Choice
getFullPath, getHelpText, getPriority, getString, getType, isSaveable, requiresRestart, setFullPath, setHelpText, setString
 

Field Detail

options

private String[] options
Constructor Detail

IntOptionsChoice

public IntOptionsChoice()
Method Detail

init

public void init(org.jdom.Element option,
                 ResourceBundle configResources)
          throws StartupException
Description copied from interface: Choice
String value to associate with the name (key)

Specified by:
init in interface Choice
Overrides:
init in class AbstractReflectedChoice
Throws:
StartupException

getOptions

public String[] getOptions()
Description copied from interface: MultipleChoice
The available alternative values to be presented as options to the user where the user interface allows presentation of alternatives.

Specified by:
getOptions in interface MultipleChoice
Returns:
A string array of alternatives.

getConvertionClass

public Class getConvertionClass()
Description copied from interface: Choice
The class that this Choice works on. Used to decide how to display the choice to the user.

Specified by:
getConvertionClass in interface Choice
Returns:
The Class that this Choice works using.

convertToString

public String convertToString(Object orig)
Description copied from class: AbstractReflectedChoice
Convert from a reflection return value to a String for storage

Specified by:
convertToString in class AbstractReflectedChoice

convertToObject

public Object convertToObject(String orig)
Description copied from class: AbstractReflectedChoice
Convert from a stored string to an object to use with relfection

Specified by:
convertToObject in class AbstractReflectedChoice

Copyright ? 2003-2004