2f16b6c00366a3ac0af7e5f13003f3aff8fc8ba6
[jalviewjs.git] / site / swingjs / j2s / jssun / awt / shell / DefaultShellFolder.js
1 Clazz.declarePackage ("jssun.awt.shell");
2 Clazz.load (["jssun.awt.shell.ShellFolder"], "jssun.awt.shell.DefaultShellFolder", ["java.io.File", "$.ObjectStreamException"], function () {
3 c$ = Clazz.declareType (jssun.awt.shell, "DefaultShellFolder", jssun.awt.shell.ShellFolder);
4 Clazz.makeConstructor (c$, 
5 function (parent, f) {
6 Clazz.superConstructor (this, jssun.awt.shell.DefaultShellFolder, [parent, f.getAbsolutePath ()]);
7 }, "jssun.awt.shell.ShellFolder,java.io.File");
8 Clazz.overrideMethod (c$, "writeReplace", 
9 function () {
10 return  new java.io.File (this.getPath ());
11 });
12 Clazz.defineMethod (c$, "listFiles", 
13 function () {
14 var files = Clazz.superCall (this, jssun.awt.shell.DefaultShellFolder, "listFiles", []);
15 if (files != null) {
16 for (var i = 0; i < files.length; i++) {
17 files[i] =  new jssun.awt.shell.DefaultShellFolder (this, files[i]);
18 }
19 }return files;
20 });
21 Clazz.overrideMethod (c$, "isLink", 
22 function () {
23 return false;
24 });
25 Clazz.overrideMethod (c$, "isHidden", 
26 function () {
27 var fileName = this.getName ();
28 if (fileName.length > 0) {
29 return (fileName.charAt (0) == '.');
30 }return false;
31 });
32 Clazz.overrideMethod (c$, "getLinkLocation", 
33 function () {
34 return null;
35 });
36 Clazz.overrideMethod (c$, "getDisplayName", 
37 function () {
38 return this.getName ();
39 });
40 Clazz.overrideMethod (c$, "getFolderType", 
41 function () {
42 if (this.isDirectory ()) {
43 return "File Folder";
44 } else {
45 return "File";
46 }});
47 Clazz.overrideMethod (c$, "getExecutableType", 
48 function () {
49 return null;
50 });
51 });