comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet8.d @ 112:9f4c18c268b2

Update to compile and execute with dmd 2.052.
author kntroh
date Wed, 16 Mar 2011 21:53:53 +0900
parents 69b1fa94a4a8
children
comparison
equal deleted inserted replaced
111:b6e9904989ed 112:9f4c18c268b2
28 import org.eclipse.swt.widgets.Shell; 28 import org.eclipse.swt.widgets.Shell;
29 import org.eclipse.swt.widgets.Tree; 29 import org.eclipse.swt.widgets.Tree;
30 import org.eclipse.swt.widgets.TreeItem; 30 import org.eclipse.swt.widgets.TreeItem;
31 31
32 import java.lang.all; 32 import java.lang.all;
33 import tango.io.FilePath; 33 version(Tango){
34 import tango.io.FileSystem; 34 import tango.io.FilePath;
35 import tango.io.FileSystem;
36 } else { // Phobos
37 import std.file;
38 import std.path;
39 class FileSystem {
40 static string[] roots() {return [rel2abs(sep)];}
41 }
42 class FilePath {
43 string path;
44 this (string path) {this.path = path;}
45 FilePath[] toList() {
46 FilePath[] r;
47 foreach (file; listDir(path)) {
48 r ~= new FilePath(std.path.join(path, file));
49 }
50 return r;
51 }
52 bool isFolder() {return exists(path) && isDir(path);}
53 string toString() {return path;}
54 }
55 }
35 56
36 void main () { 57 void main () {
37 auto display = new Display (); 58 auto display = new Display ();
38 auto shell = new Shell (display); 59 auto shell = new Shell (display);
39 shell.setText ("Lazy Tree"); 60 shell.setText ("Lazy Tree");