]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/slc/web/components/View.js
08d13cdbd6367bf725b1212a3a853fe6fa75fa35
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / source / class / org / argeo / slc / web / components / View.js
1 /**
2 * @author Charles
3 */
4 /**
5 * This is the main application class of your custom application "sparta"
6 */
7 qx.Class.define("org.argeo.slc.web.components.View",
8 {
9 extend : qx.ui.container.Composite,
10
11 construct : function(viewId, viewTitle){
12 this.base(arguments);
13 this.setViewId(viewId);
14 this.setViewTitle(viewTitle);
15 var viewSelection = new org.argeo.slc.web.components.ViewSelection(viewId);
16 this.setViewSelection(viewSelection);
17 this.createGui();
18 },
19
20 properties :
21 {
22 viewId : {init:""},
23 viewTitle : {init:""},
24 viewSelection : { nullable:false },
25 ownScrollable : {init: false}
26 },
27
28 /*
29 *****************************************************************************
30 MEMBERS
31 *****************************************************************************
32 */
33
34 members :
35 {
36 createGui : function(){
37 this.setLayout(new qx.ui.layout.VBox());
38 this.header = new qx.ui.container.Composite();
39 this.header.setLayout(new qx.ui.layout.HBox());
40 this.header.set({appearance:"app-header"});
41 this.header.add(new qx.ui.basic.Label(this.getViewTitle()));
42 this.add(this.header);
43 this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000"));
44 },
45
46 setContent : function(content, addScrollable){
47 if(addScrollable){
48 this.setOwnScrollable(true);
49 this.scrollable = new qx.ui.container.Scroll(content);
50 this.add(this.scrollable, {flex: 1});
51 }else{
52 this.content = content;
53 this.add(this.content, {flex:1});
54 }
55 },
56
57 empty: function(){
58 if(this.getOwnScrollable() && this.scrollable){
59 this.remove(this.scrollable);
60 }else if(this.content){
61 this.remove(this.content);
62 }
63 }
64
65 }
66 });