|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.option.AbstractOption<LanguageOption.Language>
net.sf.freecol.common.option.LanguageOption
public class LanguageOption
Option for selecting a language. The possible choices are determined using the available language files in "data/strings".
| Nested Class Summary | |
|---|---|
static class |
LanguageOption.Language
|
| Field Summary | |
|---|---|
static java.lang.String |
AUTO
|
private LanguageOption.Language |
DEFAULT
|
private static java.util.Comparator<LanguageOption.Language> |
languageComparator
|
private static java.util.Map<java.lang.String,java.lang.String> |
languageNames
|
private static java.util.Map<java.lang.String,LanguageOption.Language> |
languages
|
private static java.util.logging.Logger |
logger
|
private LanguageOption.Language |
value
|
| Fields inherited from class net.sf.freecol.common.option.AbstractOption |
|---|
isDefined |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
LanguageOption(Specification specification)
Creates a new LanguageOption. |
|
| Method Summary | |
|---|---|
LanguageOption |
clone()
|
private static void |
findLanguages()
Finds the languages available in the default directory. |
static java.util.Locale |
getLocale(java.lang.String languageID)
Returns the Locale decided by the given name. |
LanguageOption.Language[] |
getOptions()
Returns a list of the available languages. |
LanguageOption.Language |
getValue()
Get the Value value. |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
void |
setValue(LanguageOption.Language newValue)
Set the Value value. |
protected void |
setValue(java.lang.String valueString,
java.lang.String defaultValueString)
Sets the value of this Option from the given string representation. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the attributes of this object to a stream. |
| Methods inherited from class net.sf.freecol.common.option.AbstractOption |
|---|
generateChoices, getGroup, isNullValueOK, readAttributes, readFromXMLImpl, readOption, setGroup, setValues |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.freecol.common.option.Option |
|---|
getId, readFromXML, toString, toXML |
| Field Detail |
|---|
public static final java.lang.String AUTO
private static final java.util.logging.Logger logger
private static final java.util.Map<java.lang.String,LanguageOption.Language> languages
private static final java.util.Map<java.lang.String,java.lang.String> languageNames
private LanguageOption.Language DEFAULT
private LanguageOption.Language value
private static java.util.Comparator<LanguageOption.Language> languageComparator
| Constructor Detail |
|---|
public LanguageOption(Specification specification)
LanguageOption.
specification - The specification this option belongs
to. May be null.| Method Detail |
|---|
public LanguageOption clone()
throws java.lang.CloneNotSupportedException
clone in interface Option<LanguageOption.Language>clone in class AbstractOption<LanguageOption.Language>java.lang.CloneNotSupportedExceptionpublic final LanguageOption.Language getValue()
Value value.
getValue in interface Option<LanguageOption.Language>getValue in class AbstractOption<LanguageOption.Language>String valuepublic final void setValue(LanguageOption.Language newValue)
Value value.
setValue in interface Option<LanguageOption.Language>setValue in class AbstractOption<LanguageOption.Language>newValue - The new Value value.
protected void setValue(java.lang.String valueString,
java.lang.String defaultValueString)
setValue in class AbstractOption<LanguageOption.Language>valueString - the string representation of the value of
this OptiondefaultValueString - the string representation of the
default value of this Optionpublic LanguageOption.Language[] getOptions()
private static void findLanguages()
public static java.util.Locale getLocale(java.lang.String languageID)
Locale decided by the given name.
languageID - A String using the same format as
getValue().
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to
the stream.public static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||