src/JsRender/PlainFile.vala
[app.Builder.js] / src / JsRender / PlainFile.vala
1
2 /**
3  * 
4  *  this is the code represents a File when using the Gtk view..
5  *   
6  *  It ues NodeToGtk
7  * 
8  * 
9  */
10
11 namespace JsRender {
12
13
14  
15     int plid = 1;
16
17   
18     public  class PlainFile : JsRender
19     {
20                 string contents;
21
22         public PlainFile(Project.Project project, string path) {
23         
24             base( project, path);
25             this.xtype = "PlainFile";
26             
27             
28             // fixme...
29             this.language = "vala";
30             
31                         this.contents = "";
32             
33             // super?!?!
34             this.id = "file-plain-%d".printf(plid++);
35             //console.dump(this);
36             // various loader methods..
37
38             // Class = list of arguments ... and which property to use as a value.
39        
40
41             
42             
43         }
44           
45
46         /*
47         setNSID : function(id)
48         {
49             
50             this.items[0]['*class'] = id;
51             
52             
53         },
54         getType: function() {
55             return 'Gtk';
56         },
57         */
58
59                 public   override void   removeFiles() {
60                         if (FileUtils.test(this.pat, FileTest.EXISTS)) {
61                                 GLib.FileUtils.remove(this.pat);
62                         }
63                          
64                 }
65         
66                 public   override void  loadItems() throws GLib.Error // : function(cb, sync) == original was async.
67                 {
68                    
69                    GLib.FileUtils.get_contents(this.path, this.contents);
70                    
71                 }
72          
73         
74                 
75         public override string toSourcePreview()
76         {
77                          
78                 }
79       
80         public override string toSource()
81         {
82                         return this.contents;
83             
84              
85             
86         }
87                 
88         public override void save() {
89             this.writeFile(this.path, this.contents);
90             
91         }
92             // ignore these calls.
93         public override void saveHTML ( string html ) {}
94             
95                     
96         /** 
97          *  saveJS
98          * 
99          * save as a javascript file.
100          * why is this not save...???
101          * 
102          */ 
103          
104    
105         string getHelpUrl(string cls)
106         {
107             return ""; 
108         }
109         public override void  findTransStrings(Node? node )
110                 {
111                         // not yet..
112                 }
113         
114         
115           
116
117                 
118
119         }
120 }
121
122
123