|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.option.AbstractOption
public abstract class AbstractOption
The super class of all options.
| Field Summary | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
LICENSE
|
static java.lang.String |
NO_ID
|
static java.lang.String |
REVISION
|
| Constructor Summary | |
|---|---|
AbstractOption(java.lang.String id,
java.lang.String name,
java.lang.String shortDescription)
Creates a new AbstractOption. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Adds a new PropertyChangeListener for monitoring state
changes. |
protected void |
firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a PropertyChangeEvent to all listeners. |
java.lang.String |
getId()
Returns the id of this Option. |
java.lang.String |
getName()
Returns the name of this Option. |
java.lang.String |
getShortDescription()
Gives a short description of this Option. |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
void |
readFromXML(javax.xml.stream.XMLStreamReader in)
Initializes this object from an XML-representation of this object. |
void |
readFromXMLElement(org.w3c.dom.Element element)
Initialize this object from an XML-representation of this object. |
protected abstract void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initializes this object from an XML-representation of this object. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Remove the given PropertyChangeListener. |
java.lang.String |
toString()
Returns a textual representation of this object. |
void |
toXML(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
org.w3c.dom.Element |
toXMLElement(org.w3c.dom.Document document)
This method writes an XML-representation of this object to the given stream. |
protected abstract void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
public static final java.lang.String NO_ID
| Constructor Detail |
|---|
public AbstractOption(java.lang.String id,
java.lang.String name,
java.lang.String shortDescription)
AbstractOption.
id - The identifier for this option. This is used when the object
should be found in an OptionGroup.name - The name of the AbstractOption. This text is
used for identifying the option for a user. Example: The text
related to a checkbox.shortDescription - Should give a short description of the
Option. This might be used as a tooltip text.| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
PropertyChangeListener for monitoring state
changes. Events are generated when variables are changed.
pcl - The PropertyChangeListener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
PropertyChangeListener.
pcl - The PropertyChangeListener to be removed.
protected void firePropertyChange(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
PropertyChangeEvent to all listeners.
name - The name of the changed variable.oldValue - The old value.newValue - The new value.public java.lang.String getShortDescription()
Option. Can for
instance be used as a tooltip text.
getShortDescription in interface OptionOption.public java.lang.String toString()
toString in interface OptiontoString in class java.lang.ObjectOption.getName()public java.lang.String getId()
Option.
getId in interface Optionpublic java.lang.String getName()
Option.
getName in interface Option
public void toXML(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXML in interface Optionout - The output stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
public void readFromXML(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readFromXML in interface Optionin - The input stream with the XML.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
protected abstract void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
out - The output stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
protected abstract void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
in - The input stream with the XML.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.public org.w3c.dom.Element toXMLElement(org.w3c.dom.Document document)
toXMLElement in interface Optiondocument - The Document.
public void readFromXMLElement(org.w3c.dom.Element element)
readFromXMLElement in interface Optionelement - The DOM-element ("Document Object Model") made to represent this "Option".public static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||