home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 144 / DPCS0200.iso / Internet / Supanet / system / swing.jar / javax / swing / plaf / metal / MetalFileChooserUI$3.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-05  |  3.4 KB  |  67 lines

  1. package javax.swing.plaf.metal;
  2.  
  3. import java.beans.PropertyChangeEvent;
  4. import java.beans.PropertyChangeListener;
  5. import java.io.File;
  6. import javax.swing.JComponent;
  7. import javax.swing.JFileChooser;
  8. import javax.swing.plaf.metal.MetalFileChooserUI.DirectoryComboBoxModel;
  9.  
  10. final class MetalFileChooserUI$3 implements PropertyChangeListener {
  11.    // $FF: synthetic field
  12.    private final MetalFileChooserUI this$0;
  13.  
  14.    // $FF: synthetic method
  15.    MetalFileChooserUI$3(MetalFileChooserUI var1) {
  16.       this.this$0 = var1;
  17.    }
  18.  
  19.    public void propertyChange(PropertyChangeEvent var1) {
  20.       String var2 = var1.getPropertyName();
  21.       if (var2.equals("SelectedFileChangedProperty")) {
  22.          MetalFileChooserUI.access$0(this.this$0);
  23.          File var3 = (File)var1.getNewValue();
  24.          if (var3 != null) {
  25.             this.this$0.setFileName(this.this$0.getFileChooser().getName(var3));
  26.             if (this.this$0.getModel().contains(var3)) {
  27.                MetalFileChooserUI.access$1(this.this$0).setSelectedIndex(this.this$0.getModel().indexOf(var1.getNewValue()));
  28.                MetalFileChooserUI.access$1(this.this$0).ensureIndexIsVisible(MetalFileChooserUI.access$1(this.this$0).getSelectedIndex());
  29.             }
  30.          }
  31.       } else if (var2.equals("directoryChanged")) {
  32.          MetalFileChooserUI.access$0(this.this$0);
  33.          this.this$0.clearIconCache();
  34.          MetalFileChooserUI.access$1(this.this$0).clearSelection();
  35.          File var4 = this.this$0.getFileChooser().getCurrentDirectory();
  36.          if (var4 != null) {
  37.             DirectoryComboBoxModel.access$0(MetalFileChooserUI.access$2(this.this$0), var4);
  38.             this.this$0.getNewFolderAction().setEnabled(var4.canWrite());
  39.          }
  40.       } else if (var2.equals("fileSelectionChanged")) {
  41.          this.this$0.clearIconCache();
  42.          MetalFileChooserUI.access$1(this.this$0).clearSelection();
  43.       } else if (var2 == "AccessoryChangedProperty") {
  44.          if (this.this$0.getAccessoryPanel() != null) {
  45.             if (var1.getOldValue() != null) {
  46.                this.this$0.getAccessoryPanel().remove((JComponent)var1.getOldValue());
  47.             }
  48.  
  49.             JComponent var5 = (JComponent)var1.getNewValue();
  50.             if (var5 != null) {
  51.                this.this$0.getAccessoryPanel().add(var5, "Center");
  52.             }
  53.          }
  54.       } else if (var2 != "ApproveButtonTextChangedProperty" && var2 != "DialogTypeChangedProperty") {
  55.          if (var2.equals("ApproveButtonMnemonicChangedProperty")) {
  56.             MetalFileChooserUI.access$3(this.this$0).setMnemonic(this.this$0.getApproveButtonMnemonic(this.this$0.getFileChooser()));
  57.          }
  58.       } else {
  59.          JFileChooser var6 = this.this$0.getFileChooser();
  60.          MetalFileChooserUI.access$3(this.this$0).setText(this.this$0.getApproveButtonText(var6));
  61.          MetalFileChooserUI.access$3(this.this$0).setToolTipText(this.this$0.getApproveButtonToolTipText(var6));
  62.          MetalFileChooserUI.access$3(this.this$0).setMnemonic(this.this$0.getApproveButtonMnemonic(var6));
  63.       }
  64.  
  65.    }
  66. }
  67.