01: package abbot.script;
02:
03: import java.io.File;
04:
05: import javax.swing.filechooser.FileFilter;
06:
07: import abbot.Platform;
08: import abbot.i18n.Strings;
09:
10: public class ScriptFilter extends FileFilter {
11: /** Indicate whether the given file should appear in the browser. */
12: public boolean accept(File file) {
13: // OSX has a buggy file chooser, gets NPE if you open a directory
14: if (Platform.isOSX() && Platform.JAVA_VERSION <= 0x1400) {
15: }
16: return Script.isScript(file) || file.isDirectory();
17: }
18:
19: /** Indicate the combo box entry used to describe files of this type. */
20: public String getDescription() {
21: return Strings.get("editor.filechooser.script_desc");
22: }
23: }
|