home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / text / html / Option.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.1 KB  |  49 lines

  1. package javax.swing.text.html;
  2.  
  3. import javax.swing.text.AttributeSet;
  4. import javax.swing.text.html.HTML.Attribute;
  5.  
  6. public class Option {
  7.    private boolean selected;
  8.    private String label;
  9.    private AttributeSet attr;
  10.  
  11.    public Option(AttributeSet var1) {
  12.       this.attr = var1.copyAttributes();
  13.       this.selected = var1.getAttribute(Attribute.SELECTED) != null;
  14.    }
  15.  
  16.    public void setLabel(String var1) {
  17.       this.label = var1;
  18.    }
  19.  
  20.    public String getLabel() {
  21.       return this.label;
  22.    }
  23.  
  24.    public AttributeSet getAttributes() {
  25.       return this.attr;
  26.    }
  27.  
  28.    public String toString() {
  29.       return this.label;
  30.    }
  31.  
  32.    protected void setSelection(boolean var1) {
  33.       this.selected = var1;
  34.    }
  35.  
  36.    public boolean isSelected() {
  37.       return this.selected;
  38.    }
  39.  
  40.    public String getValue() {
  41.       String var1 = (String)this.attr.getAttribute(Attribute.VALUE);
  42.       if (var1 == null) {
  43.          var1 = this.label;
  44.       }
  45.  
  46.       return var1;
  47.    }
  48. }
  49.