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 / metal / MetalFileChooserUI$DirectoryComboBoxRenderer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.5 KB  |  44 lines

  1. package javax.swing.plaf.metal;
  2.  
  3. import java.awt.Component;
  4. import java.io.File;
  5. import javax.swing.DefaultListCellRenderer;
  6. import javax.swing.Icon;
  7. import javax.swing.JLabel;
  8. import javax.swing.JList;
  9.  
  10. class MetalFileChooserUI$DirectoryComboBoxRenderer extends DefaultListCellRenderer {
  11.    // $FF: renamed from: ii javax.swing.plaf.metal.MetalFileChooserUI.IndentIcon
  12.    MetalFileChooserUI.IndentIcon field_0;
  13.    // $FF: synthetic field
  14.    private final MetalFileChooserUI this$0;
  15.  
  16.    MetalFileChooserUI$DirectoryComboBoxRenderer(MetalFileChooserUI var1) {
  17.       this.this$0 = var1;
  18.       this.field_0 = new MetalFileChooserUI.IndentIcon(this.this$0);
  19.    }
  20.  
  21.    public Component getListCellRendererComponent(JList var1, Object var2, int var3, boolean var4, boolean var5) {
  22.       super.getListCellRendererComponent(var1, var2, var3, var4, var5);
  23.       File var6 = (File)var2;
  24.       if (var6 == null) {
  25.          ((JLabel)this).setText("");
  26.          return this;
  27.       } else {
  28.          ((JLabel)this).setText(this.this$0.getFileChooser().getName(var6));
  29.          int var7 = 0;
  30.          if (var3 != -1) {
  31.             for(File var8 = var6; var8.getParent() != null; var8 = this.this$0.getFileChooser().getFileSystemView().createFileObject(var8.getParent())) {
  32.                ++var7;
  33.             }
  34.          }
  35.  
  36.          Icon var9 = this.this$0.getFileChooser().getIcon(var6);
  37.          this.field_0.icon = var9;
  38.          this.field_0.depth = var7;
  39.          ((JLabel)this).setIcon(this.field_0);
  40.          return this;
  41.       }
  42.    }
  43. }
  44.