21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package javax.swing.text.html;
26
27 import java.io.Serializable;
28 import javax.swing.text.*;
29
30 /**
31 * Value for the ListModel used to represent
32 * <option> elements. This is the object
33 * installed as items of the DefaultComboBoxModel
34 * used to represent the <select> element.
35 * <p>
36 * <strong>Warning:</strong>
37 * Serialized objects of this class will not be compatible with
38 * future Swing releases. The current serialization support is
39 * appropriate for short term storage or RMI between applications running
40 * the same version of Swing. As of 1.4, support for long term storage
41 * of all JavaBeans™
42 * has been added to the <code>java.beans</code> package.
43 * Please see {@link java.beans.XMLEncoder}.
44 *
45 * @author Timothy Prinzing
46 */
47 @SuppressWarnings("serial") // Same-version serialization only
48 public class Option implements Serializable {
49
50 /**
51 * Creates a new Option object.
52 *
53 * @param attr the attributes associated with the
54 * option element. The attributes are copied to
55 * ensure they won't change.
56 */
57 public Option(AttributeSet attr) {
58 this.attr = attr.copyAttributes();
59 selected = (attr.getAttribute(HTML.Attribute.SELECTED) != null);
60 }
61
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package javax.swing.text.html;
26
27 import java.io.Serializable;
28 import javax.swing.text.*;
29
30 /**
31 * Value for the ListModel used to represent
32 * <option> elements. This is the object
33 * installed as items of the DefaultComboBoxModel
34 * used to represent the <select> element.
35 * <p>
36 * <strong>Warning:</strong>
37 * Serialized objects of this class will not be compatible with
38 * future Swing releases. The current serialization support is
39 * appropriate for short term storage or RMI between applications running
40 * the same version of Swing. As of 1.4, support for long term storage
41 * of all JavaBeans
42 * has been added to the <code>java.beans</code> package.
43 * Please see {@link java.beans.XMLEncoder}.
44 *
45 * @author Timothy Prinzing
46 */
47 @SuppressWarnings("serial") // Same-version serialization only
48 public class Option implements Serializable {
49
50 /**
51 * Creates a new Option object.
52 *
53 * @param attr the attributes associated with the
54 * option element. The attributes are copied to
55 * ensure they won't change.
56 */
57 public Option(AttributeSet attr) {
58 this.attr = attr.copyAttributes();
59 selected = (attr.getAttribute(HTML.Attribute.SELECTED) != null);
60 }
61
|