1 6 21 22 package de.schlichtherle.io.swing; 23 24 import java.io.*; 25 26 import javax.swing.*; 27 import javax.swing.filechooser.FileView ; 28 29 41 abstract class AbstractFileView extends FileView { 42 43 46 private FileView delegate; 47 48 53 protected AbstractFileView(final FileView delegate) { 54 this.delegate = delegate; 55 } 56 57 60 public FileView getDelegate() { 61 return delegate; 62 } 63 64 70 public void setDelegate(final FileView delegate) { 71 if (delegate == this) 72 throw new IllegalArgumentException (); 73 this.delegate = delegate; 74 } 75 76 public String getDescription(File f) { 77 return delegate != null ? delegate.getDescription(f) : null; 78 } 79 80 public Icon getIcon(File f) { 81 return delegate != null ? delegate.getIcon(f) : null; 82 } 83 84 public String getName(File f) { 85 return delegate != null ? delegate.getName(f) : null; 86 } 87 88 public String getTypeDescription(File f) { 89 return delegate != null ? delegate.getTypeDescription(f) : null; 90 } 91 92 public Boolean isTraversable(File f) { 93 return delegate != null ? delegate.isTraversable(f) : null; 94 } 95 } 96 | Popular Tags |