expanding tree when error buttons pressed
[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    "# default_height" : 850,
10    "$ type" : "Gtk.WindowType.TOPLEVEL",
11    "$ xns" : "Gtk",
12    "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
13    "* init" : [
14     "",
15     "this.el.set_icon_name(\"roobuilder\");",
16     ""
17    ],
18    "border_width" : 0,
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                    "\tvar li = (listitem as Gtk.ListItem);",
956                    "\tif (li == null) {",
957                    "\t\treturn;",
958                    "\t}",
959                    "\t var lb = (Gtk.Label) li.get_child() as Gtk.Label;",
960                    "\t if (lb == null) {",
961                    "\t \treturn;",
962                    " \t}",
963                    "\t var item =  li.get_item() as WindowState;",
964                    "\t if (item == null) {",
965                    "\t \treturn;",
966                    " \t}",
967                    "\t lb.label = item.project.name;",
968                    "",
969                    "",
970                    "  ",
971                    "",
972                    "}",
973                    ""
974                   ],
975                   "setup" : [
976                    "(listitem) => {",
977                    "",
978                    "\tvar li = (listitem as Gtk.ListItem);",
979                    "\tif (li == null) {",
980                    "\t\treturn;",
981                    "\t}",
982                    "",
983                    "\tvar lbl = new Gtk.Label(\"\");",
984                    " \tli.set_child(lbl);",
985                    " \tlbl.justify = Gtk.Justification.LEFT;",
986                    " \tlbl.xalign = 0;",
987                    " \tlbl.use_markup = true;",
988                    "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
989                    "  ",
990                    "\tli.activatable = true;",
991                    "}",
992                    ""
993                   ]
994                  },
995                  "xtype" : "SignalListItemFactory"
996                 }
997                ],
998                "title" : "Project",
999                "xtype" : "ColumnViewColumn"
1000               },
1001               {
1002                "$ xns" : "Gtk",
1003                "* pack" : "append_column",
1004                "bool expand" : true,
1005                "bool resizable" : true,
1006                "id" : "filecol",
1007                "items" : [
1008                 {
1009                  "$ xns" : "Gtk",
1010                  "* prop" : "factory",
1011                  "listeners" : {
1012                   "bind" : [
1013                    "(listitem) => {",
1014                    "\tvar li = (listitem as Gtk.ListItem);",
1015                    "\tif (li == null) {",
1016                    "\t\treturn;",
1017                    "\t}",
1018                    "\t var lb = (Gtk.Label) li.get_child() as Gtk.Label;",
1019                    "\t if (lb == null) {",
1020                    "\t \treturn;",
1021                    " \t}",
1022                    "\t var item =  li.get_item() as WindowState;",
1023                    "\t if (item == null) {",
1024                    "\t \treturn;",
1025                    " \t}",
1026                    " \t",
1027                    " \t ",
1028                    "  ",
1029                    " \tlb.label = item.file.relpath;",
1030                    "",
1031                    "",
1032                    "  ",
1033                    "",
1034                    "}",
1035                    ""
1036                   ],
1037                   "setup" : [
1038                    "(listitem) => {",
1039                    "\tvar li = (listitem as Gtk.ListItem);",
1040                    "\tif (li == null) {",
1041                    "\t\treturn;",
1042                    "\t}",
1043                    "\tvar lbl = new Gtk.Label(\"\");",
1044                    " \tli.set_child(lbl);",
1045                    " \tlbl.justify = Gtk.Justification.LEFT;",
1046                    " \tlbl.xalign = 0;",
1047                    " \tlbl.use_markup = true;",
1048                    "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
1049                    "  ",
1050                    "\tli.activatable = true;",
1051                    "}",
1052                    ""
1053                   ]
1054                  },
1055                  "xtype" : "SignalListItemFactory"
1056                 }
1057                ],
1058                "title" : "File",
1059                "xtype" : "ColumnViewColumn"
1060               }
1061              ],
1062              "xtype" : "ColumnView"
1063             }
1064            ],
1065            "xtype" : "ScrolledWindow"
1066           },
1067           {
1068            "* prop" : "end_child",
1069            "bool has_frame" : true,
1070            "bool hexpand" : true,
1071            "bool vexpand" : true,
1072            "bool visible" : false,
1073            "id" : "treescroll",
1074            "items" : [
1075             {
1076              "$ xns" : "Gtk",
1077              "* prop" : "child",
1078              "bool hexpand" : true,
1079              "bool vexpand" : true,
1080              "id" : "treeview",
1081              "items" : [
1082               {
1083                "$ xns" : "Gtk",
1084                "listeners" : {
1085                 "pressed" : [
1086                  "(n_press, x, y) => {",
1087                  "\tif (n_press == 2) {",
1088                  "\t\tGLib.debug(\"double cliced\");",
1089                  "\t} else {",
1090                  "\t\treturn;",
1091                  "\t}",
1092                  "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
1093                  "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
1094                  "\tvar f = (JsRender.JsRender) tr.item;",
1095                  "\tGLib.debug(\"Click %s\", f.name);",
1096                  "\tif (f.xtype == \"Dir\") {",
1097                  "\t\treturn;",
1098                  "\t}",
1099                  "\t",
1100                  "\t",
1101                  " \t_this.windowstate.fileViewOpen(f,",
1102                  " \t\t_this.keystate.is_shift != 1 ",
1103                  "\t);",
1104                  "\t",
1105                  "\t_this.splitview.el.show_sidebar = false;",
1106                  "\t",
1107                  "\t",
1108                  "",
1109                  "}",
1110                  ""
1111                 ]
1112                },
1113                "xtype" : "GestureClick"
1114               },
1115               {
1116                "$ xns" : "Gtk",
1117                "* prop" : "model",
1118                "bool autoselect" : true,
1119                "bool can_unselect" : true,
1120                "id" : "treeselmodel",
1121                "items" : [
1122                 {
1123                  "$ xns" : "Gtk",
1124                  "* prop" : "model",
1125                  "items" : [
1126                   {
1127                    "$ xns" : "Gtk",
1128                    "* prop" : "model",
1129                    "bool incremental" : true,
1130                    "id" : "treelistsort",
1131                    "items" : [
1132                     {
1133                      "$ xns" : "Gtk",
1134                      "* prop" : "model",
1135                      "Gtk.TreeListModelCreateModelFunc create_func" : [
1136                       "(item) => {",
1137                       "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
1138                       "\treturn ((JsRender.JsRender)item).childfiles;",
1139                       "} "
1140                      ],
1141                      "bool autoexpand" : true,
1142                      "bool passthrough" : false,
1143                      "id" : "treelistmodel",
1144                      "items" : [
1145                       {
1146                        "$ xns" : "GLib",
1147                        "* prop" : "root",
1148                        "GLib.Type item_type" : "typeof(JsRender.JsRender)",
1149                        "id" : "treemodel",
1150                        "xtype" : "ListStore"
1151                       }
1152                      ],
1153                      "xtype" : "TreeListModel"
1154                     },
1155                     {
1156                      "$ xns" : "Gtk",
1157                      "* prop" : "sorter",
1158                      "items" : [
1159                       {
1160                        "$ xns" : "Gtk",
1161                        "* prop" : "sorter",
1162                        "bool ignore_case" : true,
1163                        "items" : [
1164                         {
1165                          "$ xns" : "Gtk",
1166                          "* prop" : "expression",
1167                          "GLib.Type this_type" : "typeof(JsRender.JsRender) ",
1168                          "string property_name" : "name",
1169                          "xtype" : "PropertyExpression"
1170                         }
1171                        ],
1172                        "xtype" : "StringSorter"
1173                       }
1174                      ],
1175                      "xtype" : "TreeListRowSorter"
1176                     }
1177                    ],
1178                    "xtype" : "SortListModel"
1179                   },
1180                   {
1181                    "$ xns" : "Gtk",
1182                    "* prop" : "filter",
1183                    "Gtk.CustomFilterFunc match_func" : [
1184                     "(item) => { ",
1185                     "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
1186                     "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
1187                     "\tvar j =  (JsRender.JsRender) tr;",
1188                     "\tif (j.xtype == \"Dir\" && j.childfiles.n_items < 1) {",
1189                     "\t\treturn false;",
1190                     "\t}",
1191                     "\tvar str = _this.filesearch.el.text.down();\t",
1192                     "\tif (j.xtype == \"Dir\") {",
1193                     "\t",
1194                     "\t\t",
1195                     "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
1196                     "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
1197                     "\t\t\t//if (f.xtype != \"PlainFile\") {",
1198                     "\t\t\t//\tcontinue;",
1199                     "\t\t\t//}",
1200                     "\t\t\tif (f.content_type.contains(\"image\")) {",
1201                     "\t\t\t\tcontinue;",
1202                     "\t\t\t}",
1203                     "\t\t\tif (str.length < 1) {",
1204                     "\t\t\t\treturn true;",
1205                     "\t\t\t}",
1206                     "\t\t\tif (f.name.down().contains(str)) {",
1207                     "\t\t\t\treturn true;",
1208                     "\t\t\t}",
1209                     "\t\t\t",
1210                     "\t\t}",
1211                     "\t\t ",
1212                     "\t\treturn false;",
1213                     "\t}",
1214                     "\t//if (j.xtype != \"PlainFile\") {",
1215                     "\t//\treturn false;",
1216                     "\t//}",
1217                     " \tif (j.content_type.contains(\"image\")) {",
1218                     "\t\treturn false;",
1219                     "\t}",
1220                     "\t\t\t ",
1221                     "\tif (str.length < 1) { // no search.",
1222                     "\t\treturn true;",
1223                     "\t}",
1224                     "\tif (j.name.down().contains(str)) {",
1225                     "\t\treturn true;",
1226                     "\t}",
1227                     "\treturn false; ",
1228                     "",
1229                     "}"
1230                    ],
1231                    "id" : "treefilter",
1232                    "xtype" : "CustomFilter"
1233                   }
1234                  ],
1235                  "xtype" : "FilterListModel"
1236                 }
1237                ],
1238                "xtype" : "SingleSelection"
1239               },
1240               {
1241                "$ xns" : "Gtk",
1242                "* init" : [
1243                 "{",
1244                 "\t// this.el.set_sorter(  new Gtk.StringSorter(",
1245                 "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
1246                 " //\t));",
1247                 "\t\t",
1248                 "}",
1249                 ""
1250                ],
1251                "* pack" : "append_column",
1252                "bool expand" : true,
1253                "bool resizable" : true,
1254                "id" : "name",
1255                "items" : [
1256                 {
1257                  "$ xns" : "Gtk",
1258                  "* prop" : "factory",
1259                  "listeners" : {
1260                   "bind" : [
1261                    "(listitem) => {",
1262                    "\t",
1263                    "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
1264                    "                \t",
1265                    "            \t",
1266                    "            \t",
1267                    "        \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1268                    "    \tvar expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();",
1269                    "    \t  ",
1270                    "     \tvar hbox = (Gtk.Box) expand.child;",
1271                    " ",
1272                    "\t",
1273                    "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
1274                    "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
1275                    "",
1276                    " ",
1277                    "    \t",
1278                    "    \t if (lbl == null || lbl.label != \"\") { // do not update",
1279                    "    \t \treturn;",
1280                    "     \t}",
1281                    "    \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
1282                    "    \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
1283                    "    ",
1284                    "    \t",
1285                    "    \tvar jr =(JsRender.JsRender) lr.get_item();",
1286                    "    \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
1287                    "    \t",
1288                    "    \t if (jr == null) {",
1289                    "    \t\t GLib.debug(\"Problem getting item\"); ",
1290                    "    \t\t return;",
1291                    "    \t }",
1292                    "",
1293                    "\t\tjr.bind_property(\"icon\",",
1294                    "                img, \"gicon\",",
1295                    "               GLib.BindingFlags.SYNC_CREATE);",
1296                    "",
1297                    "    \t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
1298                    "    \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
1299                    "    \tlbl.tooltip_markup = jr.path;",
1300                    "    \t ",
1301                    "        expand.set_hide_expander(  jr.xtype != \"Dir\" );",
1302                    "     \t expand.set_list_row(lr);",
1303                    "     ",
1304                    "         \t ",
1305                    "                 \t// bind image...",
1306                    "}",
1307                    ""
1308                   ],
1309                   "setup" : [
1310                    "(listitem) => {",
1311                    "\t",
1312                    "\tvar expand = new Gtk.TreeExpander();",
1313                    "\t ",
1314                    "\texpand.set_indent_for_depth(true);",
1315                    "\texpand.set_indent_for_icon(true);",
1316                    "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
1317                    "\tvar icon = new Gtk.Image();",
1318                    "\ticon.margin_end = 4;",
1319                    "\tvar lbl = new Gtk.Label(\"\");",
1320                    "\tlbl.use_markup = true;",
1321                    "\t",
1322                    "\t",
1323                    " \tlbl.justify = Gtk.Justification.LEFT;",
1324                    " \tlbl.xalign = 0;",
1325                    "",
1326                    " \thbox.append(icon);",
1327                    "\thbox.append(lbl);",
1328                    "\texpand.set_child(hbox);",
1329                    "\t((Gtk.ListItem)listitem).set_child(expand);",
1330                    "\t((Gtk.ListItem)listitem).activatable = false;",
1331                    "}",
1332                    ""
1333                   ]
1334                  },
1335                  "xtype" : "SignalListItemFactory"
1336                 }
1337                ],
1338                "string title" : "All Project Files",
1339                "xtype" : "ColumnViewColumn"
1340               }
1341              ],
1342              "xtype" : "ColumnView"
1343             }
1344            ],
1345            "string tooltip_text" : [
1346             "dbl-click - opens in NEW window                        ",
1347             "shift--dbl-click opens in this window"
1348            ],
1349            "string xns" : "Gtk",
1350            "string xtype" : "ScrolledWindow"
1351           }
1352          ],
1353          "xtype" : "Paned"
1354         }
1355        ],
1356        "xtype" : "Box",
1357        "| void show" : [
1358         "() {",
1359         "\t_this.splitview.el.show_sidebar = true;",
1360         "  \t ",
1361         "\t_this.filesearch.el.grab_focus();",
1362         "\t_this.winloading = true;",
1363         "\t_this.winmodel.el.remove_all();",
1364         "\t_this.filesearch.el.set_text(\"\");",
1365         "\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {",
1366         "\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));",
1367         "\t}",
1368         "\t_this.winsel.selectCurrent();",
1369         "\t_this.winloading = false;",
1370         "\t",
1371         "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
1372         "\t",
1373         "\t_this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);",
1374         "\t",
1375         "\t_this.treeview.el.set_model(_this.treeselmodel.el);",
1376         "\t",
1377         " \t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
1378         "\t",
1379         "}"
1380        ]
1381       },
1382       {
1383        "$ xns" : "Gtk",
1384        "id" : "keystate",
1385        "int is_shift" : 0,
1386        "listeners" : {
1387         "key_pressed" : [
1388          "(keyval, keycode, state) => {",
1389          "",
1390          " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
1391          " \t\tthis.is_shift = 1;",
1392          " \t\t",
1393          "\t}",
1394          "\t",
1395          "\t",
1396          "\treturn true;",
1397          "\t",
1398          "}",
1399          ""
1400         ],
1401         "key_released" : [
1402          "(keyval, keycode, state) => {",
1403          "\tGLib.debug(",
1404          "\t",
1405          "\t\t\"key release %d, %d, %d  ?= %d %d\" , ",
1406          "\t\t\t(int) keyval, (int)  keycode, state,",
1407          "\t\t\t(int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK",
1408          "\t\t);",
1409          " \tif (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {",
1410          " \t\tthis.is_shift = 0;",
1411          "\t}",
1412          "\t//GLib.debug(\"set state %d , shift = %d\", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);",
1413          "\tif (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {",
1414          "\t\t// ctrl O pressed",
1415          "\t\tif (!_this.splitview.el.show_sidebar) {",
1416          "\t  \t\t_this.sidebar.show(); ",
1417          "\t \t}",
1418          "\t}",
1419          "\t",
1420          "",
1421          " ",
1422          "}"
1423         ]
1424        },
1425        "xtype" : "EventControllerKey"
1426       }
1427      ],
1428      "xtype" : "OverlaySplitView"
1429     }
1430    ],
1431    "listeners" : {
1432     "close_request" : [
1433      "( ) => {",
1434      "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
1435      "\t ",
1436      "\t ",
1437      "\t this.windowstate.file.getLanguageServer().document_close(",
1438      "\t \tthis.windowstate.file",
1439      " \t);",
1440      "\t ",
1441      "\t BuilderApplication.removeWindow(this);",
1442      "\t ",
1443      "\t if (BuilderApplication.windows.size  < 1) {",
1444      "\t \ttry {",
1445      "\t\t\tthis.windowstate.file.getLanguageServer().exit();",
1446      "\t\t} catch(Error e) {}",
1447      "\t\t",
1448      "\t\tBuilderApplication.singleton(  null ).quit();",
1449      "\t }",
1450      "\treturn true;",
1451      "\t",
1452      "}",
1453      ""
1454     ],
1455     "hide" : [
1456      "() =>  {",
1457      " ",
1458      " ",
1459      "",
1460      "}"
1461     ],
1462     "show" : [
1463      "  ( ) => {",
1464      "    // hide the file editing..",
1465      "   ",
1466      "    //this.hideViewEditing();",
1467      "    // this is updated by windowstate - we try and fill it in..",
1468      "     _this.statusbar.el.hide();",
1469      "     //_this.statusbar_errors.el.hide();",
1470      "    //_this.statusbar_warnings.el.hide();",
1471      "    //_this.statusbar_depricated.el.hide();",
1472      "    _this.statusbar_compile_spinner.el.hide();",
1473      "  ",
1474      "    Resources.singleton().checkResources();",
1475      "    ",
1476      "  ",
1477      "",
1478      "}"
1479     ]
1480    },
1481    "string title" : "Roo Application Builder",
1482    "xtype" : "ApplicationWindow",
1483    "| void initChildren" : [
1484     " () {",
1485     "    // this needs putting in a better place..",
1486     "    if (this.windowstate == null) {",
1487     "    \tthis.windowstate = new WindowState(this);",
1488     "    ",
1489     "    }",
1490     "     ",
1491     "",
1492     " ",
1493     "",
1494     "    ",
1495     "",
1496     "",
1497     "",
1498     "}",
1499     ""
1500    ],
1501    "| void openNewWindow" : [
1502     "() {",
1503     " ",
1504     "    var w = new Xcls_MainWindow();",
1505     "    w.ref();",
1506     "\tBuilderApplication.addWindow(w);",
1507     "    w.el.show();",
1508     "    w.initChildren();",
1509     "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
1510     "     ",
1511     "}",
1512     ""
1513    ],
1514    "| void setTitle" : [
1515     " () {",
1516     "    if (_this.windowstate.project == null || ",
1517     "\t    _this.windowstate.file == null",
1518     "    ) {",
1519     "    \tthis.el.set_title(\"Select File\");",
1520     "    \treturn;",
1521     "\t}",
1522     "    _this.el.set_title(",
1523     "    \t_this.windowstate.project.name + ",
1524     "    \t\" - \" +",
1525     "\t\t_this.windowstate.file.relpath);",
1526     "} "
1527    ],
1528    "| void show" : [
1529     "() {",
1530     "   ",
1531     "    this.el.show();",
1532     "    if (this.windowstate.file  == null) {",
1533     "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
1534     "    }",
1535     "}"
1536    ],
1537    "| void updateErrors" : [
1538     "() {",
1539     "",
1540     "",
1541     " \tGLib.debug(\"updateErrors\");",
1542     "\t",
1543     "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
1544     "\t",
1545     "\tthis.statusbar_errors.setNotices(",
1546     "\t\tpr,",
1547     "\t\tthis.windowstate.file.getErrorsTotal(\"ERR\")",
1548     "\t);",
1549     "\t",
1550     "\tthis.statusbar_warnings.setNotices(",
1551     "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
1552     "\t\tthis.windowstate.file.getErrorsTotal(\"WARN\")",
1553     "\t);",
1554     "\tthis.statusbar_depricated.setNotices(",
1555     "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
1556     "\t\tthis.windowstate.file.getErrorsTotal(\"DEPR\")",
1557     "\t);",
1558     "",
1559     "\t_this.statusbar_run.el.hide();",
1560     "",
1561     "\tif (pr.get_n_items() < 1) {",
1562     "\t\t_this.statusbar_run.el.show();",
1563     "\t} ",
1564     "\t",
1565     "}"
1566    ]
1567   }
1568  ],
1569  "name" : "MainWindow"
1570 }