Fix #8003 - undo code
[roobuilder] / src / Builder4 / MainWindow.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "# Project.Project project" : "null",
7    "# WindowState windowstate" : "",
8    "# bool winloading" : false,
9    "$ type" : "Gtk.WindowType.TOPLEVEL",
10    "$ xns" : "Gtk",
11    "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
12    "* init" : [
13     "",
14     "this.el.set_icon_name(\"roobuilder\");",
15     ""
16    ],
17    "border_width" : 0,
18    "default_height" : 850,
19    "default_width" : 1200,
20    "id" : "MainWindow",
21    "items" : [
22     {
23      "$ xns" : "Gtk",
24      "* pack" : "set_titlebar",
25      "bool show_close_button" : true,
26      "id" : "headerbar",
27      "items" : [
28       {
29        "$ xns" : "Gtk",
30        "* pack" : "pack_start",
31        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
32        "items" : [
33         {
34          "$ xns" : "Gtk",
35          "* pack" : "append",
36          "bool has_frame" : false,
37          "bool has_tooltip" : true,
38          "items" : [
39           {
40            "$ xns" : "Adw",
41            "* prop" : "child",
42            "string icon_name" : "preferences-system-windows",
43            "string label" : " Files",
44            "xtype" : "ButtonContent"
45           }
46          ],
47          "listeners" : {
48           "clicked" : [
49            "  ( ) => {",
50            "  \t_this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;",
51            "  \tif (_this.splitview.el.show_sidebar) {",
52            "  \t\t_this.sidebar.show(); ",
53            " \t}",
54            "}"
55           ]
56          },
57          "string tooltip_text" : "Manage Windows (Ctrl-O)",
58          "xtype" : "Button"
59         },
60         {
61          "$ xns" : "Gtk",
62          "bool has_frame" : false,
63          "listeners" : {
64           "clicked" : [
65            "( ) => {",
66            "\t",
67            "\tGLib.debug(\"undo clicked\");",
68            "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
69            "\t\t_this.windowstate.code_editor_tab.buffer.el.undo();",
70            "\t}",
71            "\tif (!_this.windowstate.file.undoStep(-1)) {",
72            "\t\treturn;",
73            "\t}",
74            "\t",
75            "\t ",
76            "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
77            "\t// this triggers loadItems..",
78            "\t_this.windowstate.left_tree.model.loadFile(",
79            "\t\t_this.windowstate.file);",
80            "\t ",
81            "",
82            "\t",
83            " ",
84            "",
85            "\t// load it everywhere",
86            "}",
87            ""
88           ]
89          },
90          "string icon_name" : "edit-undo",
91          "xtype" : "Button"
92         },
93         {
94          "$ xns" : "Gtk",
95          "bool has_frame" : false,
96          "listeners" : {
97           "clicked" : [
98            "( ) => {",
99            "\t",
100            "\tGLib.debug(\"undo clicked\");",
101            "\tif (_this.windowstate.file.xtype == \"PlainFile\") {",
102            "\t\t_this.windowstate.code_editor_tab.buffer.el.redo();",
103            "\t}",
104            "\tif (!_this.windowstate.file.undoStep(1)) {",
105            "\t\treturn;",
106            "\t}",
107            "\t",
108            "\t ",
109            "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ",
110            "\t// this triggers loadItems..",
111            "\t_this.windowstate.left_tree.model.loadFile(",
112            "\t\t_this.windowstate.file);",
113            "\t ",
114            "",
115            "\t",
116            " ",
117            "",
118            "\t// load it everywhere",
119            "}",
120            ""
121           ]
122          },
123          "string icon_name" : "edit-redo",
124          "xtype" : "Button"
125         }
126        ],
127        "xtype" : "Box"
128       }
129      ],
130      "xtype" : "HeaderBar"
131     },
132     {
133      "$ xns" : "Adw",
134      "* prop" : "child",
135      "bool collapsed" : true,
136      "bool show_sidebar" : false,
137      "double sidebar_width_fraction" : 0.40000000000000002,
138      "id" : "splitview",
139      "items" : [
140       {
141        "$ xns" : "Gtk",
142        "* prop" : "content",
143        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
144        "bool hexpand" : true,
145        "bool homogeneous" : false,
146        "bool vexpand" : false,
147        "id" : "vbox",
148        "int spacing" : 0,
149        "items" : [
150         {
151          "# int lastWidth" : 0,
152          "$ xns" : "Gtk",
153          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
154          "bool hexpand" : true,
155          "bool vexpand" : true,
156          "id" : "mainpane",
157          "items" : [
158           {
159            "$ xns" : "Gtk",
160            "* prop" : "start_child",
161            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
162            "bool hexpand" : true,
163            "bool vexpand" : true,
164            "id" : "leftpane",
165            "items" : [
166             {
167              "$ xns" : "Gtk",
168              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
169              "id" : "editpane",
170              "items" : [
171               {
172                "$ xns" : "Gtk",
173                "* prop" : "start_child",
174                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
175                "bool hexpand" : true,
176                "bool vexpand" : true,
177                "id" : "tree",
178                "xtype" : "Box"
179               },
180               {
181                "$ xns" : "Gtk",
182                "* prop" : "end_child",
183                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
184                "bool hexpand" : true,
185                "bool vexpand" : true,
186                "id" : "props",
187                "xtype" : "Box"
188               }
189              ],
190              "listeners" : {
191               "accept_position" : [
192                "( ) => {",
193                "\t_this.windowstate.left_tree.onresize();",
194                "\treturn true;",
195                "}",
196                ""
197               ],
198               "move_handle" : [
199                "(scroll) => {",
200                "\tGLib.debug(\"Move handle\");",
201                "\treturn true;",
202                "}"
203               ]
204              },
205              "xtype" : "Paned"
206             }
207            ],
208            "xtype" : "Box"
209           },
210           {
211            "$ xns" : "Gtk",
212            "* prop" : "end_child",
213            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
214            "bool hexpand" : true,
215            "bool vexpand" : true,
216            "items" : [
217             {
218              "$ xns" : "Gtk",
219              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
220              "bool hexpand" : true,
221              "bool vexpand" : true,
222              "id" : "rooviewbox",
223              "xtype" : "Box"
224             },
225             {
226              "$ xns" : "Gtk",
227              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
228              "bool hexpand" : true,
229              "bool vexpand" : true,
230              "id" : "codeeditviewbox",
231              "xtype" : "Box"
232             }
233            ],
234            "xtype" : "Box"
235           }
236          ],
237          "listeners" : {
238           "accept_position" : [
239            "( ) => {",
240            "\t_this.windowstate.left_tree.onresize();",
241            "\treturn true;",
242            "}",
243            ""
244           ]
245          },
246          "position" : 400,
247          "xtype" : "Paned"
248         },
249         {
250          "$ xns" : "Gtk",
251          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
252          "bool homogeneous" : false,
253          "bool vexpand" : false,
254          "items" : [
255           {
256            "$ tooltip_text" : "\"Project Details\"",
257            "$ xns" : "Gtk",
258            "bool always_show_image" : true,
259            "listeners" : {
260             "clicked" : [
261              "  ( ) => {",
262              "     ",
263              "     _this.windowstate.projectPopoverShow(_this.el, null, null);",
264              "   ",
265              "  ",
266              "}"
267             ]
268            },
269            "string icon_name" : "emblem-system",
270            "string label" : "Edit Project Settings",
271            "xtype" : "Button"
272           },
273           {
274            "$ tooltip_text" : "\"File Details\"",
275            "$ xns" : "Gtk",
276            "bool always_show_image" : true,
277            "listeners" : {
278             "clicked" : [
279              "  ( ) => {",
280              "  ",
281              "    // create a new file in project..",
282              "    if (_this.project == null || _this.windowstate.file == null) {",
283              "        return  ;",
284              "    }",
285              "     _this.windowstate.file_details.show(",
286              "        _this.windowstate.file, _this.el, false",
287              "    );",
288              "     ",
289              "    return  ;    ",
290              "",
291              "",
292              "}"
293             ]
294            },
295            "string icon_name" : "document-properties",
296            "string label" : "Edit File Properties",
297            "xtype" : "Button"
298           },
299           {
300            "$ xns" : "Gtk",
301            "bool always_show_image" : true,
302            "items" : [
303             {
304              "$ xns" : "Gtk",
305              "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
306              "* init" : [
307               "{",
308               "   // this.el.show();",
309               "}",
310               ""
311              ],
312              "* prop" : "popover",
313              "id" : "topbarmenu",
314              "items" : [
315               {
316                "$ xns" : "Gtk",
317                "* pack" : "set_child",
318                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
319                "int spacing" : 0,
320                "items" : [
321                 {
322                  "$ xns" : "Gtk",
323                  "listeners" : {
324                   "activate" : [
325                    " ( ) => {",
326                    "         Resources.singleton().fetchStart();",
327                    "}"
328                   ]
329                  },
330                  "string label" : "Download updated Resources",
331                  "xtype" : "Button"
332                 },
333                 {
334                  "$ xns" : "Gtk",
335                  "listeners" : {
336                   "clicked" : [
337                    "() => {",
338                    "    About.singleton().el.show();",
339                    "    }"
340                   ]
341                  },
342                  "string label" : "About the Builder",
343                  "xtype" : "Button"
344                 }
345                ],
346                "xtype" : "Box"
347               }
348              ],
349              "xtype" : "PopoverMenu"
350             }
351            ],
352            "string icon_name" : "dialog-information",
353            "string label" : "About",
354            "xtype" : "MenuButton"
355           },
356           {
357            "$ xns" : "Gtk",
358            "bool hexpand" : true,
359            "string label" : "   ",
360            "xtype" : "Label"
361           },
362           {
363            "$ xns" : "Gtk",
364            "* init" : [
365             "{",
366             "     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
367             "        if (pos < 1) {",
368             "            this.el.hide();",
369             "            _this.mainpane.el.set_sensitive(true);",
370             "            ",
371             "            return;",
372             "        }",
373             "         _this.mainpane.el.set_sensitive(false);",
374             "         this.el.show();",
375             "         this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
376             "         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
377             "       ",
378             "     });",
379             "}",
380             ""
381            ],
382            "bool show_text" : true,
383            "id" : "statusbar",
384            "ulong handler_id" : "-1",
385            "xtype" : "ProgressBar"
386           },
387           {
388            "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
389            "$ xns" : "Gtk",
390            "items" : [
391             {
392              "$ xns" : "Gtk",
393              "id" : "statusbar_compilestatus_label",
394              "int margin_end" : 4,
395              "int margin_start" : 4,
396              "string label" : "Compile Status:",
397              "xtype" : "Label"
398             },
399             {
400              "$ xns" : "Gtk",
401              "Xcls_ValaCompileErrors popup" : "",
402              "id" : "statusbar_errors",
403              "listeners" : {
404               "clicked" : [
405                "() => {",
406                " ",
407                "\tif (this.popup == null) {",
408                "\t\treturn;",
409                "\t}",
410                "   ",
411                "    this.popup.show();",
412                "  ",
413                "}"
414               ]
415              },
416              "string icon_name" : "dialog-error",
417              "string label" : "0 Errors",
418              "xtype" : "Button",
419              "| void setNotices" : [
420               "(GLib.ListStore nots, int ferrors ) {",
421               "    BuilderApplication.showSpinner(\"\");",
422               "     if (nots.get_n_items() < 1 ) {",
423               "    \tthis.el.hide();",
424               "    \tif (this.popup != null) {",
425               "    \t\tthis.popup.el.hide();",
426               "\t\t}",
427               "    \treturn;",
428               "    }",
429               "    ",
430               "    this.el.show();",
431               "    this.el.label = \"%d/%d Errors\".printf(ferrors,(int)nots.get_n_items());",
432               "",
433               "    ",
434               " ",
435               "\tif (this.popup == null) {",
436               "        this.popup = new Xcls_ValaCompileErrors();",
437               "        this.popup.window = _this;",
438               "      //    this.popup.el.set_transient_for( _this.el );",
439               "        this.popup.el.set_parent(this.el);",
440               "    }",
441               " ",
442               "\tthis.popup.updateNotices(nots);",
443               "\t ",
444               "}",
445               ""
446              ]
447             },
448             {
449              "$ xns" : "Gtk",
450              "Xcls_ValaCompileErrors popup" : "",
451              "id" : "statusbar_warnings",
452              "listeners" : {
453               "clicked" : [
454                "() => {",
455                " ",
456                "\tif (this.popup == null) {",
457                "\t\treturn;",
458                "\t}",
459                "   ",
460                "    this.popup.show();",
461                "    return;",
462                "}"
463               ]
464              },
465              "string icon_name" : "dialog-warning",
466              "string label" : "0 Warnings",
467              "xtype" : "Button",
468              "| void setNotices" : [
469               "(GLib.ListStore nots, int ferrs ) {",
470               "    ",
471               "     if (nots.get_n_items() < 1 ) {",
472               "    \tthis.el.hide();",
473               "    \tif (this.popup != null) {",
474               "    \t\tthis.popup.el.hide();",
475               "\t\t}",
476               "    \treturn;",
477               "    }",
478               "    ",
479               "    this.el.show();",
480               "    this.el.label = \"%d/%d Warnings\".printf(ferrs,(int)nots.get_n_items());",
481               "",
482               "    ",
483               " ",
484               "\tif (this.popup == null) {",
485               "        this.popup = new Xcls_ValaCompileErrors();",
486               "        this.popup.window = _this;",
487               "      //    this.popup.el.set_transient_for( _this.el );",
488               "        this.popup.el.set_parent(this.el);",
489               "    }",
490               "\tthis.popup.updateNotices(nots);",
491               "\t ",
492               "}",
493               ""
494              ]
495             },
496             {
497              "# GLib.ListStore notices" : "null",
498              "$ xns" : "Gtk",
499              "Xcls_ValaCompileErrors popup" : "",
500              "id" : "statusbar_depricated",
501              "listeners" : {
502               "clicked" : [
503                "() => {",
504                " ",
505                "\tif (this.popup == null) {",
506                "\t\treturn;",
507                "\t}",
508                "   ",
509                "    this.popup.show();",
510                "  ",
511                "}"
512               ]
513              },
514              "string icon_name" : "dialog-information",
515              "string label" : "0 Depricated",
516              "xtype" : "Button",
517              "| void setNotices" : [
518               "",
519               "(GLib.ListStore nots, int ferrs ) {",
520               "    ",
521               "     if (nots.get_n_items() < 1 ) {",
522               "    \tthis.el.hide();",
523               "    \tif (this.popup != null) {",
524               "    \t\tthis.popup.el.hide();",
525               "\t\t}",
526               "    \treturn;",
527               "    }",
528               "    ",
529               "    this.el.show();",
530               "    this.el.label = \"%d/%d Depricated\".printf(ferrs,(int)nots.get_n_items());",
531               "",
532               "    ",
533               " ",
534               "\tif (this.popup == null) {",
535               "        this.popup = new Xcls_ValaCompileErrors();",
536               "        this.popup.window = _this;",
537               "      //    this.popup.el.set_transient_for( _this.el );",
538               "        this.popup.el.set_parent(this.el);",
539               "    }",
540               "\tthis.popup.updateNotices(nots);",
541               "\t ",
542               "}",
543               ""
544              ]
545             },
546             {
547              "$ xns" : "Gtk",
548              "Palete.ValaCompileRequest? last_request" : "null",
549              "Xcls_ValaCompileErrors popup" : "",
550              "bool visible" : false,
551              "id" : "statusbar_run",
552              "listeners" : {
553               "clicked" : [
554                "() => {",
555                "   ",
556                "   if (_this.windowstate.file == null) {",
557                "\t\treturn;",
558                "\t}",
559                "   if (_this.statusbar_compile_spinner.el.spinning) {",
560                "    \t_this.windowstate.compile_results.el.set_parent(this.el);",
561                "\t    _this.windowstate.compile_results.el.show(); // show currently running.",
562                "    \treturn;",
563                "\t}",
564                "\t",
565                "\tif (this.last_request != null) {",
566                "\t\tthis.last_request.cancel();",
567                "\t\tif (this.last_request.terminal_pid > 0) {",
568                "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
569                "\t\t}",
570                "\t}",
571                "\tvar pr = _this.windowstate.project as Project.Gtk;",
572                "\tif (pr == null) {",
573                "\t\treturn;",
574                "\t}",
575                "\t",
576                "\t",
577                "\tthis.last_request= new Palete.ValaCompileRequest(",
578                "\t\tpr,",
579                "\t\tpr.firstBuildModuleWith(_this.windowstate.file)",
580                "\t);",
581                "\tthis.last_request.onOutput.connect( ( str) => {",
582                "\t\t_this.windowstate.compile_results.addLine(str);",
583                "\t});",
584                "\tthis.last_request.run.begin( ( a, r) => {",
585                "\t\tthis.last_request.run.end(r);",
586                "\t});",
587                "\t if (_this.windowstate.compile_results.el.parent == null) {",
588                "\t\t_this.windowstate.compile_results.el.set_parent(this.el);",
589                "\t}",
590                "\t_this.windowstate.compile_results.show(this.el,true);",
591                "\t         ",
592                "}"
593               ]
594              },
595              "string icon_name" : "media-playback-start",
596              "string label" : "Run",
597              "xtype" : "Button"
598             }
599            ],
600            "xtype" : "Box"
601           },
602           {
603            "$ xns" : "Gtk",
604            "id" : "statusbar_compile_spinner",
605            "int margin_end" : 4,
606            "int margin_start" : 4,
607            "string tooltip_text" : "Compiling",
608            "xtype" : "Spinner",
609            "| void start" : [
610             "(string icon, string tooltip) {",
611             "",
612             "\tif (icon == \"spinner\") {",
613             "\t  this.el.show();",
614             "\t  this.el.start();  ",
615             "\t  this.el.tooltip_text = tooltip;",
616             "\t  _this.statusbar_compile_icon.el.hide();",
617             "  } else {",
618             "\t  this.el.hide();",
619             "\t//  GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
620             "\t  _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
621             "\t  _this.statusbar_compile_icon.el.icon_name = icon;",
622             "\t  _this.statusbar_compile_icon.el.show();\t  ",
623             "  }",
624             "  ",
625             "\t ",
626             "}",
627             ""
628            ],
629            "| void stop" : [
630             "() {",
631             " this.el.stop();",
632             "  this.el.hide();",
633             " _this.statusbar_compile_icon.el.hide();  ",
634             "}",
635             ""
636            ]
637           },
638           {
639            "$ xns" : "Gtk",
640            "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
641            "id" : "statusbar_compile_icon",
642            "int margin_end" : 4,
643            "int margin_start" : 4,
644            "xtype" : "Image"
645           }
646          ],
647          "xtype" : "Box"
648         }
649        ],
650        "xtype" : "Box"
651       },
652       {
653        "$ xns" : "Gtk",
654        "* prop" : "sidebar",
655        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
656        "id" : "sidebar",
657        "int spacing" : 0,
658        "items" : [
659         {
660          "$ xns" : "Gtk",
661          "bool has_tooltip" : true,
662          "bool hexpand" : true,
663          "id" : "filesearch",
664          "items" : [
665           {
666            "$ xns" : "Gtk",
667            "listeners" : {
668             "key_released" : [
669              "(keyval, keycode, state) => {",
670              "\tif (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {",
671              "\t\treturn;",
672              "\t}",
673              "\tGLib.debug(",
674              "\t",
675              "\t\t\"searcj key release %d, %d, %d  ?= %d\" , ",
676              "\t\t\t(int) keyval, (int)  keycode, state,",
677              "\t\t\t(int)Gdk.Key.Return",
678              "\t\t);",
679              "\tif (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {",
680              "\t\treturn;",
681              "\t}",
682              "\t\t",
683              "\tvar dir = 0;",
684              "\t",
685              "\tif (keyval == Gdk.Key.Return) {",
686              "\t\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
687              "\t\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
688              "\t\tvar f = (JsRender.JsRender) tr.item;",
689              "\t\tGLib.debug(\"Click %s\", f.name);",
690              "\t\tif (f.xtype == \"Dir\") {",
691              "\t\t\treturn;",
692              "\t\t}",
693              "\t\t",
694              "\t\t",
695              "\t \t_this.windowstate.fileViewOpen(f,",
696              "\t \t\t_this.keystate.is_shift != 1 ",
697              "\t\t);",
698              "\t\t",
699              "\t\t_this.splitview.el.show_sidebar = false;",
700              "\t\treturn;",
701              "\t\t",
702              "\t",
703              "\t}",
704              "\tif (keyval == Gdk.Key.Up) {",
705              "\t\tdir = -1;",
706              "\t}if (keyval == Gdk.Key.Down) {",
707              "\t\tdir = 1;",
708              "\t}",
709              "\tif (dir == 0) {",
710              "\t\treturn;",
711              "\t}",
712              "\tvar ns = _this.treeselmodel.el.selected + dir;",
713              "\tif (ns < 0) {",
714              "\t\tns = 0;",
715              "\t}",
716              "\tif (ns >= _this.treeselmodel.el.get_n_items()) {",
717              "\t\tns  = _this.treeselmodel.el.get_n_items()-1;",
718              "\t}",
719              "\t_this.treeselmodel.el.selected = ns;",
720              "}",
721              ""
722             ]
723            },
724            "xtype" : "EventControllerKey"
725           }
726          ],
727          "listeners" : {
728           "search_changed" : [
729            "( ) => {",
730            "",
731            "\t_this.windowsearch.el.set_search(this.el.get_text());",
732            "\tif (this.el.text == \"\") {",
733            "\t\t_this.treescroll.el.visible = false;",
734            "\t\treturn;",
735            "\t}",
736            "\t_this.treescroll.el.visible = true;",
737            "\t_this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);",
738            "}",
739            ""
740           ]
741          },
742          "string placeholder_text" : "Search for file",
743          "string tooltip_text" : [
744           "up/down arrow to select file from lower file list",
745           "enter opens selected in new window",
746           "shift+enter opens it in this window "
747          ],
748          "xtype" : "SearchEntry"
749         },
750         {
751          "$ xns" : "Gtk",
752          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
753          "bool hexpand" : true,
754          "int spacing" : 0,
755          "items" : [
756           {
757            "$ xns" : "Gtk",
758            "bool hexpand" : true,
759            "id" : "open_projects_btn",
760            "items" : [
761             {
762              "$ xns" : "Gtk",
763              "* prop" : "child",
764              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
765              "int spacing" : 0,
766              "items" : [
767               {
768                "$ xns" : "Gtk",
769                "int margin_end" : 4,
770                "string icon_name" : "document-open",
771                "xtype" : "Image"
772               },
773               {
774                "$ xns" : "Gtk",
775                "string label" : "Open File",
776                "xtype" : "Label"
777               }
778              ],
779              "xtype" : "Box"
780             }
781            ],
782            "listeners" : {
783             "clicked" : [
784              "  ( ) => {",
785              "  \t_this.splitview.el.show_sidebar = false;",
786              "  \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
787              "}"
788             ]
789            },
790            "tooltop_text" : "\"Open File\"",
791            "xtype" : "Button"
792           },
793           {
794            "$ xns" : "Gtk",
795            "bool hexpand" : true,
796            "items" : [
797             {
798              "$ xns" : "Gtk",
799              "* prop" : "child",
800              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
801              "int spacing" : 0,
802              "items" : [
803               {
804                "$ xns" : "Gtk",
805                "int margin_end" : 4,
806                "string icon_name" : "window-new",
807                "xtype" : "Image"
808               },
809               {
810                "$ xns" : "Gtk",
811                "string label" : "New Window",
812                "xtype" : "Label"
813               }
814              ],
815              "xtype" : "Box"
816             }
817            ],
818            "listeners" : {
819             "clicked" : [
820              "( ) => {",
821              "\t_this.splitview.el.show_sidebar = false;",
822              "\t_this.windowstate.showPopoverFiles(_this.el, _this.project, true);",
823              "}"
824             ]
825            },
826            "xtype" : "Button"
827           }
828          ],
829          "xtype" : "Box"
830         },
831         {
832          "$ xns" : "Gtk",
833          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
834          "bool vexpand" : true,
835          "items" : [
836           {
837            "$ xns" : "Gtk",
838            "* prop" : "start_child",
839            "bool has_frame" : true,
840            "items" : [
841             {
842              "$ xns" : "Gtk",
843              "* prop" : "child",
844              "items" : [
845               {
846                "$ xns" : "Gtk",
847                "* prop" : "model",
848                "bool autoselect" : false,
849                "bool can_unselect" : false,
850                "bool selecting" : false,
851                "id" : "winsel",
852                "items" : [
853                 {
854                  "$ xns" : "Gtk",
855                  "* prop" : "model",
856                  "items" : [
857                   {
858                    "$ xns" : "Gtk",
859                    "* prop" : "model",
860                    "id" : "winfilter",
861                    "items" : [
862                     {
863                      "$ xns" : "Gtk",
864                      "* prop" : "filter",
865                      "id" : "windowsearch",
866                      "items" : [
867                       {
868                        "$ xns" : "Gtk",
869                        "* prop" : "expression",
870                        "GLib.Type this_type" : "typeof(WindowState)",
871                        "string property_name" : "file_name",
872                        "xtype" : "PropertyExpression"
873                       }
874                      ],
875                      "xtype" : "StringFilter"
876                     },
877                     {
878                      "$ xns" : "GLib",
879                      "* prop" : "model",
880                      "GLib.Type item_type" : "typeof(WindowState)",
881                      "id" : "winmodel",
882                      "xtype" : "ListStore"
883                     }
884                    ],
885                    "xtype" : "FilterListModel"
886                   },
887                   {
888                    "$ xns" : "Gtk",
889                    "* prop" : "sorter",
890                    "bool ignore_case" : true,
891                    "items" : [
892                     {
893                      "$ xns" : "Gtk",
894                      "* prop" : "expression",
895                      "GLib.Type this_type" : "typeof(WindowState)",
896                      "string property_name" : "file_name",
897                      "xtype" : "PropertyExpression"
898                     }
899                    ],
900                    "xtype" : "StringSorter"
901                   }
902                  ],
903                  "xtype" : "SortListModel"
904                 }
905                ],
906                "listeners" : {
907                 "notify[\"selected\"]" : [
908                  "() => {",
909                  "\tif (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {",
910                  "\t\treturn;",
911                  "\t}",
912                  "\tvar ws = this.el.selected_item as WindowState;",
913                  "\tif (ws == null) {",
914                  "\t\treturn;",
915                  "\t}",
916                  "\tif (ws.file.path != _this.windowstate.file.path) {",
917                  "\t\t_this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window,  -1);",
918                  "\t\t_this.splitview.el.show_sidebar = false;",
919                  "\t}",
920                  "\t",
921                  "\tthis.selectCurrent();",
922                  " }"
923                 ]
924                },
925                "xtype" : "SingleSelection",
926                "| void selectCurrent" : [
927                 "() {",
928                 "\tthis.selecting = true;",
929                 "\t ",
930                 "\tfor(var i = 0;i < this.el.get_n_items(); i++) {",
931                 "\t\tvar ws = this.el.get_item(i) as WindowState;",
932                 "\t\tif (ws.file.path == _this.windowstate.file.path) {",
933                 "\t\t  \tthis.el.selected = i;",
934                 "\t\t  \tbreak;",
935                 "\t  \t}",
936                 "\t}",
937                 "\tthis.selecting = false;",
938                 " ",
939                 "",
940                 "}"
941                ]
942               },
943               {
944                "$ xns" : "Gtk",
945                "bool expand" : true,
946                "bool resizable" : true,
947                "id" : "projcol",
948                "items" : [
949                 {
950                  "$ xns" : "Gtk",
951                  "* prop" : "factory",
952                  "listeners" : {
953                   "bind" : [
954                    "(listitem) => {",
955                    "\t var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
956                    "\t var item =  (listitem as Gtk.ListItem).get_item() as WindowState;",
957                    "\t ",
958                    "\t lb.label = item.project.name;",
959                    "",
960                    "",
961                    "  ",
962                    "",
963                    "}",
964                    ""
965                   ],
966                   "setup" : [
967                    "(listitem) => {",
968                    "\tvar lbl = new Gtk.Label(\"\");",
969                    " \t(listitem as Gtk.ListItem).set_child(lbl);",
970                    " \tlbl.justify = Gtk.Justification.LEFT;",
971                    " \tlbl.xalign = 0;",
972                    " \tlbl.use_markup = true;",
973                    "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
974                    "  ",
975                    "\t(listitem as Gtk.ListItem).activatable = true;",
976                    "}",
977                    ""
978                   ]
979                  },
980                  "xtype" : "SignalListItemFactory"
981                 }
982                ],
983                "title" : "Project",
984                "xtype" : "ColumnViewColumn"
985               },
986               {
987                "$ xns" : "Gtk",
988                "* pack" : "append_column",
989                "bool expand" : true,
990                "bool resizable" : true,
991                "id" : "filecol",
992                "items" : [
993                 {
994                  "$ xns" : "Gtk",
995                  "* prop" : "factory",
996                  "listeners" : {
997                   "bind" : [
998                    "(listitem) => {",
999                    " var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
1000                    " var item =  (listitem as Gtk.ListItem).get_item() as WindowState;",
1001                    " ",
1002                    " lb.label = item.file.relpath;",
1003                    "",
1004                    "",
1005                    "  ",
1006                    "",
1007                    "}",
1008                    ""
1009                   ],
1010                   "setup" : [
1011                    "(listitem) => {",
1012                    "\tvar lbl = new Gtk.Label(\"\");",
1013                    " \t(listitem as Gtk.ListItem).set_child(lbl);",
1014                    " \tlbl.justify = Gtk.Justification.LEFT;",
1015                    " \tlbl.xalign = 0;",
1016                    " \tlbl.use_markup = true;",
1017                    "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
1018                    "  ",
1019                    "\t(listitem as Gtk.ListItem).activatable = true;",
1020                    "}",
1021                    ""
1022                   ]
1023                  },
1024                  "xtype" : "SignalListItemFactory"
1025                 }
1026                ],
1027                "title" : "File",
1028                "xtype" : "ColumnViewColumn"
1029               }
1030              ],
1031              "xtype" : "ColumnView"
1032             }
1033            ],
1034            "xtype" : "ScrolledWindow"
1035           },
1036           {
1037            "* prop" : "end_child",
1038            "bool has_frame" : true,
1039            "bool hexpand" : true,
1040            "bool vexpand" : true,
1041            "bool visible" : false,
1042            "id" : "treescroll",
1043            "items" : [
1044             {
1045              "$ xns" : "Gtk",
1046              "* prop" : "child",
1047              "bool hexpand" : true,
1048              "bool vexpand" : true,
1049              "id" : "treeview",
1050              "items" : [
1051               {
1052                "$ xns" : "Gtk",
1053                "listeners" : {
1054                 "pressed" : [
1055                  "(n_press, x, y) => {",
1056                  "\tif (n_press == 2) {",
1057                  "\t\tGLib.debug(\"double cliced\");",
1058                  "\t} else {",
1059                  "\t\treturn;",
1060                  "\t}",
1061                  "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
1062                  "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
1063                  "\tvar f = (JsRender.JsRender) tr.item;",
1064                  "\tGLib.debug(\"Click %s\", f.name);",
1065                  "\tif (f.xtype == \"Dir\") {",
1066                  "\t\treturn;",
1067                  "\t}",
1068                  "\t",
1069                  "\t",
1070                  " \t_this.windowstate.fileViewOpen(f,",
1071                  " \t\t_this.keystate.is_shift != 1 ",
1072                  "\t);",
1073                  "\t",
1074                  "\t_this.splitview.el.show_sidebar = false;",
1075                  "\t",
1076                  "\t",
1077                  "",
1078                  "}",
1079                  ""
1080                 ]
1081                },
1082                "xtype" : "GestureClick"
1083               },
1084               {
1085                "$ xns" : "Gtk",
1086                "* prop" : "model",
1087                "bool autoselect" : true,
1088                "bool can_unselect" : true,
1089                "id" : "treeselmodel",
1090                "items" : [
1091                 {
1092                  "$ xns" : "Gtk",
1093                  "* prop" : "model",
1094                  "items" : [
1095                   {
1096                    "$ xns" : "Gtk",
1097                    "* prop" : "model",
1098                    "bool incremental" : true,
1099                    "id" : "treelistsort",
1100                    "items" : [
1101                     {
1102                      "$ xns" : "Gtk",
1103                      "* prop" : "model",
1104                      "Gtk.TreeListModelCreateModelFunc create_func" : [
1105                       "(item) => {",
1106                       "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
1107                       "\treturn ((JsRender.JsRender)item).childfiles;",
1108                       "} "
1109                      ],
1110                      "bool autoexpand" : true,
1111                      "bool passthrough" : false,
1112                      "id" : "treelistmodel",
1113                      "items" : [
1114                       {
1115                        "$ xns" : "GLib",
1116                        "* prop" : "root",
1117                        "GLib.Type item_type" : "typeof(JsRender.JsRender)",
1118                        "id" : "treemodel",
1119                        "xtype" : "ListStore"
1120                       }
1121                      ],
1122                      "xtype" : "TreeListModel"
1123                     },
1124                     {
1125                      "$ xns" : "Gtk",
1126                      "* prop" : "sorter",
1127                      "items" : [
1128                       {
1129                        "$ xns" : "Gtk",
1130                        "* prop" : "sorter",
1131                        "bool ignore_case" : true,
1132                        "items" : [
1133                         {
1134                          "$ xns" : "Gtk",
1135                          "* prop" : "expression",
1136                          "GLib.Type this_type" : "typeof(JsRender.JsRender) ",
1137                          "string property_name" : "name",
1138                          "xtype" : "PropertyExpression"
1139                         }
1140                        ],
1141                        "xtype" : "StringSorter"
1142                       }
1143                      ],
1144                      "xtype" : "TreeListRowSorter"
1145                     }
1146                    ],
1147                    "xtype" : "SortListModel"
1148                   },
1149                   {
1150                    "$ xns" : "Gtk",
1151                    "* prop" : "filter",
1152                    "Gtk.CustomFilterFunc match_func" : [
1153                     "(item) => { ",
1154                     "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
1155                     "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
1156                     "\tvar j =  (JsRender.JsRender) tr;",
1157                     "\tif (j.xtype == \"Dir\" && j.childfiles.n_items < 1) {",
1158                     "\t\treturn false;",
1159                     "\t}",
1160                     "\tvar str = _this.filesearch.el.text.down();\t",
1161                     "\tif (j.xtype == \"Dir\") {",
1162                     "\t",
1163                     "\t\t",
1164                     "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
1165                     "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
1166                     "\t\t\t//if (f.xtype != \"PlainFile\") {",
1167                     "\t\t\t//\tcontinue;",
1168                     "\t\t\t//}",
1169                     "\t\t\tif (f.content_type.contains(\"image\")) {",
1170                     "\t\t\t\tcontinue;",
1171                     "\t\t\t}",
1172                     "\t\t\tif (str.length < 1) {",
1173                     "\t\t\t\treturn true;",
1174                     "\t\t\t}",
1175                     "\t\t\tif (f.name.down().contains(str)) {",
1176                     "\t\t\t\treturn true;",
1177                     "\t\t\t}",
1178                     "\t\t\t",
1179                     "\t\t}",
1180                     "\t\t ",
1181                     "\t\treturn false;",
1182                     "\t}",
1183                     "\t//if (j.xtype != \"PlainFile\") {",
1184                     "\t//\treturn false;",
1185                     "\t//}",
1186                     " \tif (j.content_type.contains(\"image\")) {",
1187                     "\t\treturn false;",
1188                     "\t}",
1189                     "\t\t\t ",
1190                     "\tif (str.length < 1) { // no search.",
1191                     "\t\treturn true;",
1192                     "\t}",
1193                     "\tif (j.name.down().contains(str)) {",
1194                     "\t\treturn true;",
1195                     "\t}",
1196                     "\treturn false; ",
1197                     "",
1198                     "}"
1199                    ],
1200                    "id" : "treefilter",
1201                    "xtype" : "CustomFilter"
1202                   }
1203                  ],
1204                  "xtype" : "FilterListModel"
1205                 }
1206                ],
1207                "xtype" : "SingleSelection"
1208               },
1209               {
1210                "$ xns" : "Gtk",
1211                "* init" : [
1212                 "{",
1213                 "\t// this.el.set_sorter(  new Gtk.StringSorter(",
1214                 "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
1215                 " //\t));",
1216                 "\t\t",
1217                 "}",
1218                 ""
1219                ],
1220                "* pack" : "append_column",
1221                "bool expand" : true,
1222                "bool resizable" : true,
1223                "id" : "name",
1224                "items" : [
1225                 {
1226                  "$ xns" : "Gtk",
1227                  "* prop" : "factory",
1228                  "listeners" : {
1229                   "bind" : [
1230                    "(listitem) => {",
1231                    "\t",
1232                    "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
1233                    "                \t",
1234                    "            \t",
1235                    "            \t",
1236                    "        \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1237                    "    \tvar expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();",
1238                    "    \t  ",
1239                    "     \tvar hbox = (Gtk.Box) expand.child;",
1240                    " ",
1241                    "\t",
1242                    "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
1243                    "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
1244                    "",
1245                    " ",
1246                    "    \t",
1247                    "    \t if (lbl == null || lbl.label != \"\") { // do not update",
1248                    "    \t \treturn;",
1249                    "     \t}",
1250                    "    \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
1251                    "    \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
1252                    "    ",
1253                    "    \t",
1254                    "    \tvar jr =(JsRender.JsRender) lr.get_item();",
1255                    "    \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
1256                    "    \t",
1257                    "    \t if (jr == null) {",
1258                    "    \t\t GLib.debug(\"Problem getting item\"); ",
1259                    "    \t\t return;",
1260                    "    \t }",
1261                    "",
1262                    "\t\tjr.bind_property(\"icon\",",
1263                    "                img, \"gicon\",",
1264                    "               GLib.BindingFlags.SYNC_CREATE);",
1265                    "",
1266                    "    \t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
1267                    "    \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
1268                    "    \tlbl.tooltip_markup = jr.path;",
1269                    "    \t ",
1270                    "        expand.set_hide_expander(  jr.xtype != \"Dir\" );",
1271                    "     \t expand.set_list_row(lr);",
1272                    "     ",
1273                    "         \t ",
1274                    "                 \t// bind image...",
1275                    "}",
1276                    ""
1277                   ],
1278                   "setup" : [
1279                    "(listitem) => {",
1280                    "\t",
1281                    "\tvar expand = new Gtk.TreeExpander();",
1282                    "\t ",
1283                    "\texpand.set_indent_for_depth(true);",
1284                    "\texpand.set_indent_for_icon(true);",
1285                    "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
1286                    "\tvar icon = new Gtk.Image();",
1287                    "\ticon.margin_end = 4;",
1288                    "\tvar lbl = new Gtk.Label(\"\");",
1289                    "\tlbl.use_markup = true;",
1290                    "\t",
1291                    "\t",
1292                    " \tlbl.justify = Gtk.Justification.LEFT;",
1293                    " \tlbl.xalign = 0;",
1294                    "",
1295                    " \thbox.append(icon);",
1296                    "\thbox.append(lbl);",
1297                    "\texpand.set_child(hbox);",
1298                    "\t((Gtk.ListItem)listitem).set_child(expand);",
1299                    "\t((Gtk.ListItem)listitem).activatable = false;",
1300                    "}",
1301                    ""
1302                   ]
1303                  },
1304                  "xtype" : "SignalListItemFactory"
1305                 }
1306                ],
1307                "string title" : "All Project Files",
1308                "xtype" : "ColumnViewColumn"
1309               }
1310              ],
1311              "xtype" : "ColumnView"
1312             }
1313            ],
1314            "string tooltip_text" : [
1315             "dbl-click - opens in NEW window                        ",
1316             "shift--dbl-click opens in this window"
1317            ],
1318            "string xns" : "Gtk",
1319            "string xtype" : "ScrolledWindow"
1320           }
1321          ],
1322          "xtype" : "Paned"
1323         }
1324        ],
1325        "xtype" : "Box",
1326        "| void show" : [
1327         "() {",
1328         "\t_this.splitview.el.show_sidebar = true;",
1329         "  \t ",
1330         "\t_this.filesearch.el.grab_focus();",
1331         "\t_this.winloading = true;",
1332         "\t_this.winmodel.el.remove_all();",
1333         "\t_this.filesearch.el.set_text(\"\");",
1334         "\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {",
1335         "\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));",
1336         "\t}",
1337         "\t_this.winsel.selectCurrent();",
1338         "\t_this.winloading = false;",
1339         "\t",
1340         "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
1341         "\t",
1342         "\t_this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);",
1343         "\t",
1344         "\t_this.treeview.el.set_model(_this.treeselmodel.el);",
1345         "\t",
1346         " \t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
1347         "\t",
1348         " ",
1349         "}"
1350        ]
1351       },
1352       {
1353        "$ xns" : "Gtk",
1354        "id" : "keystate",
1355        "int is_shift" : 0,
1356        "listeners" : {
1357         "key_pressed" : [
1358          "(keyval, keycode, state) => {",
1359          "",
1360          " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
1361          " \t\tthis.is_shift = 1;",
1362          " \t\t",
1363          "\t}",
1364          "\t",
1365          "\t",
1366          "\treturn true;",
1367          "\t",
1368          "}",
1369          ""
1370         ],
1371         "key_released" : [
1372          "(keyval, keycode, state) => {",
1373          "\tGLib.debug(",
1374          "\t",
1375          "\t\t\"key release %d, %d, %d  ?= %d %d\" , ",
1376          "\t\t\t(int) keyval, (int)  keycode, state,",
1377          "\t\t\t(int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK",
1378          "\t\t);",
1379          " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
1380          " \t\tthis.is_shift = 0;",
1381          "\t}",
1382          "\t//GLib.debug(\"set state %d , shift = %d\", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);",
1383          "\tif (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {",
1384          "\t\t// ctrl O pressed",
1385          "\t\tif (!_this.splitview.el.show_sidebar) {",
1386          "\t  \t\t_this.sidebar.show(); ",
1387          "\t \t}",
1388          "\t}",
1389          "\t",
1390          "",
1391          " ",
1392          "}"
1393         ]
1394        },
1395        "xtype" : "EventControllerKey"
1396       }
1397      ],
1398      "xtype" : "OverlaySplitView"
1399     }
1400    ],
1401    "listeners" : {
1402     "close_request" : [
1403      "( ) => {",
1404      "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
1405      "\t ",
1406      "\t ",
1407      "\t this.windowstate.file.getLanguageServer().document_close(",
1408      "\t \tthis.windowstate.file",
1409      " \t);",
1410      "\t ",
1411      "\t BuilderApplication.removeWindow(this);",
1412      "\t ",
1413      "\t if (BuilderApplication.windows.size  < 1) {",
1414      "\t\tthis.windowstate.file.getLanguageServer().exit();",
1415      "\t\tBuilderApplication.singleton(  null ).quit();",
1416      "\t }",
1417      "\treturn true;",
1418      "\t",
1419      "}",
1420      ""
1421     ],
1422     "hide" : [
1423      "() =>  {",
1424      " ",
1425      " ",
1426      "",
1427      "}"
1428     ],
1429     "show" : [
1430      "  ( ) => {",
1431      "    // hide the file editing..",
1432      "   ",
1433      "    //this.hideViewEditing();",
1434      "    // this is updated by windowstate - we try and fill it in..",
1435      "     _this.statusbar.el.hide();",
1436      "     //_this.statusbar_errors.el.hide();",
1437      "    //_this.statusbar_warnings.el.hide();",
1438      "    //_this.statusbar_depricated.el.hide();",
1439      "    _this.statusbar_compile_spinner.el.hide();",
1440      "  ",
1441      "    Resources.singleton().checkResources();",
1442      "    ",
1443      "  ",
1444      "",
1445      "}"
1446     ]
1447    },
1448    "string title" : "Roo Application Builder",
1449    "xtype" : "ApplicationWindow",
1450    "| void initChildren" : [
1451     " () {",
1452     "    // this needs putting in a better place..",
1453     "    if (this.windowstate == null) {",
1454     "    \tthis.windowstate = new WindowState(this);",
1455     "    ",
1456     "    }",
1457     "     ",
1458     "",
1459     " ",
1460     "",
1461     "    ",
1462     "",
1463     "",
1464     "",
1465     "}",
1466     ""
1467    ],
1468    "| void openNewWindow" : [
1469     "() {",
1470     " ",
1471     "    var w = new Xcls_MainWindow();",
1472     "    w.ref();",
1473     "\tBuilderApplication.addWindow(w);",
1474     "    w.el.show();",
1475     "    w.initChildren();",
1476     "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
1477     "     ",
1478     "}",
1479     ""
1480    ],
1481    "| void setTitle" : [
1482     " () {",
1483     "    if (_this.windowstate.project == null || ",
1484     "\t    _this.windowstate.file == null",
1485     "    ) {",
1486     "    \tthis.el.set_title(\"Select File\");",
1487     "    \treturn;",
1488     "\t}",
1489     "    _this.el.set_title(",
1490     "    \t_this.windowstate.project.name + ",
1491     "    \t\" - \" +",
1492     "\t\t_this.windowstate.file.relpath);",
1493     "} "
1494    ],
1495    "| void show" : [
1496     "() {",
1497     "   ",
1498     "    this.el.show();",
1499     "    if (this.windowstate.file  == null) {",
1500     "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
1501     "    }",
1502     "}"
1503    ],
1504    "| void updateErrors" : [
1505     "() {",
1506     "",
1507     "",
1508     " \tGLib.debug(\"updateErrors\");",
1509     "\t",
1510     "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
1511     "\t",
1512     "\tthis.statusbar_errors.setNotices(",
1513     "\t\tpr,",
1514     "\t\tthis.windowstate.file.getErrorsTotal(\"ERR\")",
1515     "\t);",
1516     "\t",
1517     "\tthis.statusbar_warnings.setNotices(",
1518     "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
1519     "\t\tthis.windowstate.file.getErrorsTotal(\"WARN\")",
1520     "\t);",
1521     "\tthis.statusbar_depricated.setNotices(",
1522     "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
1523     "\t\tthis.windowstate.file.getErrorsTotal(\"DEPR\")",
1524     "\t);",
1525     "",
1526     "\t_this.statusbar_run.el.hide();",
1527     "",
1528     "\tif (pr.get_n_items() < 1) {",
1529     "\t\t_this.statusbar_run.el.show();",
1530     "\t} ",
1531     "\t",
1532     "}"
1533    ]
1534   }
1535  ],
1536  "name" : "MainWindow"
1537 }