]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js
A dynamic folder that will take a loader function as argument and then can be reloaded.
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-src / class / org / argeo / ria / components / ViewPane.js
index bc7c8daa0a82e8cb455a2edabbe06e3678660b9f..0ca43f32d1d4b983820651ee46e20aff2a2a4b80 100644 (file)
@@ -30,7 +30,13 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
   },
 
   events : {
+       /**
+        * Trigger when the focus is changing
+        */
        "changeFocus" : "qx.event.type.Data",
+       /**
+        * Triggered when selection of content has changed.
+        */
        "changeSelection" : "qx.event.type.Event"
   },
   
@@ -130,14 +136,25 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
                */
        },
        
+       /**
+        * Get the content ViewSelection object.
+        * @return {org.argeo.ria.components.ViewSelection} The view selection
+        */
        getViewSelection : function(){
                if(this.getContent()){
                        return this.getContent().getViewSelection();
                }
                return null;
        },
-       
+       /**
+        * Checks if the pane already contains a given view, identified by its instance id
+        * @param iViewId {Mixed} The instance id to check
+        * @return {Boolean}
+        */     
        contentExists : function(iViewId){
+               if(this.getContent()){
+                       this.empty();
+               }
                return false;
        },
        
@@ -185,7 +202,14 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
                        this.header.remove(this.loadImage);
                }
        },
-       
+
+       /**
+        * Call empty() method, since this pane can only handle one view.
+        */
+       closeCurrent : function(){
+               this.empty();
+       },
+               
        /**
         * Removes and destroy the IView content of this viewPane.
         */
@@ -205,14 +229,20 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
                this.setViewTitle(this._defaultViewTitle);
                this.setContent(null);
        },
-       
+       /**
+        * Sets a graphical indicator that this pane has the focus. A blue border.
+        */     
        focus : function(){
+               if(this.hasFocus) return;
                this.setDecorator(new qx.ui.decoration.Single(1,"solid","#065fb2"));
-               qx.event.Timer.once(function(){
-                       this.fireEvent("changeSelection");
-               }, this, 200);
+               this.fireEvent("changeSelection");
+               this.hasFocus = true;
        }, 
+       /**
+        * Remove a graphical focus indicator on this pane.
+        */
        blur : function(){
+               this.hasFocus = false;
                this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000"));
        }