X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fargeo-ria-src%2Fclass%2Forg%2Fargeo%2Fria%2Fcomponents%2FViewPane.js;h=174174a7cc6b004f089665b2643bbc5045cba13c;hb=9c9a5e3c65af408ae4d5cd035fa5ce53c6fd8555;hp=a82420b202a805ea03b04879573cac0b28607576;hpb=a99586a49718b1f65c221addc8cb96227de65531;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js index a82420b20..174174a7c 100644 --- a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js +++ b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js @@ -19,14 +19,21 @@ qx.Class.define("org.argeo.ria.components.ViewPane", this.setViewId(viewId); this._defaultViewTitle = viewTitle; this.setViewTitle(viewTitle); - var viewSelection = new org.argeo.ria.components.ViewSelection(viewId); - this.setViewSelection(viewSelection); if(splitPaneData){ this.setSplitPaneData(splitPaneData); } + this.setFocusable(true); + this.addListener("click", function(e){ + this.fireDataEvent("changeFocus", this); + }, this); this.createGui(); }, + events : { + "changeFocus" : "qx.event.type.Data", + "changeSelection" : "qx.event.type.Event" + }, + properties : { /** @@ -37,10 +44,6 @@ qx.Class.define("org.argeo.ria.components.ViewPane", * Human-readable title for this view */ viewTitle : {init:"", event:"changeViewTitle"}, - /** - * Selection model for this view - */ - viewSelection : { nullable:false, check:"org.argeo.ria.components.ViewSelection" }, /** * Has its own scrollable content */ @@ -127,11 +130,22 @@ qx.Class.define("org.argeo.ria.components.ViewPane", */ }, + getViewSelection : function(){ + if(this.getContent()){ + return this.getContent().getViewSelection(); + } + return null; + }, + + contentExists : function(iViewId){ + return false; + }, + /** * Sets the content of this pane. * @param content {org.argeo.ria.components.IView} An IView implementation */ - _applyContent : function(content){ + _applyContent : function(content){ if(content == null) return; var addScrollable = (content.addScroll?content.addScroll():false); if(addScrollable){ @@ -142,6 +156,9 @@ qx.Class.define("org.argeo.ria.components.ViewPane", this.guiContent = content; this.add(this.guiContent, {flex:1}); } + content.getViewSelection().addListener("changeSelection", function(e){ + this.fireEvent("changeSelection"); + }, this); }, /** * Adds a graphical component too the header of the view pane. @@ -187,6 +204,17 @@ qx.Class.define("org.argeo.ria.components.ViewPane", } this.setViewTitle(this._defaultViewTitle); this.setContent(null); + }, + + focus : function(){ + if(this.hasFocus) return; + this.setDecorator(new qx.ui.decoration.Single(1,"solid","#065fb2")); + this.fireEvent("changeSelection"); + this.hasFocus = true; + }, + blur : function(){ + this.hasFocus = false; + this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000")); } }