|
|||||||||
| 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 | |
|---|---|
protected boolean |
isDefined
|
private static java.util.logging.Logger |
logger
|
static java.lang.String |
NO_ID
|
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, PARTIAL_ATTRIBUTE |
| 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 |
|---|
clone, equals, finalize, 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
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.
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 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 toString()
toString in interface OptiontoString in class java.lang.ObjectOption.#getLocalizedNamepublic java.lang.String getGroup()
Option.
public void setGroup(java.lang.String group)
group - OptionGroup to setpublic java.lang.String getName()
Option.
getName in interface Optionpublic java.lang.String getShortDescription()
Option. Can for
instance be used as a tooltip text.
getShortDescription in interface OptionOption.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||