Fix various things in the launcher perspective, better layout.
authorCharles du Jeu <charles.dujeu@gmail.com>
Sat, 23 May 2009 09:19:27 +0000 (09:19 +0000)
committerCharles du Jeu <charles.dujeu@gmail.com>
Sat, 23 May 2009 09:19:27 +0000 (09:19 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2437 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/LauncherPerspective.js
server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/BatchView.js
server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SpecsEditorView.js
server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/drophere.gif [new file with mode: 0644]
server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/user-trash-full.png [new file with mode: 0644]

index aa6eabeb049bb656a30841142e9af753f3d3f761..bf09f11bbe7bcf0979f8e41921105924729d3287 100644 (file)
@@ -31,7 +31,7 @@ qx.Class.define("org.argeo.slc.web.LauncherPerspective",
          viewsManager.registerViewPane(selectorPane);\r
          \r
          var batchPane = new org.argeo.ria.components.ViewPane("batch", "Batch");\r
-         batchPane.set({width: 600, height:300});\r
+         batchPane.set({width: 500, height:500});\r
          viewsManager.registerViewPane(batchPane);\r
          \r
          var logPane = new org.argeo.ria.components.ViewPane("main", "Executions Log");\r
@@ -73,6 +73,7 @@ qx.Class.define("org.argeo.slc.web.LauncherPerspective",
                viewsManager.getViewPaneById("main").empty();\r
                viewsManager.getViewPaneById("batch").empty();\r
                viewsManager.getViewPaneById("selector").empty();\r
+               viewsManager.getViewPaneById("editor").empty();\r
                viewsManager.getViewPanesContainer().remove(this._splitPane);           \r
        }       \r
        \r
index 18deeaf49dd30f6ee719bf40d41c80a1a7dde175..6a7f50b8e2efc7f24aee4fa1591d859863e23475 100644 (file)
@@ -104,7 +104,23 @@ qx.Class.define("org.argeo.slc.ria.BatchView",
                                                        this.setEnabled(true);\r
                                        },\r
                                        command : null\r
-                               }                               \r
+                               },\r
+                               "clearbatch" : {\r
+                                       label : "Clear batch",\r
+                                       icon : "resource/slc/user-trash-full.png",\r
+                                       shortcut : null,\r
+                                       enabled : true,\r
+                                       menu : "Launcher",\r
+                                       toolbar : "batch",\r
+                                       callback : function(e) {\r
+                                               if(!this.list.hasChildren()) return;\r
+                                               this.list.selectAll();\r
+                                               this.getCommands()["removefrombatch"].command.execute();\r
+                                       },\r
+                                       selectionChange : function(viewId, selection) {\r
+                                       },\r
+                                       command : null\r
+                               }                                                               \r
                        }\r
                },\r
                view : {\r
@@ -251,15 +267,27 @@ qx.Class.define("org.argeo.slc.ria.BatchView",
                                                }\r
                                        }, this);\r
 \r
+                       this.dropDecorator = new qx.ui.decoration.Background();                 \r
+                       this.dropDecorator.set({\r
+                               backgroundImage : "resource/slc/drophere.gif",\r
+                               backgroundRepeat : "no-repeat"\r
+                       });\r
+\r
+                                       \r
                        listChangeListener = function() {\r
                                var command = org.argeo.ria.event.CommandsManager.getInstance()\r
                                                .getCommandById("submitform");\r
                                command.setEnabled(this.list.hasChildren());\r
+                               var command2 = org.argeo.ria.event.CommandsManager.getInstance()\r
+                                               .getCommandById("clearbatch");\r
+                               command2.setEnabled(this.list.hasChildren());\r
+                               this.list.setDecorator((this.list.hasChildren()?null:this.dropDecorator));\r
                        };\r
                        this.list.addListener("addItem", listChangeListener, this);\r
                        this.list.addListener("removeItem", listChangeListener, this);\r
-\r
-                       \r
+                               \r
+                       this.list.setDecorator(this.dropDecorator);\r
+                                               \r
                        this.add(this.listPane);\r
                },              \r
                \r
index 4837ceb456b477f7ce85cce11e340ae3ec0beae6..8d413690d776030a9288a3a410edeed41d16670a 100644 (file)
@@ -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
diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/drophere.gif b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/drophere.gif
new file mode 100644 (file)
index 0000000..a861da9
Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/drophere.gif differ
diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/user-trash-full.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/user-trash-full.png
new file mode 100644 (file)
index 0000000..aa9d732
Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/user-trash-full.png differ