]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/ViewsManager.js
2678eba51920d78641748aa5665fd2c1ab34534d
2 * @author Charles du Jeu
4 qx
.Class
.define("org.argeo.ria.components.ViewsManager",
7 extend
: qx
.core
.Object
,
10 applicationRoot
: {init
: null},
11 viewPanesContainer
: {init
: null}
13 construct : function(){
18 initIViewClass: function(classObj
, viewPaneId
){
19 //var iView = eval("new "+iViewClass+"()");
20 //var classObj = qx.Class.getByName(iViewClass);
21 var iView
= new classObj
;
22 var viewPane
= this.getViewPaneById(viewPaneId
);
24 var commands
= iView
.getCommands();
27 viewPane
.setCommands(commands
);
28 org
.argeo
.ria
.event
.CommandsManager
.getInstance().addCommands(commands
, iView
);
30 viewPane
.setContent(iView
);
34 registerViewPane : function(viewPane
){
35 this.views
[viewPane
.getViewId()] = viewPane
;
36 viewPane
.getViewSelection().addListener("changeSelection", function(e
){
37 org
.argeo
.ria
.event
.CommandsManager
.getInstance().refreshCommands(e
.getData());
40 getViewPaneById : function(viewPaneId
){
41 if(this.views
[viewPaneId
]) return this.views
[viewPaneId
];
42 throw new Error("Cannot find view '"+viewPaneId
+"'");
44 getViewPaneSelection : function(viewPaneId
){
45 return this.getViewPaneById(viewPaneId
).getViewSelection();
47 setViewPaneTitle : function(viewPaneId
, viewTitle
){
48 this.getViewPaneById(viewPaneId
).setViewTitle(viewTitle
);