From: Charles du Jeu Date: Sat, 23 May 2009 09:19:27 +0000 (+0000) Subject: Fix various things in the launcher perspective, better layout. X-Git-Tag: argeo-slc-2.1.7~1888 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=bf27bbe08d2a25a36bd91a1a116cce196e0537f8;p=gpl%2Fargeo-slc.git Fix various things in the launcher perspective, better layout. git-svn-id: https://svn.argeo.org/slc/trunk@2437 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/LauncherPerspective.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/LauncherPerspective.js index aa6eabeb0..bf09f11bb 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/LauncherPerspective.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/LauncherPerspective.js @@ -31,7 +31,7 @@ qx.Class.define("org.argeo.slc.web.LauncherPerspective", viewsManager.registerViewPane(selectorPane); var batchPane = new org.argeo.ria.components.ViewPane("batch", "Batch"); - batchPane.set({width: 600, height:300}); + batchPane.set({width: 500, height:500}); viewsManager.registerViewPane(batchPane); var logPane = new org.argeo.ria.components.ViewPane("main", "Executions Log"); @@ -73,6 +73,7 @@ qx.Class.define("org.argeo.slc.web.LauncherPerspective", viewsManager.getViewPaneById("main").empty(); viewsManager.getViewPaneById("batch").empty(); viewsManager.getViewPaneById("selector").empty(); + viewsManager.getViewPaneById("editor").empty(); viewsManager.getViewPanesContainer().remove(this._splitPane); } diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/BatchView.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/BatchView.js index 18deeaf49..6a7f50b8e 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/BatchView.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/BatchView.js @@ -104,7 +104,23 @@ qx.Class.define("org.argeo.slc.ria.BatchView", this.setEnabled(true); }, command : null - } + }, + "clearbatch" : { + label : "Clear batch", + icon : "resource/slc/user-trash-full.png", + shortcut : null, + enabled : true, + menu : "Launcher", + toolbar : "batch", + callback : function(e) { + if(!this.list.hasChildren()) return; + this.list.selectAll(); + this.getCommands()["removefrombatch"].command.execute(); + }, + selectionChange : function(viewId, selection) { + }, + command : null + } } }, view : { @@ -251,15 +267,27 @@ qx.Class.define("org.argeo.slc.ria.BatchView", } }, this); + this.dropDecorator = new qx.ui.decoration.Background(); + this.dropDecorator.set({ + backgroundImage : "resource/slc/drophere.gif", + backgroundRepeat : "no-repeat" + }); + + listChangeListener = function() { var command = org.argeo.ria.event.CommandsManager.getInstance() .getCommandById("submitform"); command.setEnabled(this.list.hasChildren()); + var command2 = org.argeo.ria.event.CommandsManager.getInstance() + .getCommandById("clearbatch"); + command2.setEnabled(this.list.hasChildren()); + this.list.setDecorator((this.list.hasChildren()?null:this.dropDecorator)); }; this.list.addListener("addItem", listChangeListener, this); this.list.addListener("removeItem", listChangeListener, this); - - + + this.list.setDecorator(this.dropDecorator); + this.add(this.listPane); }, diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SpecsEditorView.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SpecsEditorView.js index 4837ceb45..8d413690d 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SpecsEditorView.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SpecsEditorView.js @@ -25,9 +25,11 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView", selectionChange : function(viewId, selection) { if (viewId != "batch:list") return; + var view = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent(); if ((selection && selection.length == 1)) { - var view = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent(); view.setBatchEntrySpec(selection[0].getUserData("batchEntrySpec")); + }else{ + view.setBatchEntrySpec(null); } }, command : null @@ -69,7 +71,9 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView", this.setView(viewPane); this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); - this.addListener("changeBatchEntrySpec", this.updateData, this); + this.addListener("changeBatchEntrySpec", this.updateData, this); + this._emptyTitleString = "Script Parameters (select a script to edit)"; + this._editorTitleString = "Script '%1' Parameters"; }, /** * The implementation should contain the real data loading (i.o. query...) @@ -77,7 +81,7 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView", */ load : function(){ this._createLayout(); - this.getView().setViewTitle("Specs Editor"); + this.getView().setViewTitle(this._emptyTitleString); }, /** @@ -88,8 +92,10 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView", var batchEntry = event.getData(); if(batchEntry == null){ this.tableModel.setData([]); + this.getView().setViewTitle(this._emptyTitleString); return; } + this.getView().setViewTitle(qx.lang.String.format(this._editorTitleString, [batchEntry.getFlow().getName()])); var values = batchEntry.getValues(); var data = []; for(var key in values){ @@ -140,7 +146,7 @@ qx.Class.define("org.argeo.slc.ria.SpecsEditorView", var factory = new org.argeo.slc.ria.execution.CellEditorFactory(); columnModel.setCellEditorFactory(1, factory); columnModel.setDataCellRenderer(1, factory); - columnModel.getBehavior().setWidth(0, "70%"); + columnModel.getBehavior().setWidth(0, "40%"); this.add(this.table, {edge:"center"}); }, 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 index 000000000..a861da99b 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 index 000000000..aa9d7321f Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/user-trash-full.png differ