Return-Path: Delivered-To: apmail-incubator-aries-commits-archive@minotaur.apache.org Received: (qmail 68021 invoked from network); 8 Jun 2010 19:31:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jun 2010 19:31:01 -0000 Received: (qmail 1312 invoked by uid 500); 8 Jun 2010 19:31:01 -0000 Delivered-To: apmail-incubator-aries-commits-archive@incubator.apache.org Received: (qmail 1218 invoked by uid 500); 8 Jun 2010 19:31:01 -0000 Mailing-List: contact aries-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: aries-dev@incubator.apache.org Delivered-To: mailing list aries-commits@incubator.apache.org Received: (qmail 1210 invoked by uid 99); 8 Jun 2010 19:31:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 19:31:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 19:30:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 06BAB23889E2; Tue, 8 Jun 2010 19:30:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r952784 - in /incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat: ComponentStatusGrid.js LayoutManager.js Date: Tue, 08 Jun 2010 19:30:36 -0000 To: aries-commits@incubator.apache.org From: zoe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100608193037.06BAB23889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: zoe Date: Tue Jun 8 19:30:36 2010 New Revision: 952784 URL: http://svn.apache.org/viewvc?rev=952784&view=rev Log: ARIES-319 Move hide-show buttons Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/LayoutManager.js Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js?rev=952784&r1=952783&r2=952784&view=diff ============================================================================== --- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js (original) +++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/ComponentStatusGrid.js Tue Jun 8 19:30:36 2010 @@ -21,6 +21,7 @@ dojo.provide("goat.ComponentStatusGrid"); dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.data.ItemFileWriteStore"); +dojo.require("dijit.form.Button"); //TODO: @@ -28,12 +29,26 @@ dojo.require("dojo.data.ItemFileWriteSto //it knows too much about component properties at present. dojo.declare("goat.ComponentStatusGrid", [], { + hideButton: null, + showButton: null, hidecoords: true, grid:null, jsonStore:null, dataItems:{ identifier : 'id', label : 'name', items : [] }, lastMouseOverIndex:-1, -constructor : function(where) { + + constructor : function(where) { + + this.hideButton = new dijit.form.Button( + {label: "Hide All", onClick: function(){_this.hideAll();} }); + + this.showButton = new dijit.form.Button( + {label: "Show All", onClick: function(){_this.showAll();} }); + + dojo.byId(where).appendChild(this.hideButton.domNode); + dojo.byId(where).appendChild(this.showButton.domNode); + + var layout = [ { name : "Unique ID", @@ -51,7 +66,7 @@ constructor : function(where) { }, { name : "State", field : "state", - width : "12px", + width : "30px", formatter : this.makeStateImage }, { name : "x", @@ -66,7 +81,7 @@ constructor : function(where) { }, { name: 'Show', field: 'id', - width: '22px', + width: '30px', formatter: this.makeHideButton } ]; @@ -78,9 +93,14 @@ constructor : function(where) { var grid = new dojox.grid.DataGrid( { structure : layout, store : this.jsonStore - }, where); + }); + + dojo.byId(where).appendChild(grid.domNode); + grid.startup(); + console.log(dojo.byId(where)); + var _this=this; dojo.connect(window, "onresize", grid, "resize"); @@ -238,5 +258,28 @@ makeStateImage: function(state){ hideButton = hideButton + state + "\" title=\""+state+"\">"; } return hideButton; +}, +hideAll: function() { + console.log("Hiding all bundles"); + for (var componentNumber in components) { + var component = components[componentNumber]; + if(component!=null){ + if(!component.hidden) { + component.toggleHidden(); + } + } + } +}, + +showAll: function() { + console.log("Showing all bundles"); + for (var componentNumber in components) { + var component = components[componentNumber]; + if(component!=null){ + if(component.hidden) { + component.toggleHidden(); + } + } + } } }); Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/LayoutManager.js URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/LayoutManager.js?rev=952784&r1=952783&r2=952784&view=diff ============================================================================== --- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/LayoutManager.js (original) +++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/LayoutManager.js Tue Jun 8 19:30:36 2010 @@ -70,12 +70,6 @@ dojo.declare("goat.LayoutManager", [], { this.saveButton = new dijit.form.Button( {label: "Save Coords", onClick: function(){_this.saveCoords();} }); - this.hideButton = new dijit.form.Button( - {label: "Hide All", onClick: function(){_this.hideAll();} }); - - this.showButton = new dijit.form.Button( - {label: "Show All", onClick: function(){_this.showAll();} }); - this.layouts = new dojo.data.ItemFileWriteStore( {data : {identifier: 'name', items: this.items }}); @@ -86,8 +80,6 @@ dojo.declare("goat.LayoutManager", [], { dojo.byId(where).appendChild(this.layoutSelector.domNode); dojo.byId(where).appendChild(this.loadButton.domNode); dojo.byId(where).appendChild(this.saveButton.domNode); - dojo.byId(where).appendChild(this.hideButton.domNode); - dojo.byId(where).appendChild(this.showButton.domNode); this.disable(); @@ -95,36 +87,6 @@ dojo.declare("goat.LayoutManager", [], { dojo.subscribe("goat.provider.change", this, this.onProviderChange); }, - hideAll: function() { - console.log("Hiding all bundles"); - for (var componentNumber in components) { - var component = components[componentNumber]; - //console.log("got Comp"); - //console.log(component); - if(component!=null){ - //If it isn't hidden already - if(!component.hidden) { - component.toggleHidden(); - } - } - } - }, - - showAll: function() { - console.log("Showing all bundles"); - for (var componentNumber in components) { - var component = components[componentNumber]; - //console.log("got Comp"); - //console.log(component); - if(component!=null){ - //If bundle is hidden make it visible - if(component.hidden) { - component.toggleHidden(); - } - } - } - }, - onProviderChange: function(evt){ console.log("OnProviderChange"); console.log(evt);