|
|||||||||
| 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<T>
public abstract class AbstractOption<T>
The super class of all options. GUI components making use of this class can refer to its name and shortDescription properties. The complete keys of these properties consist of the id of the option group (if any), followed by a "." unless the option group is null, followed by the id of the option object, followed by a ".", followed by "name" or "shortDescription".
| Field Summary | |
|---|---|
protected boolean |
isDefined
|
private static java.util.logging.Logger |
logger
|
private java.lang.String |
optionGroup
|
protected boolean |
previewEnabled
|
| 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 | |
|---|---|
AbstractOption(java.lang.String id)
Creates a new AbstractOption. |
|
| Method Summary | |
|---|---|
java.lang.String |
getGroup()
Returns the string prefix that identifies the group of this Option. |
abstract T |
getValue()
Returns the value of this Option. |
boolean |
isPreviewEnabled()
Should this option be updated directly so that changes may be previewed? |
protected void |
readAttributes(javax.xml.stream.XMLStreamReader in)
Reads the attributes of this object from an XML stream. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setGroup(java.lang.String group)
Set the option group |
void |
setPreviewEnabled(boolean previewEnabled)
Sets if this option should be updated directly. |
protected void |
setValue(java.lang.String valueString,
java.lang.String defaultValueString)
Sets the value of this Option from the given string representation. |
abstract void |
setValue(T value)
Sets the value of this Option. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.freecol.common.option.Option |
|---|
addPropertyChangeListener, getId, readFromXML, readFromXMLElement, removePropertyChangeListener, toString, toXML, toXMLElement |
| Field Detail |
|---|
private static java.util.logging.Logger logger
private java.lang.String optionGroup
protected boolean isDefined
protected boolean previewEnabled
| Constructor Detail |
|---|
public AbstractOption(java.lang.String id)
AbstractOption.
id - The identifier for this option. This is used when the object
should be found in an OptionGroup.| Method Detail |
|---|
public boolean isPreviewEnabled()
isPreviewEnabled in interface Optiontrue if changes to this
option should be made directly (and reset
back later if the changes are not stored).public void setPreviewEnabled(boolean previewEnabled)
previewEnabled - true if changes
to this option should be made directly (and
reset back later if the changes are not stored).public java.lang.String getGroup()
Option.
public void setGroup(java.lang.String group)
group - OptionGroup to setpublic abstract T getValue()
public abstract void setValue(T value)
value - the value of this Option
protected void setValue(java.lang.String valueString,
java.lang.String defaultValueString)
valueString - the string representation of the value of
this OptiondefaultValueString - the string representation of the
default value of this Option
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readFromXMLImpl in class FreeColObjectin - The input stream with the XML.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readAttributes(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readAttributes in class FreeColObjectin - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||