|
||||||||||
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
net.sf.freecol.common.option.SelectOption
public class SelectOption
Represents an option where the valid choice is an integer and the choices are represented by strings. In general, these strings are localized by looking up the key of the choice, which consists of the id of the AbstractObject followed by a "." followed by the value of the option string. The automatic localization can be suppressed with the doNotLocalize parameter, however. There are two reasons to do this: either the option strings should not be localized at all (because they are language names, for example), or the option strings have already been localized (because they do not use the default keys, for example).
Field Summary |
---|
Fields inherited from class net.sf.freecol.common.option.AbstractOption |
---|
NO_ID |
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
SelectOption(javax.xml.stream.XMLStreamReader in)
Creates a new SelectOption . |
Method Summary | |
---|---|
java.util.Map<java.lang.Integer,java.lang.String> |
getItemValues()
Gets the range values of this RangeOption . |
int |
getValue()
Gets the current value of this SelectOption . |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
java.lang.String |
getXMLItemElementTagName()
Gets the tag name of the item element This method is not static to ensure proper overriding in readFromXMLImpl . |
void |
setValue(int value)
Sets the value of this SelectOption . |
Methods inherited from class net.sf.freecol.common.option.AbstractOption |
---|
getGroup, getName, getShortDescription, isPreviewEnabled, setGroup, setPreviewEnabled, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.freecol.common.option.Option |
---|
addPropertyChangeListener, getId, readFromXML, readFromXMLElement, removePropertyChangeListener, toXML, toXMLElement |
Constructor Detail |
---|
public SelectOption(javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
SelectOption
.
in
- The XMSStreamReader
to read the data from
javax.xml.stream.XMLStreamException
Method Detail |
---|
public int getValue()
SelectOption
.
public void setValue(int value)
SelectOption
.
value
- The value to be set.public java.util.Map<java.lang.Integer,java.lang.String> getItemValues()
RangeOption
.
public static java.lang.String getXMLElementTagName()
public java.lang.String getXMLItemElementTagName()
readFromXMLImpl
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |