]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/ViewSelection.js
Fix bug with NOT CLOSED instead of date format
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / source / class / org / argeo / ria / components / ViewSelection.js
index 8f81f0a766f0bfc14347c3dd85bb51d171d2aca4..6c3e873abe37b1a0368e27fe4910ec036c012918 100644 (file)
@@ -1,7 +1,15 @@
+/**\r
+ * Generic selection model associated to an IView content opened in a given ViewPane.\r
+ * It contains in an array any row/data/node, and triggers changeSelection data events.\r
+ * @author Charles du Jeu\r
+ */\r
 qx.Class.define("org.argeo.ria.components.ViewSelection",\r
 {\r
   extend : qx.core.Object,\r
   \r
+  /**\r
+   * @param viewId {String} The ViewPane unique id\r
+   */\r
   construct : function(viewId){\r
        this.base(arguments);\r
        this.nodes = [];\r
@@ -9,6 +17,9 @@ qx.Class.define("org.argeo.ria.components.ViewSelection",
   },\r
 \r
   properties : {\r
+       /**\r
+        * The viewPane unique id \r
+        */\r
        viewId : {\r
        check : "String",\r
        nullable: false\r
@@ -16,6 +27,9 @@ qx.Class.define("org.argeo.ria.components.ViewSelection",
   },\r
   \r
   events : {\r
+       /**\r
+        * Triggered each time the selection changes.\r
+        */\r
        "changeSelection" : "qx.event.type.Data"\r
   },\r
   \r
@@ -27,24 +41,42 @@ qx.Class.define("org.argeo.ria.components.ViewSelection",
 \r
   members :\r
   {\r
+       /**\r
+        * Empty the selection\r
+        */\r
        clear : function(){\r
                this.nodes = [];\r
                this.triggerEvent();\r
        },\r
        \r
+       /**\r
+        * Add a row or xml node or whatever\r
+        * @param node {mixed} Data to add to the selection\r
+        */\r
     addNode : function(node) {\r
        this.nodes.push(node);\r
        this.triggerEvent();\r
     },\r
     \r
+    /**\r
+     * The number of rows/nodes selected\r
+     * @return {Integer}\r
+     */\r
     getCount : function() {\r
        return this.nodes.length;\r
     },\r
     \r
+    /**\r
+     * Returns the content of the selection \r
+     * @return {Array}\r
+     */\r
     getNodes : function(){\r
        return this.nodes;\r
     },\r
     \r
+    /**\r
+     * Creates and fire a data event changeSelection\r
+     */\r
     triggerEvent : function(){\r
        this.fireDataEvent("changeSelection", this);\r
     }\r