]> 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
Assets management
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / slc / class / org / argeo / slc / ria / SpecsEditorView.js
index 4837ceb456b477f7ce85cce11e340ae3ec0beae6..e1009bcf73206d72c91d0d3870fce7b85c6a7f54 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,8 +92,10 @@ 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
@@ -140,7 +146,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