1 6 21 22 package de.schlichtherle.io.swing; 23 24 import java.io.*; 25 import javax.swing.Icon ; 26 27 import javax.swing.filechooser.FileSystemView ; 28 29 44 abstract class AbstractFileSystemView extends FileSystemView { 45 46 49 private FileSystemView delegate; 50 51 56 protected AbstractFileSystemView(final FileSystemView delegate) { 57 if (delegate == null) 58 throw new NullPointerException (); 59 this.delegate = delegate; 60 } 61 62 66 public FileSystemView getDelegate() { 67 return delegate; 68 } 69 70 77 public void setDelegate(final FileSystemView delegate) { 78 if (delegate == null) 79 throw new NullPointerException (); 80 if (delegate == this) 81 throw new IllegalArgumentException (); 82 this.delegate = delegate; 83 } 84 85 89 public boolean isRoot(File f) { 90 return delegate.isRoot(f); 91 } 92 93 public Boolean isTraversable(File f) { 94 return delegate.isTraversable(f); 95 } 96 97 public String getSystemDisplayName(File f) { 98 return delegate.getSystemDisplayName(f); 99 } 100 101 public String getSystemTypeDescription(File f) { 102 return delegate.getSystemTypeDescription(f); 103 } 104 105 public Icon getSystemIcon(File f) { 106 return delegate.getSystemIcon(f); 107 } 108 109 public boolean isParent(File folder, File file) { 110 return delegate.isParent(folder, file); 111 } 112 113 public File getChild(File parent, String fileName) { 114 return delegate.getChild(parent, fileName); 115 } 116 117 public boolean isFileSystem(File f) { 118 return delegate.isFileSystem(f); 119 } 120 121 public File createNewFolder(File containingDir) throws IOException { 122 return delegate.createNewFolder(containingDir); 123 } 124 125 public boolean isHiddenFile(File f) { 126 return delegate.isHiddenFile(f); 127 } 128 129 public boolean isFileSystemRoot(File dir) { 130 return delegate.isFileSystemRoot(dir); 131 } 132 133 public boolean isDrive(File dir) { 134 return delegate.isDrive(dir); 135 } 136 137 public boolean isFloppyDrive(File dir) { 138 return delegate.isFloppyDrive(dir); 139 } 140 141 public boolean isComputerNode(File dir) { 142 return delegate.isComputerNode(dir); 143 } 144 145 public File[] getRoots() { 146 return delegate.getRoots(); 147 } 148 149 public File getHomeDirectory() { 150 return delegate.getHomeDirectory(); 151 } 152 153 public File getDefaultDirectory() { 154 return delegate.getDefaultDirectory(); 155 } 156 157 public File createFileObject(File dir, String filename) { 158 return delegate.createFileObject(dir, filename); 159 } 160 161 public File createFileObject(String path) { 162 return delegate.createFileObject(path); 163 } 164 165 public File[] getFiles(File dir, boolean useFileHiding) { 166 return delegate.getFiles(dir, useFileHiding); 167 } 168 169 public File getParentDirectory(File dir) { 170 return delegate.getParentDirectory(dir); 171 } 172 173 176 } 177 | Popular Tags |