incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
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 GMT
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);



Mime
View raw message