4 * this is the code represents a File when using the Gtk view..
18 public class PlainFile : JsRender
22 public PlainFile(Project.Project project, string path) {
25 this.xtype = "PlainFile";
27 var f = File.new_for_path (path) ;
28 var info = f.query_info ("standard::*", 0);
29 var ct = info.get_content_type();
30 this.content_type = ct;
40 this.id = "file-plain-%d".printf(plid++);
42 // various loader methods..
44 // Class = list of arguments ... and which property to use as a value.
53 setNSID : function(id)
56 this.items[0]['*class'] = id;
65 public override void removeFiles() {
66 if (FileUtils.test(this.path, FileTest.EXISTS)) {
67 GLib.FileUtils.remove(this.path);
72 public override void loadItems() throws GLib.Error // : function(cb, sync) == original was async.
75 GLib.FileUtils.get_contents(this.path, out this.contents);
81 public override string toSourcePreview()
85 public override void setSource(string str) {
88 public override string toSource()
96 public override void save() {
98 print("Ignoring Save - as file was never loaded?\n");
102 this.writeFile(this.path, this.contents);
103 } catch (GLib.Error e) {
108 // ignore these calls.
109 public override void saveHTML ( string html ) {}
115 * save as a javascript file.
116 * why is this not save...???
121 string getHelpUrl(string cls)
125 public override void findTransStrings(Node? node )