|
||||||||||
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
public abstract class AbstractOption
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 | |
---|---|
static java.lang.String |
NO_ID
|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
AbstractOption(java.lang.String id)
Creates a new AbstractOption . |
|
AbstractOption(java.lang.String id,
OptionGroup optionGroup)
Deprecated. |
Method Summary | |
---|---|
java.lang.String |
getGroup()
Returns the string prefix that identifies the group of this Option . |
java.lang.String |
getName()
Returns the name of this Option . |
java.lang.String |
getShortDescription()
Gives a short description of this Option . |
boolean |
isPreviewEnabled()
Should this option be updated directly so that changes may be previewes? |
void |
setGroup(java.lang.String group)
Set the option group |
void |
setPreviewEnabled(boolean previewEnabled)
Sets if this option should be updated directly. |
java.lang.String |
toString()
Returns a textual representation of this object. |
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 |
Field Detail |
---|
public static final java.lang.String NO_ID
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
.public AbstractOption(java.lang.String id, OptionGroup optionGroup)
AbstractOption
.
id
- The identifier for this option. This is used when the object
should be found in an OptionGroup
.optionGroup
- The OptionGroup this Option belongs to.Method Detail |
---|
public boolean isPreviewEnabled()
isPreviewEnabled
in interface Option
true
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 toString()
toString
in interface Option
toString
in class java.lang.Object
Option
.#getLocalizedName
public java.lang.String getGroup()
Option
.
public void setGroup(java.lang.String group)
group
- OptionGroup
to setpublic java.lang.String getName()
Option
.
getName
in interface Option
public java.lang.String getShortDescription()
Option
. Can for
instance be used as a tooltip text.
getShortDescription
in interface Option
Option
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |