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 / JComboBox$AccessibleJComboBox.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.6 KB  |  99 lines

  1. package javax.swing;
  2.  
  3. import javax.accessibility.Accessible;
  4. import javax.accessibility.AccessibleAction;
  5. import javax.accessibility.AccessibleContext;
  6. import javax.accessibility.AccessibleRole;
  7. import javax.accessibility.AccessibleSelection;
  8. import javax.swing.plaf.basic.ComboPopup;
  9.  
  10. public class JComboBox$AccessibleJComboBox extends JComponent.AccessibleJComponent implements AccessibleAction, AccessibleSelection {
  11.    // $FF: synthetic field
  12.    private final JComboBox this$0;
  13.  
  14.    protected JComboBox$AccessibleJComboBox(JComboBox var1) {
  15.       super(var1);
  16.       this.this$0 = var1;
  17.    }
  18.  
  19.    public int getAccessibleChildrenCount() {
  20.       return this.this$0.ui != null ? this.this$0.ui.getAccessibleChildrenCount(this.this$0) : super.getAccessibleChildrenCount();
  21.    }
  22.  
  23.    public Accessible getAccessibleChild(int var1) {
  24.       return this.this$0.ui != null ? this.this$0.ui.getAccessibleChild(this.this$0, var1) : super.getAccessibleChild(var1);
  25.    }
  26.  
  27.    public AccessibleRole getAccessibleRole() {
  28.       return AccessibleRole.COMBO_BOX;
  29.    }
  30.  
  31.    public AccessibleAction getAccessibleAction() {
  32.       return this;
  33.    }
  34.  
  35.    public String getAccessibleActionDescription(int var1) {
  36.       return var1 == 0 ? new String("togglePopup") : null;
  37.    }
  38.  
  39.    public int getAccessibleActionCount() {
  40.       return 1;
  41.    }
  42.  
  43.    public boolean doAccessibleAction(int var1) {
  44.       if (var1 == 0) {
  45.          this.this$0.setPopupVisible(!this.this$0.isPopupVisible());
  46.          return true;
  47.       } else {
  48.          return false;
  49.       }
  50.    }
  51.  
  52.    public AccessibleSelection getAccessibleSelection() {
  53.       return this;
  54.    }
  55.  
  56.    public int getAccessibleSelectionCount() {
  57.       Object var1 = this.this$0.getSelectedItem();
  58.       return var1 != null ? 1 : 0;
  59.    }
  60.  
  61.    public Accessible getAccessibleSelection(int var1) {
  62.       Accessible var2 = this.this$0.getUI().getAccessibleChild(this.this$0, 0);
  63.       if (var2 != null && var2 instanceof ComboPopup) {
  64.          JList var3 = ((ComboPopup)var2).getList();
  65.          AccessibleContext var4 = var3.getAccessibleContext();
  66.          if (var4 != null) {
  67.             AccessibleSelection var5 = var4.getAccessibleSelection();
  68.             if (var5 != null) {
  69.                return var5.getAccessibleSelection(var1);
  70.             }
  71.          }
  72.       }
  73.  
  74.       return null;
  75.    }
  76.  
  77.    public boolean isAccessibleChildSelected(int var1) {
  78.       return this.this$0.getSelectedIndex() == var1;
  79.    }
  80.  
  81.    public void addAccessibleSelection(int var1) {
  82.       this.this$0.setSelectedIndex(var1);
  83.    }
  84.  
  85.    public void removeAccessibleSelection(int var1) {
  86.       if (this.this$0.getSelectedIndex() == var1) {
  87.          this.clearAccessibleSelection();
  88.       }
  89.  
  90.    }
  91.  
  92.    public void clearAccessibleSelection() {
  93.       this.this$0.setSelectedIndex(-1);
  94.    }
  95.  
  96.    public void selectAllAccessibleSelection() {
  97.    }
  98. }
  99.