]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SpecsEditorView.js
Cleaning, ref management, label/tooltips in tree, etc.
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / slc / class / org / argeo / slc / ria / SpecsEditorView.js
index 4837ceb456b477f7ce85cce11e340ae3ec0beae6..dcc9a2660767a9a3b0d2fb201ef78d0ab576c9a3 100644 (file)
@@ -16,7 +16,7 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView",
                        init : {\r
                                "updateData" : {\r
                                        label : "Edit Execution Specs",\r
-                                       icon : "resource/slc/document-open.png",\r
+                                       icon : "org.argeo.slc.riadocument-open.png",\r
                                        shortcut : null,\r
                                        enabled : false,\r
                                        menu : null,\r
@@ -25,9 +25,11 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView",
                                        selectionChange : function(viewId, selection) {\r
                                                if (viewId != "batch:list")\r
                                                        return;\r
+                                               var view = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent();\r
                                                if ((selection && selection.length == 1)) {\r
-                                                       var view = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent();\r
                                                        view.setBatchEntrySpec(selection[0].getUserData("batchEntrySpec"));\r
+                                               }else{\r
+                                                       view.setBatchEntrySpec(null);\r
                                                }\r
                                        },\r
                                        command : null                                  \r
@@ -69,7 +71,9 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView",
                        this.setView(viewPane);                 \r
                        this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId()));\r
                                                \r
-                       this.addListener("changeBatchEntrySpec", this.updateData, this);                        \r
+                       this.addListener("changeBatchEntrySpec", this.updateData, this);\r
+                       this._emptyTitleString = "Script Parameters (select a script to edit)";\r
+                       this._editorTitleString = "Script '%1' Parameters";\r
                },\r
                /**\r
                 * The implementation should contain the real data loading (i.o. query...)\r
@@ -77,7 +81,7 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView",
                 */\r
                load : function(){\r
                        this._createLayout();\r
-                       this.getView().setViewTitle("Specs Editor");\r
+                       this.getView().setViewTitle(this._emptyTitleString);\r
                },\r
                \r
                /**\r
@@ -88,20 +92,23 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView",
                        var batchEntry = event.getData();\r
                        if(batchEntry == null){\r
                                this.tableModel.setData([]);\r
+                               this.getView().setViewTitle(this._emptyTitleString);\r
                                return;\r
                        }\r
+                       this.getView().setViewTitle(qx.lang.String.format(this._editorTitleString, [batchEntry.getFlow().getName()]));\r
                        var values = batchEntry.getValues();\r
                        var data = [];\r
                        for(var key in values){\r
                                var valueObj = values[key];\r
                                var hidden = valueObj.getHidden();\r
                                var type = valueObj.getSpecType();\r
-                               if(type == "primitive" && !hidden){\r
+                               if((type == "primitive" || type== "ref")&& !hidden){\r
                                        metadata = {\r
                                                key : key,\r
                                                disabled : valueObj.getFrozen(),\r
                                                type : type,\r
-                                               subType : valueObj.getSpecSubType() \r
+                                               subType : valueObj.getSpecSubType(),\r
+                                               refList : (type=="ref"?valueObj.getRefList():[])\r
                                        }\r
                                        data.push([key, valueObj.getValue(), metadata]);\r
                                }\r
@@ -140,7 +147,7 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView",
                        var factory = new org.argeo.slc.ria.execution.CellEditorFactory();\r
                        columnModel.setCellEditorFactory(1, factory);\r
                        columnModel.setDataCellRenderer(1, factory);\r
-                       columnModel.getBehavior().setWidth(0, "70%");\r
+                       columnModel.getBehavior().setWidth(0, "40%");\r
                        this.add(this.table, {edge:"center"});\r
                },              \r
                \r