10 package com.generalrobotix.ui.view.tdview;
44 import java.util.Hashtable;
45 import java.util.Enumeration;
46 import javax.swing.filechooser.*;
84 this.filters =
new Hashtable<String, ExampleFileFilter>();
135 for (
int i = 0;
i < filters.length;
i++) {
153 if(f.isDirectory()) {
173 int i = filename.lastIndexOf(
'.');
174 if(i>0 && i<filename.length()-1) {
175 return filename.substring(i+1).toLowerCase();
194 if(filters ==
null) {
195 filters =
new Hashtable<String, ExampleFileFilter>(5);
197 filters.put(extension.toLowerCase(),
this);
198 fullDescription =
null;
212 if(fullDescription ==
null) {
214 fullDescription = description==
null ?
"(" : description +
" (";
216 Enumeration<String> extensions = filters.keys();
217 if(extensions !=
null) {
218 fullDescription +=
"." + (String) extensions.nextElement();
219 while (extensions.hasMoreElements()) {
220 fullDescription +=
", " + (String) extensions.nextElement();
223 fullDescription +=
")";
241 fullDescription =
null;
256 useExtensionsInDescription =
b;
257 fullDescription =
null;
ExampleFileFilter(String[] filters)
String getExtension(File f)
#define null
our own NULL pointer
void addExtension(String extension)
void setDescription(String description)
Hashtable< String, ExampleFileFilter > filters
boolean useExtensionsInDescription
boolean isExtensionListInDescription()
ExampleFileFilter(String[] filters, String description)
ExampleFileFilter(String extension, String description)
void setExtensionListInDescription(boolean b)
ExampleFileFilter(String extension)