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 // if the file does not exist...
29 var f = File.new_for_path (path) ;
30 var info = f.query_info ("standard::*", 0);
31 var ct = info.get_content_type();
32 this.content_type = ct;
42 this.id = "file-plain-%d".printf(plid++);
44 // various loader methods..
46 // Class = list of arguments ... and which property to use as a value.
55 setNSID : function(id)
58 this.items[0]['*class'] = id;
67 public override void removeFiles() {
68 if (FileUtils.test(this.path, FileTest.EXISTS)) {
69 GLib.FileUtils.remove(this.path);
74 public override void loadItems() throws GLib.Error // : function(cb, sync) == original was async.
77 GLib.FileUtils.get_contents(this.path, out this.contents);
83 public override string toSourcePreview()
87 public override void setSource(string str) {
90 public override string toSource()
98 public override void save() {
100 print("Ignoring Save - as file was never loaded?\n");
104 this.writeFile(this.path, this.contents);
105 } catch (GLib.Error e) {
110 // ignore these calls.
111 public override void saveHTML ( string html ) {}
117 * save as a javascript file.
118 * why is this not save...???
123 string getHelpUrl(string cls)
127 public override void findTransStrings(Node? node )