]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js
git-svn-id: https://svn.argeo.org/slc/trunk@2380 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-src / class / org / argeo / ria / components / TabbedViewPane.js
index c5ed23ada0c278b4f9a62b71da8e89c422098e4b..27742dd41a15ce85d470d97fa5d63d1b85361525 100644 (file)
@@ -1,3 +1,8 @@
+/**\r
+ * A more elaborate views container than ViewPane, as it can handle multiple contents\r
+ * at once via a TabView.\r
+ * See {@link org.argeo.ria.components.ViewPane}.\r
+ */\r
 qx.Class.define("org.argeo.ria.components.TabbedViewPane",\r
 {\r
        extend : qx.ui.container.Composite,\r
@@ -6,7 +11,6 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
   /**\r
    * @param viewId {String} Unique id of this viewPane\r
    * @param viewTitle {String} Readable Title of this viewPane\r
-   * @param splitPaneData {Map} Additionnal data to be used by splitpanes implementations.\r
    */\r
        construct : function(viewId, viewTitle){\r
                this.base(arguments);\r
@@ -64,12 +68,21 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
        },\r
        \r
        members : {\r
+               /**\r
+                * Checks if the pane already contains a given view, identified by its instance id\r
+                * @param contentId {Mixed} The instance id to check\r
+                * @return {Boolean}\r
+                */\r
                contentExists : function(contentId){\r
                        if(this.pageIds[contentId]){\r
                                this.tabView.setSelected(this.pageIds[contentId]);\r
                                return this.pageIds[contentId].getUserData("argeoria.iview");\r
                        }                                               \r
                },\r
+               /**\r
+                * Sets a new instance in the tabbed pane.\r
+                * @param content {org.argeo.ria.components.IView} The applet to add.\r
+                */\r
                setContent : function(content){\r
                        if(!this.tabView.getChildren().length){\r
                                this.tabView.setBackgroundColor("transparent");\r
@@ -88,19 +101,34 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
                        }, this);\r
                        this.tabView.setSelected(page);\r
                },\r
+               /**\r
+                * Get the currently selected tab content, if any.\r
+                * @return {org.argeo.ria.components.IView} The currently selected view.\r
+                */\r
                getContent : function(){\r
                        if(this._getCrtPage()){\r
                                return this._getCrtPage().getUserData("argeoria.iview");\r
                        }\r
                        return null;\r
                },\r
+               /**\r
+                * Get the currently selected tab ViewSelection object.\r
+                * @return {org.argeo.ria.components.ViewSelection} The view selection object of the currently selected view.\r
+                */\r
                getViewSelection : function(){\r
                        if(!this.getContent()) return null;\r
                        return this.getContent().getViewSelection();\r
                },\r
+               /**\r
+                * Return the currently selected tab Page.\r
+                * @return {qx.ui.tabview.Page} The page\r
+                */\r
                _getCrtPage : function(){\r
                        return this.tabView.getSelected();\r
                },\r
+               /**\r
+                * Closes the currently selected view and remove all tabs components (button, page).\r
+                */\r
                closeCurrent : function(){\r
                        var crtPage = this._getCrtPage();\r
                        if(!crtPage) return;\r
@@ -118,6 +146,9 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
                                this.tabView.setMarginTop(27);\r
                        }                                               \r
                },\r
+               /**\r
+                * Call closeCurrent() recursively until there is no more page.\r
+                */\r
                empty : function(){\r
                        var crtPage = this._getCrtPage();\r
                        while(crtPage){\r
@@ -125,14 +156,27 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
                                crtPage = this._getCrtPage();\r
                        }\r
                },\r
+               /**\r
+                * Sets the tabView on "load" state. Nothing is done at the moment.\r
+                * @param load {Boolean} Load status\r
+                */\r
                setOnLoad : function(load){\r
                        \r
                },\r
+               /**\r
+                * Sets a graphical indicator that this pane has the focus. A blue border.\r
+                */\r
                focus : function(){\r
+                       if(this.hasFocus) return;\r
                        this.fireEvent("changeSelection");\r
                        this.setDecorator(this.focusedDecorator);\r
+                       this.hasFocus = true;\r
                }, \r
+               /**\r
+                * Remove a graphical focus indicator on this pane.\r
+                */\r
                blur : function(){\r
+                       this.hasFocus = false;\r
                        this.setDecorator(this.blurredDecorator);\r
                }\r
        }\r