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 / plaf / basic / BasicComboPopup$PropertyChangeHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.2 KB  |  61 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Component;
  4. import java.awt.ComponentOrientation;
  5. import java.beans.PropertyChangeEvent;
  6. import java.beans.PropertyChangeListener;
  7. import javax.swing.ComboBoxModel;
  8. import javax.swing.JList;
  9.  
  10. public class BasicComboPopup$PropertyChangeHandler implements PropertyChangeListener {
  11.    // $FF: synthetic field
  12.    private final BasicComboPopup this$0;
  13.  
  14.    protected BasicComboPopup$PropertyChangeHandler(BasicComboPopup var1) {
  15.       this.this$0 = var1;
  16.    }
  17.  
  18.    public void propertyChange(PropertyChangeEvent var1) {
  19.       String var2 = var1.getPropertyName();
  20.       if (var2.equals("model")) {
  21.          this.this$0.uninstallComboBoxModelListeners((ComboBoxModel)var1.getOldValue());
  22.          this.this$0.list.setModel((ComboBoxModel)var1.getNewValue());
  23.          this.this$0.installComboBoxModelListeners((ComboBoxModel)var1.getNewValue());
  24.          if (this.this$0.comboBox.getItemCount() > 0) {
  25.             this.this$0.comboBox.setSelectedIndex(0);
  26.          }
  27.  
  28.          if (this.this$0.isVisible()) {
  29.             this.this$0.hide();
  30.          }
  31.       } else if (var2.equals("renderer")) {
  32.          this.this$0.list.setCellRenderer(this.this$0.comboBox.getRenderer());
  33.          if (this.this$0.isVisible()) {
  34.             this.this$0.hide();
  35.          }
  36.       } else if (var2.equals("JComboBox.lightweightKeyboardNavigation")) {
  37.          Object var3 = var1.getNewValue();
  38.          if (var3.equals("Lightweight")) {
  39.             BasicComboPopup.access$002(this.this$0, true);
  40.          } else if (var3.equals("Heavyweight")) {
  41.             BasicComboPopup.access$002(this.this$0, false);
  42.          }
  43.       } else if (var2.equals("componentOrientation")) {
  44.          ComponentOrientation var5 = (ComponentOrientation)var1.getNewValue();
  45.          JList var4 = this.this$0.getList();
  46.          if (var4 != null && ((Component)var4).getComponentOrientation() != var5) {
  47.             ((Component)var4).setComponentOrientation(var5);
  48.          }
  49.  
  50.          if (this.this$0.scroller != null && this.this$0.scroller.getComponentOrientation() != var5) {
  51.             this.this$0.scroller.setComponentOrientation(var5);
  52.          }
  53.  
  54.          if (var5 != this.this$0.getComponentOrientation()) {
  55.             this.this$0.setComponentOrientation(var5);
  56.          }
  57.       }
  58.  
  59.    }
  60. }
  61.