APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.text.html

public Class Option

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, javax.swing.text.*

Value for the ListModel used to represent <option> elements. This is the object installed as items of the DefaultComboBoxModel used to represent the <select> element.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Timothy Prinzing

Field Summary

Modifier and TypeField and Description
private AttributeSet
private String
private boolean

Constructor Summary

AccessConstructor and Description
public
Option(AttributeSet
the attributes associated with the option element. The attributes are copied to ensure they won't change.
attr
)

Creates a new Option object.

Method Summary

Modifier and TypeMethod and Description
public AttributeSet

Returns:

the attributes associated with this option.
getAttributes
()

Fetch the attributes associated with this option.

public String

Returns:

the label associated with the option.
getLabel
()

Fetch the label associated with the option.

public String

Returns:

the string associated with the value attribute, or label if the value has been not specified.
getValue
()

Convenient method to return the string associated with the value attribute.

public boolean

Returns:

the selection state.
isSelected
()

Fetches the selection state associated with this option.

public void
setLabel(String
a label.
label
)

Sets the label to be used for the option.

protected void
setSelection(boolean
a selection state
state
)

Sets the selected state.

public String
toString()

Overrides java.lang.Object.toString.

String representation is the label.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attrback to summary
private AttributeSet attr
labelback to summary
private String label
selectedback to summary
private boolean selected

Constructor Detail

Optionback to summary
public Option(AttributeSet attr)

Creates a new Option object.

Parameters
attr:AttributeSet

the attributes associated with the option element. The attributes are copied to ensure they won't change.

Method Detail

getAttributesback to summary
public AttributeSet getAttributes()

Fetch the attributes associated with this option.

Returns:AttributeSet

the attributes associated with this option.

getLabelback to summary
public String getLabel()

Fetch the label associated with the option.

Returns:String

the label associated with the option.

getValueback to summary
public String getValue()

Convenient method to return the string associated with the value attribute. If the value has not been specified, the label will be returned.

Returns:String

the string associated with the value attribute, or label if the value has been not specified.

isSelectedback to summary
public boolean isSelected()

Fetches the selection state associated with this option.

Returns:boolean

the selection state.

setLabelback to summary
public void setLabel(String label)

Sets the label to be used for the option.

Parameters
label:String

a label.

setSelectionback to summary
protected void setSelection(boolean state)

Sets the selected state.

Parameters
state:boolean

a selection state

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

String representation is the label.